#afonso

1 messages · Page 1 of 1 (latest)

amber monolithBOT
charred path
#

After the invoice is finalised, the information can't be changed. Any update on the customer will be reflected in the next invoice.

deep salmon
#

So I have to re render the payment element right?

#

Right now I’m creating an invoice behind the scenes and extracting the payment intent so I can render the payment element on the client side

charred path
#

Yup! Re-render Payment Element with new Payment Intent client secret will be required.

Alternatively, you can prompt customer to check for the billing details first, then create invoice and show Payment Element later

deep salmon
#

Right, that sucks.

#

In the stripe's native checkout you get to do it all at once, no re-render is needed.

#

What I thought about doing also, is creating the invoice after payment

charred path
#

There are two types of billing details here. For updating billing details on the payment method, it can be done anytime regardless whether the invoice is finalised. For billing details update on the customer, then it will only be reflected in the next invoice.

#

In the stripe's native checkout you get to do it all at once, no re-render is needed.
Which native checkout are you referring to? Is it Checkout Session?

deep salmon
#

Yes

#

The problem here really is with the invoice

#

We need the invoice to have correct billing details

#

So I think for us not to change the whole flow, we'll generate the invoice afterwards

#

with this flag paid out of band

#

what do you think?

charred path
deep salmon
#

Without using that flag?

charred path
#

When you render the Payment Element, it uses Setup Intent client secret that is not associated with invoice to collect payment method only. After the payment method is collected, it will generate a payment method ID (pm_xxx). With this payment method ID, you can then create the invoice after updating the customer details

deep salmon
#

Oh that makes sense

#

Is it smart enough not to charge again?

#

How do you mark it as paid?

charred path
#

The invoice will attempt to charge automatically from this payment method ID after it's finalised

#

Only one invoice is created, so it won't be charge again

#

Setup Intent is for payment method collection only and it doesn't charge to customer

deep salmon
#

oooh I see

#

is that what stripe checkout does?

charred path
#

Checkout Session works similarly

deep salmon
#

ok thanks, I will try that now

#

will get back to you in a couple hours

charred path
#

No problem! Happy to help 😄

deep salmon
#

How do I specify the payment method when creating the invoice?

charred path
deep salmon
#

Got it, and when I finalize it's going to be paid?

#

Or do I need to explicitly pay

#

Maybe that's auto_advance.

deep salmon
#

Hello?

charred path
#

Thanks for waiting! Discord is busy now

deep salmon
#

right I understand, your support is great I really appreciate it.