3

Here is what i am trying to do. Total is $120

1 : First i did a Partial Refund with this charge ID ch_1AfNOwAWa9KSz110***** .

                           \Stripe\Refund::create(array(
                              "charge" => 'ch_1AfNOwAWa9KSz*******',
                              "amount" => 60 * 100,
                            ));

2 : After that i want to refund full the amount that left in this chargeID ch_1AfNOwAWa9KSz110*********

               \Stripe\Refund::create(array(
                  "charge" => 'ch_1AfNOwAWa9KSz1********'
                ));

I am getting error Charge ch_1AfNOwAWa9KSz110********* has already been refunded.

What should i do first i did partial and after full refund in stripe.?

M Arfan
  • 4,384
  • 4
  • 29
  • 46
  • Try this - run the first refund and check if there is a remaining balance on that charge ID. It may be possible that stripe is refunding the entire amount. – Adam Jul 17 '17 at 19:31

2 Answers2

2

According to the docs:

You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.

So it seems you can create a refund without an amount (a full refund) only if you have not refunded already (partially), otherwise you need to specify the amount explicitly.

It would be great, though, if Stripe accepted refunding without an amount specified even after a partial refund, meaning to refund the remaining amount.

Lucas Basquerotto
  • 7,260
  • 2
  • 47
  • 61
-1

Based on the docs, I think you want to use the update refund endpoint instead of the create refund endpoint for the second call.

apb
  • 3,270
  • 3
  • 29
  • 23