#Benoît
1 messages · Page 1 of 1 (latest)
👋 happy to help
Hi 🙂
the reason why you might get requires_confirmation is if you don't pass confirm: true to your Create Payment Intent API
are you using stripe.confirmPayment on the frontend?
In fact, until now i never had a requires_confirmation status. I only had requires_action, and then i called stripe.confirmCardPayment
I never used stripe.confirmPayment
oh so you're confirming on the backend with an already created payment method?
Here is how i developped my payment system :
1/ The user is prompted a payment form, that i combine with StripeJsElements
2/ The user fill his bank datas
3/ Datas are submitted to the server
Then, server side, i :
4/ Attach the card with customers.update, passing the credit card token to the source property
5/ Then i create an invoice and add an invoice item to it
6/ I finalize the invoice
7/ I check if the paymentIntent status is requires_action or requires_payment_method
8/ If no : No problem. If yes, i return a specific data to the frontend that allows me to know if i must call stripe.confirmCardPayment(clientSecret) or not
That's all i have for now. No more use cases ... But now, i have a use case i never had, with a PI to status requires_confirmation that is not yet "managed"
@mortal jetty it's not the first day we've discussed your approach, right? and I have discouraged you many times that your approach isn't really the best, and I have suggested a better integration approach for you
why are you so determined on going down the wrong path?
despite our many attempts to convince you otherwise
About the credit card token ?
first remind of something are you handling one-time invoices or subscriptions?
My use case for now is only for a one-time payment
ok perfect
then you should start by creating your invoice
that's the first thing you need to do
forget about everything else
I have (or i had) no probem with subscriptions. I didn't try since i have the requires_confirmation problem
you start with a customer (if it's not already created you create one) and then you create an invoice
Ok, my customer already exists when i create the invoice
And i attach this invoice to this customer
then please follow up with these steps https://stripe.com/docs/invoicing/integration?method=elements#accept-invoice-payment
once the invoice.paid event is done, then you can collect the Payment Method and save it as your customer's invoice_settings.default_payment_method
Ok, i didn't understand all this last time. But do i still have to keep my actual form when my customer want's to update his payment method or the new one can also be used ?
And is this way possible for subscription or subscriptions + one time on the same invoice ? I think yes
I'm not sure how you're integrating
they kind of use the same integration
the only difference is that in subscriptions you need to expand the latest_invoice.payment_intent whereas in invoices you directly expand the payment_intent
Ok
I followed a tutorial 4/5 years ago, that explained i should crete my form like this :
this._cardElement = elements.create('cardNumber', {
style: style,
placeholder: this._cardAttributes.placeholder
});
this._cardElement.mount('#card-number-element');
a lot has changed since then
this is the new recommended integration https://stripe.com/docs/payments/quickstart
with Payment Elements
you can also read about it here https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Great ! It will allow us to propose all kind of payments it seems (Google Pay, Credit card, etc) ?!
Yep, Google Pay is supported in the Payment Element