Search code examples
stripe-paymentspayment-processing

Stripe: Can I change total of a charge after the fact?


My employer has challenged me to build him a custom Point of Sale system and stripe was my first thought for payment processing. I work in food-delivery, and as such our current (as well as every other) POS immediately charges the card (verifies it? whatever), and then at the end of the night when tips are counted (whether from the drivers or tipped receipts in the tip box) the charge changes to whatever the customer agreed to.

I see I can do a few similar things:

  • update metadata on a charge (not what I need)
  • capture a charge (not what I need - won't let you use a value higher than the initial)
  • do a second charge for the tip (would hope to avoid this)
  • save the card information with Stripe after creating a customer object and not do any charge until after I know the tip (would hope to avoid this)

But, can I verify the customer can pay the amount (that initial charge) and then increase it later once we know if/how much they tipped?


Simply put, I'd like my flow to be:

  • Customer orders
  • Charge is issued for 20$ of food (Stripe)
  • Food is delivered, 5$ tip secured on the receipt
  • Receipts are turned in, 5$ tip is entered into system
  • Charge is changed to reflect the added tip (now 25$) (Stripe)

Is this possible with Stripe? If so, how?

If not, do you know of any other payment system that could implement this flow?


Solution

  • Short answer: no, that's not possible.

    You could do something like this:

    1. Create an uncaptured charge for the base amount.

    2. Once the customer confirms the tip, try to create a charge for the base amount + tip.

    3a. If the charge succeeds, release the first uncaptured charge (by refunding it).

    3b. If the charge fails, capture the first uncaptured charge (and maybe explain to your customer that they were only billed for the base amount).