stripe-react-native
stripe-react-native copied to clipboard
Retrieve PaymentMethod before calling confirmPaymentSheetPayment
Is your feature request related to a problem? Please describe.
I'm currently using the Mobile Payment Element with customFlow and confirmHandler, following the documentation. However, I'm encountering difficulty retrieving the PaymentMethod before calling confirmPaymentSheetPayment, which is necessary for updating the UI.
Currently, I'm retrieving the PaymentMethod from confirmHandler's parameters. However, this requires delaying the call to intentCreationCallback until after the UI is updated and the user confirms to proceed.
Describe the solution you'd like
I’d like to have a way to obtain the PaymentMethod object after the PaymentSheet is closed, potentially as part of PresentPaymentSheetResult. This would allow for acquiring the PaymentMethod before calling confirmPaymentSheetPayment, simplifying UI updates and user confirmation processes.
Hi @g-cappai The PaymentOption returned from presentPaymentSheet contains label and image that you can use to update your UI. Can you tell me what other information you need for your UI update?
Hi @seanzhang-stripe, I need the PaymentMethod id. We use it to calculate fees and show the updated price to our customers after they fill the PaymentSheet.
Hi @g-cappai The SDK won't create a PaymentMethod until confirmPaymentSheetPayment is called, and that's why the PaymentMethod is not available in PaymentOption object. There's a similar discussion here. Will adding paymentMethodType in PaymentOption object solve your problem?
Hi @seanzhang-stripe, that would be helpful, but I need more data. Essentially, we use the PaymentMethod.id on the server to retrieve the type, Brand (if it's a card) and Country. So if I could get this data within PaymentOption, that would be fine as well.
Hi @seanzhang-stripe, any news?
+1
Adding paymentMethodType would solve our problem