#ryonwhyte-RN-paymentSheet
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ryonwhyte, 2 days ago, 68 messages
Hi ๐
Sorry I really don't follow any of that. Can you try explaining shorter pieces of what is going on here.
- The App you are building, what SDK are you using?
- What is the action the customer completes?
- What error do you see and at what step does it occur?
- Using Stripe React native SDK
If the user enters an incorrect card information and attempts to pay, there is an error shown whichg is good. BUT if they then corrects it in the payment sheet with a good card, there is still an error (something went wrong). Video of me doing it: https://streamable.com/gyv1cv.
I am using this implementation: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=react-native&type=setup#ios-charge-saved-payment-method
Here is my server side code: https://pastebin.com/eSdVkW44
Here is my client side code: https://pastebin.com/q5cP29VC
It may be a bug in the library or my implementation. I don't know which one as my code seems to be correct as I followed the docs.
- What version?
I appreciate you providing your code but I don't have the time on this server to review all of it for you.
0.35.0
HOw are you catching & logging the errors that are returned by the Payment Sheet?
I return them from the server in a format that the library supports. Screenshot of code section https://i.imgur.com/IzhCll7.png
Its passed into the callback here https://i.imgur.com/jiFA4py.png
Okay so what are you logging when you get this error?
I don't log anything. The stripe payment sheet just displays it automatically to the user. Maybe I don't understand what you're asking?
I don't log anything
Okay well that is the first thing you should change
You should be logging all the details of any error returned either by the Stripe RN SDK or the Stripe APIs
Ooh. The error would be server side. Its just the traditional card decline error. Nothing special. I just pass the relevant parts ot the stripe sdk to display. Its just that after an eror it just stops working
Should I send a sample?
What is the state of the Setup Intent at that point?
Let me make a new PI so you can see it and the error
Okay thanks
Well, well well. To my surprise, it appears a client secret is returned to the app even with a card that will be declined. You are right I should have been logging lol.
However, that now means I have nothing to do with the error that shows up. It's completely display by the Stripe library.
PI: pi_3OMDllJgUVsS8tQc0fN3keiN
client secret is returned to the app even with a card that will be declined
I don't know what you mean by that
Okay so this payment intent is in a state of requires_action.
I meant. I thought that since that card would be declined the server would receive an error from stripe when creating the intent. Thsi is the response https://pastebin.com/uhFicyth
OK. So what do I need to do in the app? This is the card I used 4000000000000119
Also, 3DS is working quite fine. Certain of it, as I can use any working 3ds test cards. I am specifically testing cards that will fail/be declined here, and after the payment sheet error is displayed I just can't add a new card data to the same payment sheet instance.
OK. So what do I need to do in the app?
I don't know what you mean
You keep sending a bunch of code snippets and API responses but it isn't clear what you are trying to do
OK. Let me step back.
I am having one issue: https://streamable.com/gyv1cv.
When I use a test card, that will be declined and the payment sheet shows the error. I can not update the card details (to a correct card) in the same payment sheet instance without getting an error, even though the new details are correct.
What we have learned so far in this convo is that I am not the one generating the initial card decline, error, but the stripe library is doing it.
My assumption is maybe the payment sheet crashed after displaying the first error but I am not sure
I'm curious, what happens if you use card number 4000000000000002?
What is the state of the payment intent afterwards and does the payment sheet allow you to retest?
- Goes to 3ds
- Card declined error shown
- Changed card to 424242.. in same sheet instance
- Error: something went wrong
Intent state of 4000000000000002 attempt requires_action
Can you share the Payment Intent?
pi_3OMEBYJgUVsS8tQc00rKaDzx
It doesn't go to 3DS since it's just a generic decline
Are you testing in iOS or Android?
The 3ds screen sorta just blipped. Android
Okay so I just tested in my Android implementation and that part worked fine. Let me get my RN integration running
I see something. In Stripe there are actually 2 transactions.
The one for 4000000000000002 is pi_3OMEAkJgUVsS8tQc0DsDtipw
And the second attempt with 4242 is pi_3OMEBYJgUVsS8tQc00rKaDzx
I used
4000000000000002- generic decline, payment sheet says up4242424242424242- payment succeeds
The 4242 transaction is actually 3ds incomplete. The payment sheet cannot trigger 3ds on the second attempt, it seems
Okay then it looks like your server is doing something odd. You need to understand why it's creating a second payment intent.
The payment sheet cannot trigger 3ds on the second attempt, it seems
You would need to re-initialize the payment sheet with the client secret for that new payment intent
I think your integration is causing a duplicate payment intent to be created
You should review your app and your server so that you only use the one payment intent
I was able to test the Payment Sheet in my integration and, as long as I was attempting to confirm the same payment intent, I could use a failing card and then a successful one without a problem
Aaaah. You are right, good Sir. That's exactly what happening. Makes perfect sense.
One question. If the user exits the payemnt sheet and reopens it. Is that reason to create new intent?
That would depend on how your code is set up
Hmm. I guess I could watch if the user makes changes that affect the order. Maybe i'll need new ephermal key though, right?
It's a good idea to create a new one along with the payment intent. They go stale fast and you don't know how long the customer will take to get back to the payment sheet
Hmm. Thank you for that advice. I think I am good to go figure this out, now. I just need to restructure the code to use the same intent.
It's a good plan. It will also make it easier to debug your logs later on (not a bunch of duplicate intents).
Agreed. Thanks again ๐
Happy to help ๐