mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for processInternallyFailedPayment
This commit is contained in:
parent
760de008f8
commit
38ceefc536
@ -360,16 +360,15 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
public function processInternallyFailedPayment($gateway, $e)
|
public function processInternallyFailedPayment($gateway, $e)
|
||||||
{
|
{
|
||||||
|
if (!is_null($this->payment_hash)) {
|
||||||
$this->unWindGatewayFees($this->payment_hash);
|
$this->unWindGatewayFees($this->payment_hash);
|
||||||
|
}
|
||||||
|
|
||||||
if ($e instanceof CheckoutHttpException) {
|
if ($e instanceof CheckoutHttpException) {
|
||||||
$error = $e->getBody();
|
$error = $e->getBody();
|
||||||
}
|
} else if ($e instanceof Exception) {
|
||||||
else if ($e instanceof Exception) {
|
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
|
|
||||||
PaymentFailureMailer::dispatch(
|
PaymentFailureMailer::dispatch(
|
||||||
@ -379,6 +378,8 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
$this->payment_hash
|
$this->payment_hash
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!is_null($this->payment_hash)) {
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject;
|
$nmo = new NinjaMailerObject;
|
||||||
$nmo->mailable = new NinjaMailer((new ClientPaymentFailureObject($gateway->client, $error, $gateway->client->company, $this->payment_hash))->build());
|
$nmo->mailable = new NinjaMailer((new ClientPaymentFailureObject($gateway->client, $error, $gateway->client->company, $this->payment_hash))->build());
|
||||||
$nmo->company = $gateway->client->company;
|
$nmo->company = $gateway->client->company;
|
||||||
@ -389,7 +390,6 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
$invoices->each(function ($invoice) {
|
$invoices->each(function ($invoice) {
|
||||||
|
|
||||||
$invoice->service()->deletePdf();
|
$invoice->service()->deletePdf();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$invoices->first()->invitations->each(function ($invitation) use ($nmo) {
|
$invoices->first()->invitations->each(function ($invitation) use ($nmo) {
|
||||||
@ -398,10 +398,9 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
$nmo->to_user = $invitation->contact;
|
$nmo->to_user = $invitation->contact;
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SystemLogger::dispatch(
|
SystemLogger::dispatch(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user