Stripe Partial refund and full refund issue

Viewed 1323

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.?

2 Answers

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.

Related