Clarified/documented refund logic

This commit is contained in:
Hillel Coren 2016-06-07 10:54:20 +03:00
parent 0238067af3
commit 1e837c2368

View File

@ -1005,7 +1005,11 @@ class PaymentService extends BaseService
'transactionReference' => $payment->transaction_reference, 'transactionReference' => $payment->transaction_reference,
); );
if ($accountGateway->gateway_id != GATEWAY_WEPAY || $amount != ($payment->amount - $payment->refunded)) { if ($accountGateway->gateway_id == GATEWAY_WEPAY && $amount == $payment->getCompletedAmount()) {
// WePay issues a full refund when no amount is set. If an amount is set, it will try
// to issue a partial refund without refunding any fees. However, the Stripe driver
// (but not the API) requires the amount parameter to be set no matter what.
} else {
$details['amount'] = $amount; $details['amount'] = $amount;
} }