mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Only show 'Refund Payment' for selected gateways
This commit is contained in:
parent
e776f439b0
commit
48f2f58d3f
@ -123,12 +123,11 @@ class PaymentDatatable extends EntityDatatable
|
||||
return "javascript:showRefundModal({$model->public_id}, '{$max_refund}', '{$formatted}', '{$symbol}')";
|
||||
},
|
||||
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->payment_type_id == PAYMENT_TYPE_CREDIT
|
||||
);
|
||||
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);
|
||||
}
|
||||
]
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user