Here's a detailed flow of the issue we're encountering:
A user creates 3 separate orders (referred to as "announcements/jobs").
Each order requires a separate payment when a vendor accepts it.
For each order, a PaymentIntent is created on Stripe using Stripe JS from NodeJS.
The user initiates payment for the first order, and Stripe responds successfully or with an error. If successful, the user can proceed with further steps.
However, after returning to the order list and selecting the second order to pay, the initPaymentSheet function no longer responds—it doesn’t display a success or error message. The payment button remains in a loading state as if awaiting a response from Stripe.
Upon checking the Stripe dashboard, a "429 lock-timeout" error (related to RateLimit) appears, though debug logs confirm initPaymentSheet is called only once, not multiple times.
The workaround so far is to refresh the screen. Post-refresh, initPaymentSheet responds appropriately, and the payment button returns to its expected functionality.
The Core Issue: When attempting to pay for a second order immediately after a successful first payment, initPaymentSheet fails to return any response, keeping the payment button in a loading state. Ideally, initPaymentSheet should immediately return an error in case of an issue, allowing us to troubleshoot and resolve the root cause.
Here is the code snippet of stripe code that cause the issue
// payment_screen.ts
const initialisePaymentSheet = async (data: any) => {
setLoading(true);
try {
const {paymentIntent, setupIntent, customer, ephemeralKey} =
await fetchPaymentSheetParams(data);
const {error, paymentOption } = await initPaymentSheet({
paymentIntentClientSecret: paymentIntent,
customFlow: true,
setupIntentClientSecret: setupIntent,
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
merchantDisplayName: 'Frank',
style: 'automatic',
});
// console.log("First Time this console works but second time , this line of code waiting for stripe response")
if (!error) {
setPaymentSheetEnabled(true);
} else {
console.log(error);
if (error.localizedMessage?.includes('CFErrorDomainCFNetwork')) {
Alert.alert(strings.network_failed, strings.network_failed_error);
}
}
if (paymentOption) {
setPaymentMethod(paymentOption);
}
} catch (error) {
console.log('error', error);
setLoading(false);
} finally {
setLoading(false);
}
};
Also i have initialise Strip on my App Root because i need to call the stripe in most of screens so instead of everytime calling the i use it once
Here's a detailed flow of the issue we're encountering:
Upon checking the Stripe dashboard, a "429 lock-timeout" error (related to RateLimit) appears, though debug logs confirm initPaymentSheet is called only once, not multiple times.
The workaround so far is to refresh the screen. Post-refresh, initPaymentSheet responds appropriately, and the payment button returns to its expected functionality.
The Core Issue: When attempting to pay for a second order immediately after a successful first payment, initPaymentSheet fails to return any response, keeping the payment button in a loading state. Ideally, initPaymentSheet should immediately return an error in case of an issue, allowing us to troubleshoot and resolve the root cause.
Here is the code snippet of stripe code that cause the issue
Environment: