#sushbhat

1 messages · Page 1 of 1 (latest)

coarse saddleBOT
teal hull
#

hi there,
AFAIK, you can't do that using Stripe APIs, but you can do something in your frontend using Stripe Card Element.
You can check this quick demo for that:
https://jsfiddle.net/nwyf587t/

austere hawk
#

I am using payment element on front end injected by stripe.js. (ngx-stripe)

#

anyidea how to achieve it on that?

teal hull
#

Using Payment Elements no,
either you switch using Card Element/Card Number Element, or when you create a PaymentMethod, Stripe returns the brand and a list of networks the card can run on. So you can do the check on those values later.
https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-brand
https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-networks-availablehttps://stripe.com/docs/api/payment_methods/object#payment_method_object-card-networks-available
More details can be found here,
https://stripe.com/docs/card-brand-choice#identify-the-available-card-networks

austere hawk
#

is it configurable at account level

teal hull
#

No, this is something you do it at runtime in your integration, when the customer enter his card details.

austere hawk
#

ngx stripe has StripePaymentElementChangeEvent, can we use that to do runtime check

#

its basically inside StripePaymentElementOptions

teal hull
austere hawk
#

ok and what is this 2nd approach you mentioned? 'when you create a PaymentMethod'
Because i don't think we are explicitly doing this, we first build a paymentIntent and then confirm pay with client secret

teal hull
austere hawk
#

ok