#jhonny_reactnative-error
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ 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.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ 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/1229494501203120262
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey @red quail ! I'm happy to help bur I'm going to need a lot more details: exact doc you're using, exact version of the SDK, what part is and isn't working, what you see exactly in your logs, etc.
ok!
Docs: https://docs.stripe.com/payments/accept-a-payment?platform=react-native&ui=payment-sheet
Expo: 49
React Native: 0.71
code:
if (establishmentId) {
try {
const response = await createOrder({
appointmentsId: Array.isArray(appointmentsId)
? appointmentsId.map((appointmentId) => ({ id: appointmentId }))
: [{ id: appointmentsId }],
paymentType: paymentInfo.payMethod,
couponId: couponId ?? undefined,
installments: paymentInfo.installments,
establishmentId,
});
const { customer, ephemeralKey, paymentIntent } = await createPayment({
amountInCents: response.order.totalInCents,
currency: 'BRL',
orderId: response.order.id.toString(),
paymentGatewayCustomerId: user.customerId,
paymentMethod: 'card',
});
await initPaymentSheet({
merchantDisplayName: 'Example, Inc.',
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: paymentIntent,
allowsDelayedPaymentMethods: true,
});
await new Promise((resolve) => setTimeout(resolve, 2500));
await presentPaymentSheet();
.....
no logs appear
I've added the setTimeout because of this: https://github.com/stripe/stripe-react-native/issues/315 but it didnt work either
Okay so the first step is to add clear logs everywhere here. Right now you don't really know which part is or isn't working right? Like does createOrder work? does createPayment work? Please add clear logs before/after all of those calls
yeah, I've added some logs
let me show ya
console.log('hello 1');
await new Promise((resolve) => setTimeout(resolve, 2500));
console.log('hello 2');
await presentPaymentSheet();
console.log('hello 3');
stops at hello 2
I mean that's just a few hello. What about everything else? What are the exact value(s) passed to every method, and the exact response. I think that's important to log all of that too. Our docs have a clear error handling example for initPaymentSheet that you aren't doing
jhonny_reactnative-error
yep that's one possibility
also careful this has sensitive data, don't just dump it here
but the fact that the PI's client secret is undefined is likely part of the issue
it was that
fixed!
thanks!