Merge pull request #4413 from turbo124/v5-develop

Fixes for sending email user
This commit is contained in:
David Bomba 2020-12-02 14:35:35 +11:00 committed by GitHub
commit 9a1ea49793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;