Processes a payment after collecting a payment method succeeds.
=== Synchronous capture ===
Stripe Terminal uses two-step card payments to prevent unintended and duplicate payments. When
processPayment completes successfully, a charge has been authorized on the customer's card, but not yet been "captured". Your app must synchronously notify your backend to capture the PaymentIntent in order to settle the funds to your account.
=== Handling failures ===
If the updated PaymentIntent is
null, the request to Stripe's servers timed out and the PaymentIntent's status is unknown. We recommend that you retry
processPaymentwith the original PaymentIntent. If you instead choose to abandon the original PaymentIntent and create a new one, do not capture the original PaymentIntent. If you do, you might charge your customer twice.
If the updated PaymentIntent's status is still
REQUIRES_CONFIRMATION(e.g., the request failed because your app is not connected to the internet), you can call
processPaymentagain with the updated
PaymentIntentto retry the request.
If the updated PaymentIntent's status changes to
REQUIRES_PAYMENT_METHOD(e.g., the request failed because the card was declined), call collectPaymentMethod with the updated PaymentIntent to try charging another card.