1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00

Disable unused methods from RefundPayment

This commit is contained in:
Benjamin Beganović 2020-09-24 12:21:17 +02:00
parent f34410cdea
commit f6263fd59e

View File

@ -72,17 +72,15 @@ class RefundPayment
{ {
if ($this->refund_data['gateway_refund'] !== false && $this->total_refund > 0) { if ($this->refund_data['gateway_refund'] !== false && $this->total_refund > 0) {
if ($this->payment->company_gateway) { 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(); throw new PaymentRefundFailed();
} }
$this->payment->refunded += $this->total_refund; $this->payment->refunded += $this->total_refund;
$this $this->createActivity($this->payment);
->createActivity($gateway)
->updateCreditNoteBalance();
} }
} else { } else {
$this->payment->refunded += $this->total_refund; $this->payment->refunded += $this->total_refund;
@ -106,7 +104,7 @@ class RefundPayment
$fields->user_id = $this->payment->user_id; $fields->user_id = $this->payment->user_id;
$fields->company_id = $this->payment->company_id; $fields->company_id = $this->payment->company_id;
$fields->activity_type_id = Activity::REFUNDED_PAYMENT; $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); $fields->notes = json_encode($notes);
if (isset($this->refund_data['invoices'])) { if (isset($this->refund_data['invoices'])) {