#ganesh-gawali_unexpected
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/1447928790977216602
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 Hi there! Do you have a Payment Intent ID you can share where this is happening? pi_…
pi_3ScPz8ExYCOPxGAz1xnJTewu
Thanks. Can you share a bit of your code where this is happening?
I see here that the payment method details were provided, but this was not a call to confirm the Payment Intent: https://dashboard.stripe.com/acct_1Qs1BWExYCOPxGAz/test/logs/req_qC2sEfnug2rRo9
as per the document we called the confirmPaymentIntent again
Also, can you share which documentation you're referring to here?
Document - https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=react-native
code - async function collectPaymentByCreatingPaymentIntent() {
const { error, paymentIntent } = await createPaymentIntent({
amount: selectedDonationAmt * 100,
currency: Config.CURRENCY_CODE.MYR,
onBehalfOf: Account.Merchant_Id,
captureMethod: 'automatic',
descriptor: 'GivePlease',
});
if (error) {
showToast("Failed to create payment intent", 'danger');
setIsLoading(false);
setError(error.message);
return;
} else {
setError(null);
paymentIntentCreated.current = paymentIntent;
collectThePaymentMethod();
}
}
async function collectThePaymentMethod() {
const { error, paymentIntent } = await collectPaymentMethod({
paymentIntent: paymentIntentCreated.current,
updatePaymentIntent: true,
});
console.log('PAYMENT INTENT', paymentIntent);
if (error) {
setIsLoading(false);
setError(error.message);
showToast(error.message, 'danger');
disconnectReader();
return;
} else {
setError(null);
confirmThePaymentFromStripe(paymentIntent);
}
}
async function confirmThePaymentFromStripe(updatedPaymentIntent) {
const { error } = await confirmPaymentIntent({
paymentIntent: updatedPaymentIntent,
});
if (error) {
setIsLoading(false);
setError(error.message);
showToast('Failed to confirm the payment', 'danger');
disconnectReader();
return;
}
setError(null);
}
Thanks. I see that your second call to confirm the Payment Intent was successful: https://dashboard.stripe.com/acct_1Qs1BWExYCOPxGAz/test/logs/req_jhnSoUC3RM7CTS — the object returned has status: succeeded
okay
Overall this looks correct:
- You create a Payment Intent
- You call
collectPaymentMethodwhich updates the Payment Intent once a card has been presented. At this point the status isrequires_confirmation - You call
confirmPaymentIntent— and the Payment Intent moves tosucceeded
on confirmPaymentIntent response the status of paymentIntent is giving "requires_confirmation".
Do you have a Payment Intent where this is happening, even after callingconfirmPaymentIntentagain, as the documentation you shared says you should do?
https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=react-native#handling-failures
yes
sharing
pi_3ScQOoExYCOPxGAz0Z4J8ObS
we called confirmPaymentIntent twice for this
Stripe only received one confirm request for this Payment Intent, so as the documentation mentions, you probably had a temporary network connection issue.
But the confirm request succeeded — the Payment Intent has status: succeeded: https://dashboard.stripe.com/acct_1Qs1BWExYCOPxGAz/test/payments/pi_3ScQOoExYCOPxGAz0Z4J8ObS
okay
Is there a possibility of delay in the payment process? We are getting requires_confirmation but after a while the payment is getting successfully executed
For the Payment Intent you shared, there was only one second between calling collectPaymentMethod and confirmPaymentIntent succeeding: