#bb8t_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/1293192896874287147
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
how are you accepting payments? Checkout Session, Payment Element, something else?
react native with paymentsheet
can you send the full error message and the code that is throwing that error? the code you shared in your original message has been truncated.
on it
paymentMethod,
shouldSavePaymentMethod,
intentCreationCallback
) => {
stripeCheckout(
{
orderId: orderData.orderId,
paymentMethod: {
...paymentMethod,
},
returnUrl: linkingUrl,
savePaymentMethod: shouldSavePaymentMethod,
},
{
onSuccess: ({ clientSecret }) => {
intentCreationCallback({ clientSecret });
},
onError: (error) => {
intentCreationCallback({
error: {
code: 'Failed',
message: getResponseErrorMessages(error, 'response.data.errors.base[0]'),
localizedMessage: getResponseErrorMessages(error, 'response.data.errors.base[0]'),
},
});
},
}
);
};``` confirmHandler
await initPaymentSheet({
style: 'alwaysLight',
customerId: orderData.payments.customerId,
customerEphemeralKeySecret: orderData.payments.ephemeralKey,
appearance: {
colors: {
componentText: '#333333',
icon: '#000000',
placeholderText: '#8C8C8C',
primary: '#19B6C1',
secondaryText: '#666666',
},
primaryButton: {
shapes: {
borderRadius: 24,
},
colors: {
background: '#E84358',
border: '#E84358',
},
},
},
applePay: {
merchantCountryCode: 'US',
},
googlePay: {
merchantCountryCode: 'US',
testEnv: config.ENVIRONMENT !== 'production',
},
merchantDisplayName: 'Better Off',
intentConfiguration: {
mode: {
amount: orderData.payments.amountInCents,
currencyCode: 'USD',
},
confirmHandler: confirmHandler,
},
returnURL: linkingUrl,
});
const { error } = await presentPaymentSheet();
if (error) {
onPaymentError();
Bugsnag.notify(new Error('Stripe PaymentSheet error'), (event) => {
event.addMetadata('details', {
orderId: orderData.orderId,
errorMessage: JSON.stringify(error),
});
});
} else {
queryClient.invalidateQueries('getActionItems');
queryClient.invalidateQueries('getEventRegistrations');
queryClient.invalidateQueries('getEventRegistrationDetails');
queryClient.invalidateQueries('getEvents');
queryClient.invalidateQueries('getEventDetails');
sendAnalyticsEvent({
event_type: 'purchase',
order_id: orderData.orderId,
});
setNextOrderStep();
}
return;
};
``` - init & show paymentSheet
stripeCheckout post mutation with backend response - clientSecret or error
thanks! having a look...

hey there, was looking at this with soma and they need to step away
Not really sure what's happening here, but its not even clear its a Stripe SDK error vs RN SDK/platform issue causing there error/disconnect. Do you have an actually error capture from that sequence showing the raw error type/message thrown?
It's also not clear what the difference is between the two video sequences. One seems to work like you expect and the other fails, yes, but are there reproducible condition differences between them?.
Sure!
The "success" video - our stripeCheckout method and backend returns status 200 with clientSecret.
The other one returns status 403 - event has been closed before payment so this endpoint returns error status
there is a full error capture from xcode after that throw
It works well with card payment, the error from stripeCheckout is beeing displayed under the card fields
It works well with applepay when stripeCheckout method returns 200 and clientSecret
Unfortunately I don't have any good ideas about what's happening here. I would suggest trying to narrow this down to a minimal reproduction and reporting an issue with a shared repository of the reproduction to https://github.com/stripe/stripe-react-native
I suspect this is not originating in the stripe SDK but can't be certain based on the details availble, so a minimal reproduction without anything else involved is the ideal path
ok ๐ฆ
The reporduction steps are
- init & open the paymentsheet
- during that change backend response of request which returns clientSecret - it must return error 404/500etc
- press applepay button
- app is beeing crashed
Are you able to check that before I create a ticket?
I mean, create a new RN project without other dependencies in play, just the Stripe SDK, and implement a barebones app that creates this scenario with a few dependencies as possible (ideally only requiring putting in a PK and being able to hardcode any client secrets etc).