From f6263fd59eb67e8b570be9af47e90f70856f9365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 24 Sep 2020 12:21:17 +0200 Subject: [PATCH] Disable unused methods from RefundPayment --- app/Services/Payment/RefundPayment.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index ac4e31a4c6..961366a011 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -72,17 +72,15 @@ class RefundPayment { if ($this->refund_data['gateway_refund'] !== false && $this->total_refund > 0) { if ($this->payment->company_gateway) { - $response = $gateway->driver($this->payment->client)->refund($this->payment, $this->total_refund); + $response = $this->payment->company_gateway->driver($this->payment->client)->refund($this->payment, $this->total_refund); - if ($response['success']) { + if ($response['success'] == false) { throw new PaymentRefundFailed(); } $this->payment->refunded += $this->total_refund; - $this - ->createActivity($gateway) - ->updateCreditNoteBalance(); + $this->createActivity($this->payment); } } else { $this->payment->refunded += $this->total_refund; @@ -106,7 +104,7 @@ class RefundPayment $fields->user_id = $this->payment->user_id; $fields->company_id = $this->payment->company_id; $fields->activity_type_id = Activity::REFUNDED_PAYMENT; - $fields->credit_id = $this->credit_note->id; + // $fields->credit_id = $this->credit_note->id; // TODO $fields->notes = json_encode($notes); if (isset($this->refund_data['invoices'])) {