#ryon_unexpected

1 messages ยท Page 1 of 1 (latest)

dry bronzeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212272292160081972

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

thorn needle
ruby sorrel
#
   async function fetchData() {
      try {
        const response = await fetch(
          "https://api.stripe.com/v1/payment_intents",
          {
            method: "POST",
            headers: {
              Authorization:
                "Bearer sk_test_xxx",
              "Content-Type": "application/x-www-form-urlencoded",
            },

Looking at this code, is this your React Native code?

#

It doesn't look right. This should be backend code. Only backend should use the Secret Key to create PaymentIntent

thorn needle
#

Yes. Its just my test and I included it all for your convenience. It's not my real code

ruby sorrel
#

Eventhough you shouldn't share your sk_test_xxx value to any published site

#

But okie let's say that's a backend endpoint

thorn needle
#

Its my test keys and the last part of them are cut off

ruby sorrel
#

Ah fair!

#

Okie, so on the 2nd time when it failed with 4242, did you notice the request to create PaymentIntent on backend?

#

Generally it should generate a new Payment Method (pm_xxx) and try to create new PaymentIntent pi_xxx

thorn needle
#

Actually the payment sheet even displays the error "BEFORE" the create payment intent completes. The backend is still running while the payment sheet throws the error. It just sorta crashes

ruby sorrel
#

hmm, how about the Payment Method creation

#

Something like POST /v1/payment_methods

thorn needle
#

You mean create the payment method server side? I didn't do that, and I am not sure how I would since the library creates the payment method and returns the ID. That is sent to create the intent server-side

ruby sorrel
#

No creating on RN, but it should be recorded in Dashboard log too

#

Can you just try again now and provide the first PI Id pi_xxx, I could try to trace them down

thorn needle
#

Ooooh. I didn't check that. Testing now, with the same code on the pastebin. 1 moment

#

First Attempt: pi_3Oog8GJgUVsS8tQc09gQRmVf
Second Attempt: pi_3Oog93JgUVsS8tQc1W9kAabC

ruby sorrel
#

Alright it succeeded 2nd time

#

Just the UI doesn't display it correctly, right?

thorn needle
#

Yea. The UI in the app just says "Something went wrong" as soon as I click the pay button in the payment sheet. I does not wait or anything.

ruby sorrel
#

Alright that sounds like an UI bug. Only happen on Android?

#

Github Issue is a good place to get the team attention ๐Ÿ™‚ We will ping the team internally too. Have you written to Support before?

thorn needle
#

Yea. Seems fine on iOS. I could test on there again if you want.
I have been writing to support for over 3 months. I started here first actually, but my actual code is bit... unconventional and maybe the devs didn't get what I was doing, or I couldnt explain correctly. That's why I whipped up a simple implementation this time around.

ruby sorrel
#

Sure can you share the email you used? Will check the Support convo

thorn needle
#

The closest I got to a fix was to reuse the same old payment intent instead of using a new one. The bug still happened on the 2nd attempt but would work the third time, occasionally a few tries later as well. Support also recommended I attach the payment method to the customer with the attach endpoint before creating the intent, but that didn't work either - seems like a weird solution.

ruby sorrel
#

Thanks for the email. I see the conversation now. It looks like we already in touch with the Mobile team and they will be reviewing your feedback yesterday

#

The issue is, even when you try to attach the Payment Method, the UI in the app is already displaying "Your card is declined", correct?

thorn needle
#

Yup. Well... "Something went wrong"

#

"Card is declined" is the first time

ruby sorrel
#

Yeah I see. I will leave a note on the convo and let the team know, but that's the best I can do ๐Ÿ™‚ We would go to the same route, but you already have a case being handling

thorn needle
#

OK. I think your note might some sanity to the loads of things I said and maybe increase the priority. I tried to say the same things many ways, so probably confusing by now.

#

Going offline. Its almost 2am. Will check in in the morning