#parK-dev
1 messages ยท Page 1 of 1 (latest)
To save payment method in web, the Payment Intent should be created with customer and setup_future_usage to off_session. This should be the same as how you create the Payment Intent using React Native. You may refer to the steps here: https://stripe.com/docs/payments/save-during-payment?platform=web
If these two parameters are set and still don't work, sharing the sample Payment Intent ID (pi_xxx) will be helpful for me to investigate
Also can I remove the need for postal code
Yes! You may setfields.billingDetails.address.postalCodetonever
pi_3MWVuRDdMfkWbtGZ2gR0M0hE
yes I have to settings enabled. They're the ones we use for native
made this one: pi_3MWWfhDdMfkWbtGZ14qZZIR2
Removing the postal code worked.
Still shows no payment method unfortunately.
Looking into it now
In pi_3MWWfhDdMfkWbtGZ14qZZIR2, its payment intent is still in requires_payment_method status, i.e. payment method details is not collected yet. Only when payment method details is collected and confirmed in Payment Element, then the payment method will be attached to the Payment Intent: https://dashboard.stripe.com/test/payments/pi_3MWWfhDdMfkWbtGZ14qZZIR2
Yeah, so that's why I'm wondering why when I enter the payment details and then I submit the form, it doesnt get saved
Do you confirm the payment with stripe.confirmPayment when submitting the form as described in Step 5 of this guide? https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
No native doesnt require it
Or at least it seems to be handle by the default payment sheet
not on our server
native sheet has its own button, which I'm sure probably does all these steps before it resolves and then our server takes over.
await initializePaymentSheet();
const { error } = await presentPaymentSheet();
if (error) {
if (error?.code !== "Canceled") {
// TODO: translate
notify({
message: error.message,
});
}
return;
}
setLoading(true);
try {
const res = await checkout();
if (res) {
navigation.navigate("chat", { id: orderId });
}
} finally {
setLoading(false);
}
on native presentPaymentSheet is a promise that resolves and I imagine it takes care of that?
So should I manually confirm it on web?
React Native's integration is different from web's. For web integration using Payment Element, additional confirm payment is required. I'd recommend following this guide for complete Payment Element integration on the web: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
stripe.confirmPayment doesn't do the capturing of the funds and all right?
only sets the payment_method/customer and whatnot?
If the payment intent is to set to manual capture, confirmPayment won't capture the funds
confirmPayment is to confirm the payment method that the customer intends to pay with
Alright, I'll try this and let you know.
Okie! Feel free to reach out to us again if you have further question ๐
That's great! It looks good to me ๐
can I disable the return_url and let my own router handle rerouting later (after my other checks and server-calls that come after confirmPayment)