#Benoît

1 messages · Page 1 of 1 (latest)

mild hingeBOT
north echo
#

👋 happy to help

mortal jetty
#

Hi 🙂

north echo
#

the reason why you might get requires_confirmation is if you don't pass confirm: true to your Create Payment Intent API

mortal jetty
#

Ah !

#

I create an invoice, so the PI is created by default

north echo
#

are you using stripe.confirmPayment on the frontend?

mortal jetty
#

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

north echo
#

oh so you're confirming on the backend with an already created payment method?

mortal jetty
#

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"

north echo
#

@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

mortal jetty
#

About the credit card token ?

north echo
#

first remind of something are you handling one-time invoices or subscriptions?

mortal jetty
#

My use case for now is only for a one-time payment

north echo
#

ok perfect

#

then you should start by creating your invoice

#

that's the first thing you need to do

#

forget about everything else

mortal jetty
#

I have (or i had) no probem with subscriptions. I didn't try since i have the requires_confirmation problem

north echo
#

you start with a customer (if it's not already created you create one) and then you create an invoice

mortal jetty
#

Ok, my customer already exists when i create the invoice

#

And i attach this invoice to this customer

north echo
#

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

mortal jetty
#

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

north echo
north echo
#

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

mild hingeBOT
mortal jetty
#

Ok

mortal jetty
# north echo I'm not sure how you're integrating

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');
north echo
#

a lot has changed since then

#

with Payment Elements

mortal jetty
#

Great ! It will allow us to propose all kind of payments it seems (Google Pay, Credit card, etc) ?!

craggy stag
#

Yep, Google Pay is supported in the Payment Element