#eunoia90 - Invoice Payment Timing
1 messages · Page 1 of 1 (latest)
thank you!
First, you certainly don't want to create a Payment Intent to hold the funds, then create a separate Invoice. That will tie up double the funds for the customer for a while. For example, if the Payment Intent is $100 and the Invoice is $100 then the customer will have $200 inaccessible (the $100 on hold for the Payment Intent plus the $100 which was charged by the Invoice). Canceling the Payment Intent will release the hold, but depending on the card issuer that can take a lot of time (days).
What you can do instead is tell Stripe to attempt payment on the Invoice immediately using this API: https://stripe.com/docs/api/invoices/pay
After that you can check the status of the Invoice or the status of the Payment Intent associated with the Invoice to confirm the payment succeeded.
or, so after I finalize the invoice, if I call this API it will short circuit that 1hr wait period?
Yep, it should. You can test it in test mode to make sure it behaves as you expect.
to clarify, if the status returns anything but paid then we can assume the payment failed and end the checkout?
Yeah, you can examine the associated Payment Intent for details about what went wrong, or if another step is required (like 3D Secure authentication, for example).
is the order to first finalize the invoice, then pay, or does "paying" the invoice implicitly finalize it?