diff --git a/app/PaymentDrivers/CheckoutComPaymentDriver.php b/app/PaymentDrivers/CheckoutComPaymentDriver.php index 1db8508bdb66..8cd1eb48cf38 100644 --- a/app/PaymentDrivers/CheckoutComPaymentDriver.php +++ b/app/PaymentDrivers/CheckoutComPaymentDriver.php @@ -273,4 +273,16 @@ class CheckoutComPaymentDriver extends BasePaymentDriver $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) { + // .. + } + } }