checkout.com wip refunds

This commit is contained in:
Benjamin Beganović 2020-06-24 16:29:01 +02:00
parent f6f999b801
commit 6ffb2d7286

View File

@ -273,4 +273,16 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
$company_gateway_token->save(); $company_gateway_token->save();
} }
} }
public function refund(Payment $payment, $amount)
{
$payment = new \Checkout\Models\Payments\Refund($payment->transaction_reference);
$payment->amount = $amount;
try {
$refund = $this->gateway->payments()->refund($payment);
} catch (CheckoutHttpException $e) {
// ..
}
}
} }