#Kamesh

1 messages · Page 1 of 1 (latest)

frozen oysterBOT
daring bolt
vagrant summit
#

Thanks. Can you please point out how I can access the card type using card element?

daring bolt
#

gimme a sec to find the relevant docs

vagrant summit
#

Thanks

vagrant summit
#

is this only applicable to US and Canadian cards?

daring bolt
#

it's applicable to cards from any issuing country

vagrant summit
#

Thanks. Sorry if I missed anything obvious, but this doc is explaining capturing card information and process later. Where can I find how to get the card type before i process the payment?

daring bolt
#

when you create a PaymentMethod, you will be able to get the card type

vagrant summit
#

do you mean, that once the payment method is created, we can get payment intent details which will contain the payment card type information?

daring bolt
vagrant summit
#

Thanks. Is there any reason why we cannot use payment element to capture the card and charge later?

daring bolt
#

sure, you can use the payment element to capture the card and charge later, but you can't do it purely on the client side.

vagrant summit
#

will this flow work?

  • UI calls backend to create payment intent
  • backend calls stripe to create payment intent and pass the client secret to UI
  • UI captures the credit card using payment element and call stripe to create payment menthod
    *UI then calls stripe to get payment method to get card type info
  • UI calcualtes additional surcharge based on card type and updates the payment intent with additional amount
    *UI then calls stripe to make the payment.
daring bolt
#
  • UI calls backend to create SetupIntent
  • backend calls stripe to create SetupIntent and pass the client secret to UI
  • UI captures the credit card using payment element and PaymentMethod is created
  • UI calculates additional surcharge based on card type and creates the PaymentIntent to charge off_session