Jump to content
  • 0

Stripe zip code


kepler

Question

Good afternoon

I've installed the module for the Stripe payments, made some tests, and everything is ok. Except, the zip code asked just next the CCC: it does not format correctly with the zip code from Portugal (for example, which are of the type xxxx-xxx). I wish to remove that requirement. I have a website made in WPress, for instance, that asks everything except that. Can someone tell me the line of code and the file in the Stripe gateways dir where I can deactivate the request of the zip code?

Best regards

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi,

Thanks for the reply. For anyone who might need, we just have to go that file ( components/gateways/merchant/stripe_payments/views/default/cc_form.pdt ), and in the line:

// Create an instance of the card Element.
var card = elements.create('card', {style: style});

change it to (hide the zip option):

// Create an instance of the card Element.
var card = elements.create('card', {style: style, hidePostalCode : true});

There are several settings and options we can control described at: https://stripe.com/docs/js/elements_object/create

Best regards,

Kepler

Link to comment
Share on other sites

  • 0

That field comes from the Stripe Elements and Stripe JS API.  It is an iframe that Blesta does not control directly and the zip code field I believe appears conditionally on the kind of card you enter.  You may be able to find some option in the API to alter this behavior.  In that case you would modify the JS in components/gateways/merchant/stripe_payments/views/default/cc_form.pdt 

The API reference is here https://stripe.com/docs/js

Link to comment
Share on other sites

  • 0
On 2/3/2020 at 5:15 PM, kepler said:

Hi,

Thanks for the reply. For anyone who might need, we just have to go that file ( components/gateways/merchant/stripe_payments/views/default/cc_form.pdt ), and in the line:


// Create an instance of the card Element.
var card = elements.create('card', {style: style});

change it to (hide the zip option):


// Create an instance of the card Element.
var card = elements.create('card', {style: style, hidePostalCode : true});

There are several settings and options we can control described at: https://stripe.com/docs/js/elements_object/create

Best regards,

Kepler

@kepler Nice find; thanks for sharing!

@Jono Can this not be integrated into the UI as an option?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...