𝗦𝘁𝗼𝗽 𝗥𝗲𝗳𝘂𝗻𝗱𝗶𝗻𝗴 𝗣𝗮𝘆𝗺𝗲𝗻𝘁𝘀 𝗬𝗼𝘂 𝗦𝗵𝗼𝘂𝗹𝗱 𝗡𝗲𝘃𝗲𝗿 𝗛𝗮𝘃𝗲 𝗖𝗵𝗮𝗿𝗴𝗲𝗱
Many developers ship a checkout flow that charges the card immediately. Then, they run order validation like stock checks or fraud checks.
If validation fails, the code issues a refund.
This creates problems for your customers. They see a charge and then a refund days later. They think your company is untrustworthy. They think their money is stuck.
Refunds have real costs:
- Customers lose trust when they see two separate transactions.
- Refunds take 5 to 10 days to appear on a bank statement.
- You may lose money on transaction fees or currency exchange rates.
- Card networks flag frequent charge-and-refund patterns as high risk.
The solution is to use the authorize and capture model.
Most tutorials teach you to capture money instantly. Instead, you should place a hold on the funds first. A hold sits on the card without moving the money. If your validation fails, you simply cancel the hold. No charge ever hits the customer statement.
In Stripe, you do this by setting the capture_method to manual.
The new flow works like this:
- Create a PaymentIntent with manual capture.
- The funds are authorized but not moved.
- Run your order validation.
- If the order is valid, capture the payment.
- If the order fails, cancel the intent.
This approach offers several benefits:
- You avoid the need for refunds.
- A cancelled authorization simply disappears from the customer statement.
- You can perform partial captures. If a customer buys three items but one is out of stock, you capture the amount for the two items only.
- You create a clean audit trail in your logs.
Most major payment providers use this same logic.
- Stripe uses capture_method: manual.
- Adyen uses manual capture delays.
- Braintree uses submitForSettlement: false.
- PayPal uses intent: AUTHORIZE.
Use this method if any part of your business logic can fail after a customer hits pay. Move your risky checks between the authorization and the capture. This keeps your money movements clean and your customers happy.
Source: https://dev.to/jguillaumesio/stop-refunding-payments-you-should-never-have-charged-4d7m