#Jane_Zhong
1 messages · Page 1 of 1 (latest)
hi!
I have met this error : {"paymentOption": undefined}
where/when exactly did you get that error? do you have more context on that?
Overall I don't think I'd recommend using customFlow unless you really want to
The webhook didn't go through the payment_intent.succeeded part
I'm not sure what you mean by that, can you elaborate?
Hi karletkko ,yes ,please give me a minutes ,let me collect more information to you .
Hi Karlletkko,I have collected the codes that of my React Native part and bankend using node.js part ,please take a look at it .
sorry but we can't really read a docx file like that. Could you ask your question here directly instead?
pdf format
Sorry, i just read it ,is PDF format ok ?
Because maybe is easier for you to read
I see a lot of code in there. What is your actual question?
I would love to remove customFlow is true if it is possible ,because I got the error of :paymentOption undefined .
what guide are you using? I am not familiar with this const {error, paymentOption} = await initPaymentSheet line
this one :https://github.com/stripe/stripe-react-native/blob/master/example/src/components/PaymentScreen.tsx
I don't see in that code or project anywhere where it does const {error, paymentOption} = await initPaymentSheet
that's not how initPaymentSheet works as far as I know. It doesn't return any payment option like what the user picked. That happens later when you call presentPaymentSheet
Sorry. My bad ,right one :https://github.com/stripe/stripe-react-native/blob/master/example/src/screens/PaymentsUICustomScreen.tsx#L61
that's for the custom flow, which you don't want to use
so don't do it that way; do it the way we describe in the docs : https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
Yes,I am almost sure that I got that error of using this guide. However , let me try it again to confirm it .If I got that error again,I will back to you .
Hi karlletkko , I got the error of {"paymentOption": undefined} following the code that you offer me .
that's not an error though
there is no paymentOption returned from initPaymentSheet, it's normal that it's undefined.
what does your code look like now?
From the frontend ,it dosen't show any error .. But It brokes the backend ..
well that's entirely separate
let's try to focus on one thing at a time. What do you want to work on fixing right now? The frontend or the backend?
Per now ,I only got this problem when passing through the webhook of payment_intent.succeeded ; so I gusess is backend
so what does your backend code look like?
The backend codes I didn't change it ,it is the same like the document I have send to you
what is line 191 in your app.js?
is that screenshot what line 191 in your app.js file is?
if so : try replacing it with res.status(200).end(); for now.
Yes , the pdf I have sent you a the simplify one ,in order to make you feel easier to read.
the PDF has no line numbers of the actual code, so that doesn't help
anyway. Does that change help?
Ok,let me try it .
Thank you so much ,and have a nice day . I am going to take a try and give you a feedback .