mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:14:28 -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) {
|
||||
return Auth::user()->can('editByOwner', [ENTITY_PAYMENT, $model->user_id])
|
||||
&& $model->payment_status_id >= PAYMENT_STATUS_COMPLETED
|
||||
&& $model->refunded < $model->amount
|
||||
&& $model->transaction_reference
|
||||
&& in_array($model->gateway_id , static::$refundableGateways);
|
||||
&& $model->refunded < $model->amount;
|
||||
}
|
||||
]
|
||||
];
|
||||
|
@ -161,6 +161,9 @@ class PaymentService extends BaseService
|
||||
if ($paymentDriver->refundPayment($payment, $amount)) {
|
||||
$successful++;
|
||||
}
|
||||
} else {
|
||||
$payment->recordRefund($amount);
|
||||
$successful++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,8 @@
|
||||
{!! Former::open($url)->method($method)
|
||||
->rules([
|
||||
'name' => 'required',
|
||||
'rate' => 'required'
|
||||
'rate' => 'required',
|
||||
'is_inclusive' => 'required',
|
||||
])
|
||||
->addClass('warn-on-exit') !!}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user