stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.7k stars 259 forks source link

[BUG]: StripeCardElement does not support cards with US issue country but CA post code #501

Closed tomas-c closed 1 month ago

tomas-c commented 1 month ago

What happened?

Stripe seems to use card issue country to enable/disable entry of letters, spaces or other characters in the zip code field.

If the card issue country uses numeric post codes but the card post code is not in the issue country, then users cannot enter the correct post code. We've had several customers with this issue.

It would be helpful if StripeCardElement had a flag to always allow letters, spaces or other characters in the zip code input field.

I found this old issue which was closed without a resolution: https://github.com/stripe-archive/react-stripe-elements/issues/135

Environment

No response

Reproduction

No response

brendanm-stripe commented 1 month ago

This is a known limitation of the Card Element that we fixed with the Payment Element, which includes a separate/explicit billing country selector for cards.

pe-country

This is not something I expect to change for card element, so I would recommend using payment element instead if you can.

The workaround with Card Element requires manually implementing postal code handling. You need to: 1/ hide the postal code field (ref) 2/ collect country & appropriate postal code with your own form fields 3/ include country/postal in billing_details when you call confirmCardPayment (ref)