#ronho

1 messages · Page 1 of 1 (latest)

gritty larkBOT
upper marten
#

Hey there

#

You are using Payment Element I assume?

tacit sparrow
#

yes thats correct

upper marten
tacit sparrow
#

hm, that sounds similar to what we're doing already, but in step 4 of that page, it still needs us to generate a payment intent it seems

but later when we finalize the invoice, it generates a second payment intent for the invoice.. when we submit payment it uses the second intent (attached to the invoice)

the first one remains in an incomplete state after we pay the invoice with the attached payment method to the customer

upper marten
#

You wouldn't create a separate PaymentIntent up front here

#

So there would be no extra

#

You render Payment Element without a PaymentIntent, collect the necessary info you need to calculate tax, then finalize your Invoice and pass the Invoice's client secret back to your frontend

#

Shouldn't be any reason for you to need to create a PaymentIntent up front like you are currently doing

tacit sparrow
#

sorry just a bit confused on this point:

You render Payment Element without a PaymentIntent, collect the necessary info you need to calculate tax,

i had the understanding that the client needs a secret to submit the payment form?

upper marten
#

You do, but you are using the PaymentIntent related to the Invoice itself for that

#

These steps:

  • backend generates a payment intent and passes client secret to frontend
  • frontend uses client secret to collect payment details, and billing address
#

You don't need a client secret for those steps in the deferred-intent flow

#

This flow renders Payment Element so you can collect the billing details without any PaymentIntent involved.

tacit sparrow
#

ok, i will give it a try. should i use this thread again if i have follow up questions?