Support

Home Forums Event Espresso Premium Validate the billing ZIP code (2)

Validate the billing ZIP code (2)

Posted: August 23, 2019 at 5:11 am


psergerie

August 23, 2019 at 5:11 am

Hi EE Team,

(Please refer to my previous unresolved topic for historical purposes : Previous topic)

I have contacted Stripe to understand how to customize the stripe checkout window placeholder for the postal code validation field and they are asking which version of Stripe Checkout you are using. Could you please provide this information ?

Best regards,

Patrick

  • This topic was modified 3 weeks, 6 days ago by  Josh. Reason: fixed link to previous topic


Josh

  • Support Staff

August 23, 2019 at 7:27 am

Hi Patrick,

For Stripe Checkout it uses version 2, which is considered legacy.

Then, added in a recent version, Stripe Elements with Payment Intents was added as an option.


psergerie

August 28, 2019 at 7:11 pm

Hi Josh,

OK, I am giving up trying to translate ‘CP’ into ‘Code Postal’. You guys are saying that it is under Stripe control and Stripe are saying the opposite. After digging into all EE files, I am giving up !

Now, Stripe told me that I can use Stripe Element instead of Stripe Checkout since Event Espresso is now using that API. They also told me that this API should show ‘Code Postal’ when validating the postal code when french language setting is selected. But it seems EE is not using postal code validation when using Stripe Element API (I have tested multiple card numbers and web browsers and postal code is never asked). I have double checked this by browsing the code in all EE Stripe plugin files, especially stripe_elements_form.template.php. In addition, the payment form is half translated. As an example, the “What’s this” label and the “Expiry Date (MM/YY)” label are not translated even though their placeholders are ! As for other missing translation, I have tried using the “gettext” filter without success.

I am desperately seeking your help for :

1) How to translate the Stripe Elements form in french ?
2) Does the Stripe Elements API is using postal code validation ? Should I use postal code validation which seems to be recommended in some countries ? For your information, we are expecting European customers to register to one of our event. I understand that it is therefore recommended to use Stripe Elements API since it provide “Strong Customer Authentication” that will be required as of next September 14th.
3) How can I get a nice, clean and dynamic form as the one shown on this Stripe page?

Thanks in advance.

Regards,

Patrick


Tony

  • Support Staff

August 29, 2019 at 5:36 am

OK, I am giving up trying to translate ‘CP’ into ‘Code Postal’. You guys are saying that it is under Stripe control and Stripe are saying the opposite. After digging into all EE files, I am giving up !

As mentioned in your previous thread, the only thing we can send over to Stripe for postal code is setting data-zip-code to either true or false. Which tells Stripe to either automatically verify postal codes if needed or not at all, thats the only option availabel for zip/postal code.

Heres the doc for the integration method we are using:

https://stripe.com/docs/legacy-checkout#integration-options-zip-code

We can set the locale to use on checkout should you wish to override whatever it uses and there’s an option for that in Stripes settings, but not specifically for the postal code field.

If anyone from Stripe can highlight how we pass a value onto that version of Stripe checkout to use as a place holder for postal code I will happily provide a snippet that will do it within EE for you but as far as I can tell, there isn’t one which is why I said previously it is controlled by Stripe themselves.

However, that may all now be irrelevant as you can’t use Stripe Checkout v2 with PSD2 anyway, that’s one of the reasons we added the Stripe elements option.

Now, Stripe told me that I can use Stripe Element instead of Stripe Checkout since Event Espresso is now using that API. They also told me that this API should show ‘Code Postal’ when validating the postal code when french language setting is selected. But it seems EE is not using postal code validation when using Stripe Element API (I have tested multiple card numbers and web browsers and postal code is never asked)

It does, but not in the same way as I’m guessing you’ve seen (with a single field collecting the card number, expiry, CVV and zip?)

It uses the zip field from setting ‘Collect the user’s billing address?’ to Yes.

I have double checked this by browsing the code in all EE Stripe plugin files, especially stripe_elements_form.template.php.

It’s set up within the ElementsBillingForm class constructor:

\eea-stripe-payment-method\forms\ElementsBillingForm.php

This is not something you should edit directly but it can be changed via a hook.

In addition, the payment form is half translated. As an example, the “What’s this” label and the “Expiry Date (MM/YY)” label are not translated even though their placeholders are !

Those are new strings added to the plugin so there is no translation for them yet.

The gettext filter should work for them, can you post the code you are using and I’ll find out why its not working for you?

The placeholders for the’elements’ loading on the that are translated via Stripe.

1) How to translate the Stripe Elements form in french ?

For this do you mean the ‘Card Number’, ‘Expiry Date (MM/YY)’ and “CVC (What’s this?” strings or something else?

2) Does the Stripe Elements API is using postal code validation ? Should I use postal code validation which seems to be recommended in some countries ? For your information, we are expecting European customers to register to one of our event. I understand that it is therefore recommended to use Stripe Elements API since it provide “Strong Customer Authentication” that will be required as of next September 14th.

It does, but you need to set the ‘Collect the user’s billing address’ option in the payment method settings to yes.

3) How can I get a nice, clean and dynamic form as the one shown on this Stripe page?

This I don’t think you can do yourself, you would need to override the template file in use and then the Javascript used by the payment method. I’ll check into this and see if it’s possible.

The support post ‘Validate the billing ZIP code (2)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 3 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!