Stripe Terminal uses a two-step process to prevent unintended and duplicate payments on
When the SDK returns a confirmed PaymentIntent to your app, the payment is authorized but not captured. You can cancel these payments on your server. We recommend reconciling payments on your backend after a day’s activity to prevent unintended authorizations and uncollected funds.
Canceling payments Client-sideServer-side
You can cancel a
card_present PaymentIntent at any time before it has been captured. Canceling a PaymentIntent releases all uncaptured funds, and a canceled PaymentIntent can no longer be used to perform charges.
This can be useful if, for example, your customer decides to use a different payment method or pay with cash after the payment has been processed. In your application’s UI, consider allowing the user to cancel after processing the payment, before finalizing the payment and notifying your backend to capture.
When you use a PaymentIntent to collect payment from a customer, Stripe creates a charge behind the scenes. To refund the customer’s payment after the PaymentIntent has succeeded, create a refund by passing in the PaymentIntent id or the charge id. You can also optionally refund part of a payment by specifying an amount.
Server-side refunds do not require a cardholder to present their card again at the point of sale. The following example shows how to create a full refund by passing in the PaymentIntent id.
To refund part of a PaymentIntent, provide an
amount parameter, as an integer in cents (or the charge currency’s smallest currency unit):
Client-side Verifone P400 only
In-person refunds are mandatory for Interac transactions in Canada. You will not be able to create refunds in the API or in the Dashboard for these payments; you will have to use the client-side methods. In this flow, the reader will prompt the cardholder to present the card used in the original charge. Once the card details have been read successfully, your application will be able to process the refund. Similar to server-side refunds, you can perform partial refunds by passing in an amount less than the transaction value.
The currency and the card used for refund processing must be the same used for the original charge, otherwise the request will fail with an error.
The below example attempts a server-side refund first, and if the server-side refund is unsuccessful, proceeds with a client-side refund.