mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:04:29 -04:00
Support refunding manual payment
This commit is contained in:
parent
62ae88df87
commit
f9fef333ec
@ -131,9 +131,7 @@ class PaymentDatatable extends EntityDatatable
|
|||||||
function ($model) {
|
function ($model) {
|
||||||
return Auth::user()->can('editByOwner', [ENTITY_PAYMENT, $model->user_id])
|
return Auth::user()->can('editByOwner', [ENTITY_PAYMENT, $model->user_id])
|
||||||
&& $model->payment_status_id >= PAYMENT_STATUS_COMPLETED
|
&& $model->payment_status_id >= PAYMENT_STATUS_COMPLETED
|
||||||
&& $model->refunded < $model->amount
|
&& $model->refunded < $model->amount;
|
||||||
&& $model->transaction_reference
|
|
||||||
&& in_array($model->gateway_id , static::$refundableGateways);
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -161,6 +161,9 @@ class PaymentService extends BaseService
|
|||||||
if ($paymentDriver->refundPayment($payment, $amount)) {
|
if ($paymentDriver->refundPayment($payment, $amount)) {
|
||||||
$successful++;
|
$successful++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$payment->recordRefund($amount);
|
||||||
|
$successful++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
{!! Former::open($url)->method($method)
|
{!! Former::open($url)->method($method)
|
||||||
->rules([
|
->rules([
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'rate' => 'required'
|
'rate' => 'required',
|
||||||
|
'is_inclusive' => 'required',
|
||||||
])
|
])
|
||||||
->addClass('warn-on-exit') !!}
|
->addClass('warn-on-exit') !!}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user