#Dakata-EU-Card only
1 messages · Page 1 of 1 (latest)
@gusty smelt yep, @stripe/react-stripe-js to be more precise
OK, you can call stripe.createPaymentMethod (https://site-admin.stripe.com/docs/js/payment_methods/create_payment_method) which returns you a PaymentMethod object, and you can obtain the card country property https://stripe.com/docs/api/payment_methods/object?lang=go#payment_method_object-card-country from there.
So we create the payment method despite its issuer, but we issue payment only if the card is from given country (or not)
can we avoid the creation completely, like executing createPaymentMethod and tell stripe: save only cards from this type, country etc
You can check the card country first before creating the paymentIntent creation
In summary
- Call
stripe.createPaymentMethodto get the PaymentMethod object - if the card.country is a EU country, create a PaymentIntent with the payment method, otherwise inform the customer to use another card.
- Call
stripe.confirmPaymentto confirm the PaymentIntent
Happy to help 🙂