Releasing (or refunding) an uncaptured charge

833 visningar
Hoppa till det första olästa meddelandet

Dean Richardson

oläst,
11 juni 2017 07:32:452017-06-11
till Stripe API Discussion
We're building a two-sided marketplace that brings together genealogy researchers and potential clients. When clients request a fixed-fee project with a researcher, we have the client pay upfront, and we create an uncaptured charge. When the researcher accepts the project, the charge is captured. If the researcher declines the project, we want to fully refund (or "release") the uncaptured charge so it comes off of the client's credit card balance as quickly as possible.

I'm currently trying to do this by creating a refund for the uncaptured charge and using the full amount of the original charge. I get the following error:

Stripe error while creating refund: amount You cannot partially refund an uncaptured charge. Instead, capture the charge for an amount less than the original amount.


I'm puzzled by this. I want to refund the full amount, not an amount less than the original amount. Is the message really telling me that I need to capture before I can refund?


I'm looking for a clear indication in the docs or the api reference that explains the preferred strategy for dealing with this issue, and I'm not finding it.


Any help would be gratefully appreciated. :)


Thanks,


--Dean

Remi J.

oläst,
11 juni 2017 07:34:572017-06-11
till api-d...@lists.stripe.com
Hey Dean,

This error usually indicates that you're passing the `amount` parameter when creating the refund and that your value is smaller than the amount you authorized. To refund an authorization, simply call the Create Refund API [1] without passing any amount. In PHP for example, the code would be:

$re = \Stripe\Refund::create(array(
  "charge" => "ch_XXYYZZ"
));

Hope this helps!
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden