#devs-cardelement-postalcode
1 messages · Page 1 of 1 (latest)
Hello what is your question?
On this support page
what it would look like I wanted to add an options in the elements.create function in Javascript ?
For example if I wanted to set a the postal code to 94110
Are you looking to pre-set the postal code and the user can change it? Or is that the postal code that you will always use when confirming your payments?
I don't think there is a way to pre-set the postal code like that. You can hide the postal code and pass your own one in when confirming the payment, but I don't think we support pre-setting
Yeah, Im looking to pre-set the Country actually. Right now its defaulted to Canada it seems.. Even for our customer across the world, the default is always Canada
Gotcha. And to be clear, you want to take payments outside of Canada, you just want that to be the default?
devs-cardelement-postalcode
I want the Country to be the one where the card is being registered.
We already take payment from outside Canada, but when they enter their card, the default Country is Canada.. I want the default country to be the country where the customer is.
@pliant rover there's no "country" in the legacy CardElement so I'm not sure I follow what you are describing. Can you share a screenshot?
that Country is not a Stripe UI
really ?
Or you're using PaymentElement and not CardElement (you said card earlier)
what's your exact code?
this is the html
corresponding UI
js code :
$ctrl.viewModel.stripe_payment = $ctrl.stripe_elements.create('payment')
$ctrl.viewModel.stripe_payment.mount('#payment-element')
okay the last bit is what I needed. You're using PaymentElement not the legacy card one
So the country dropdown is based on your IP address.
If your customer is in France, they'll see France there
oh really. Ok.