#dpelkey98

1 messages · Page 1 of 1 (latest)

silver solarBOT
topaz holly
silver solarBOT
sweet ingot
#

Hey Pompey, thanks for the suggestion. However, I'm using the React Native SDK and the <CardField> component. I don't see how I can use stripe/stripe-js with React Native. I have also looked into the API for creating a payment method on the backend[0], but it explicitly recommends not passing card details. For reference, I'm currently creating the SetupIntent using the pre-saved customer ID. From there it returns client_secret which I pass to confirmSetupIntent. Only after confirming does the return {setupIntent} have a fingerprint property.

[0] https://stripe.com/docs/api/payment_methods/create#create_payment_method-card

worldly sky
#

👋 stepping in here

sweet ingot
worldly sky
#

It returns a PaymentMethod ID, you don't need to pass one. You just pass paymentMethodType: 'Card' and it will grab the data from the CardField.

#

This isn't really the canonical flow so no don't believe there is an example unfortunately.

sweet ingot
#

This seems reasonable. My only other question is; is there a way to confirm the payment method on front end for off-session payments and maintain SCA like confirmSetupIntent?

worldly sky
#

I'm not sure I fully understand. You would indeed use confirmSetupIntent for that.

#

So you use createPaymentMethod to check the fingerprint then you confirm a SetupIntent and pass that PaymentMethod ID to the SetupIntent.

sweet ingot
#

I see. Sorry, I'm a bit new to the Stripe API/SDKs so I may be wording a bit weirdly. Just so I understand, I will still need to create a setupIntent to fetch the client_secret? Pass that to confirmSetupIntent(client_secret, {options}) and including the payment method ID as options.paymentMethodData.paymentMethodId?

worldly sky
#

If I remember correctly we don't expose the fingerprint client-side so you will need to pass the PaymentMethod ID to your server and retrieve it to check the fingerprint. This means that since you already have the PaymentMethod on your server you can just pass it to the SetupIntent when you creat that server-side (https://stripe.com/docs/api/setup_intents/create#create_setup_intent-payment_method) and then pass the client_secret back to the frontend and confirm as you mentioned above.

sweet ingot
#

Ok, understood. I'll give that a shot. Thanks for both of your help

worldly sky
#

Sure thing