fixes for payment refunds
This commit is contained in:
parent
66fc75bb83
commit
b63972e250
1 changed files with 7 additions and 5 deletions
|
|
@ -73,16 +73,18 @@ class RefundPayment
|
|||
{
|
||||
if ($this->refund_data['gateway_refund'] !== false && $this->total_refund > 0) {
|
||||
if ($this->payment->company_gateway) {
|
||||
|
||||
$response = $this->payment->company_gateway->driver($this->payment->client)->refund($this->payment, $this->total_refund);
|
||||
|
||||
|
||||
if ($response['success'] == false) {
|
||||
throw new PaymentRefundFailed();
|
||||
}
|
||||
|
||||
$this->payment->refunded += $this->total_refund;
|
||||
|
||||
$this->createActivity($this->payment);
|
||||
|
||||
if ($response['success'] == false) {
|
||||
$this->payment->save();
|
||||
throw new PaymentRefundFailed();
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$this->payment->refunded += $this->total_refund;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue