#jdommel_api
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/1471127272495911092
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ Can you share any request ID (req_xxx) or payment intent IDs related to your attempt? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Hi, here's one on test mode pi_3SzckPDt9TCFajwK2X3zG7Ce
Thanks, just taking a look
I don't see any attempt at authentication, so it doesn't appear to be a 3DS issue. Does the user complete the payment flow in the sheet? (Enter card details and tap "Pay") Are you seeing any errors in the PaymentSheet UI itself?
The payment succeeded for the above example? pi_3SzckPDt9TCFajwK2X3zG7Ce
Sorry, I must have mistaken, it this one that succeeded pi_3SzceQDt9TCFajwK10p8skRu
Can you try setting android:launchMode="singleTask" in your AndroidManifest.xml file. This can sometimes resolve issues caused by 3DS flow interrupting the lifecycle
It's already set this way
Could you share how you're calling initPaymentSheet in your code?
/** Handles payment sheet initialization */
const initializePaymentSheet = useRef(
async (params: Parameters<typeof fetchPaymentSheetParams.current>[0]) => {
try {
const result = await fetchPaymentSheetParams.current(params);
const { clientSecret, ephemeralKey, customerId } = result || {};
/** @warning added customerId and ephemeralKey to avoid errors */
/** check if this causes no bug */
if (!clientSecret || !customerId || !ephemeralKey) {
return;
}
console.log('[Payment] Initializing payment sheet');
const { error, paymentOption } = await initPaymentSheet({
customerId,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: clientSecret,
/** needed to complete payment in multiple steps - confirmation will be needed later */
customFlow: true,
merchantDisplayName: 'Toasty',
style: 'alwaysLight',
returnURL: 'toasty://panier',
});
error
? console.log(error, '----------error-------------')
: console.log('[Payment] Payment sheet initialized without error');
paymentOption &&
dispatch(
setPaymentMethod({
label: paymentOption.label,
image: paymentOption.image,
})
);
Keyboard.dismiss();
return;
} catch (error) {
console.log(error, 'error');
throw error;
}
}
);
And what payment method are you trying in your tests? (e.g. Google Pay, Link, directly entering card details) Is the 3DS flow triggered?
Hello! I'll be taking over as @rotund geyser had to step away - let me get caught up ๐
Should I explain again ?
No, I can review the previous messages - thanks!
The logs I see for pi_3SzceQDt9TCFajwK10p8skRu suggest there's no 3DS flow, did you see one triggered when confirming the payment?
Also does this happen for every payment on Android?
It seems to happen on a big part at least... I thought about the 3DS flow because I see logs suggesting that my app is backgrounded, and all the tasks are stuck
So you don't actually see or interact with a 3DS page when testing?
No, I don't see anything happening, same in production
To clarify, you're using a payment sheet with the custom flow like the guides suggest here? https://docs.stripe.com/payments/mobile/accept-payment?platform=react-native&type=payment&integration=paymentsheet-flowcontroller#confirm-the-payment
Asking because the guide doesn't mention usePaymentSheet but that might be a gap on our end.
I use customFlow: true at initPaymentSheet
However, it mentions this:
When the customer taps Buy, call confirmPaymentSheetPayment. It calls the confirmHandler callback you passed to initPaymentSheet with a ConfirmationToken representing the customerโs payment details and preferences.
And I don't see confirmHandler in your code snippet so the promise might be stuck as it expects that.
Can you try passing confirmHandler as shown here? https://docs.stripe.com/payments/mobile/accept-payment?platform=react-native&type=payment&integration=paymentsheet-flowcontroller#initialize-paymentsheet
To be honest, I'm surprised it works without it ๐
I suspect it's working because you're passing the paymentIntentClientSecret upfront using the intent first pattern rather than the deferred intent patten used in the guide.
Thanks, I can try that, I can't do it right but can I resume this conversation later when I can ?
This thread will auto-close when inactive, but you can link it for context in a new thread if you try this and it doesn't solve the issue.
Here's a link to save for later: https://discord.com/channels/841573134531821608/1471127272495911092
I will also ensure we improve our guides around this ๐
Thank you