mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Refactor for payment failure mailers
This commit is contained in:
parent
6641320567
commit
f962e3a2fa
@ -176,7 +176,7 @@ abstract class QueryFilters
|
|||||||
public function is_deleted($value)
|
public function is_deleted($value)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->builder->where('is_deleted', $value);
|
return $this->builder->where('is_deleted', $value)->withTrashed();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
$invoices->first()->invitations->each(function ($invitation) use ($nmo){
|
$invoices->first()->invitations->each(function ($invitation) use ($nmo){
|
||||||
|
|
||||||
if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
if (!$invitation->contact->trashed()) {
|
||||||
|
|
||||||
$nmo->to_user = $invitation->contact;
|
$nmo->to_user = $invitation->contact;
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
@ -83,8 +83,12 @@ class CreditCard
|
|||||||
|
|
||||||
$response_status = ErrorCode::getStatus($response->ResponseMessage);
|
$response_status = ErrorCode::getStatus($response->ResponseMessage);
|
||||||
|
|
||||||
if(!$response_status['success'])
|
if(!$response_status['success']){
|
||||||
|
|
||||||
|
$this->eway_driver->sendFailureMail($response_status['message']);
|
||||||
|
|
||||||
throw new PaymentFailed($response_status['message'], 400);
|
throw new PaymentFailed($response_status['message'], 400);
|
||||||
|
}
|
||||||
|
|
||||||
//success
|
//success
|
||||||
$cgt = [];
|
$cgt = [];
|
||||||
@ -158,6 +162,8 @@ class CreditCard
|
|||||||
|
|
||||||
$this->logResponse($response, false);
|
$this->logResponse($response, false);
|
||||||
|
|
||||||
|
$this->eway_driver->sendFailureMail($response_status['message']);
|
||||||
|
|
||||||
throw new PaymentFailed($response_status['message'], 400);
|
throw new PaymentFailed($response_status['message'], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +243,8 @@ class CreditCard
|
|||||||
|
|
||||||
$this->logResponse($response, false);
|
$this->logResponse($response, false);
|
||||||
|
|
||||||
|
$this->eway_driver->sendFailureMail($response_status['message']);
|
||||||
|
|
||||||
throw new PaymentFailed($response_status['message'], 400);
|
throw new PaymentFailed($response_status['message'], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,9 @@ class Hosted implements MethodInterface
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if (! property_exists($this->razorpay->payment_hash->data, 'order_id')) {
|
if (! property_exists($this->razorpay->payment_hash->data, 'order_id')) {
|
||||||
|
|
||||||
|
$this->razorpay->sendFailureMail("Missing [order_id] property. ");
|
||||||
|
|
||||||
throw new PaymentFailed('Missing [order_id] property. Please contact the administrator. Reference: ' . $this->razorpay->payment_hash->hash);
|
throw new PaymentFailed('Missing [order_id] property. Please contact the administrator. Reference: ' . $this->razorpay->payment_hash->hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class ACH
|
|||||||
return $this->processUnsuccessfulPayment($state);
|
return $this->processUnsuccessfulPayment($state);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if ($e instanceof CardException) {
|
if ($e instanceof CardException) {
|
||||||
return redirect()->route('client.payment_methods.verification', ['payment_method' => $source->hashed_id, 'method' => GatewayType::BANK_TRANSFER]);
|
return redirect()->route('client.payment_methods.verification', ['payment_method' => $cgt->hashed_id, 'method' => GatewayType::BANK_TRANSFER]);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new PaymentFailed($e->getMessage(), $e->getCode());
|
throw new PaymentFailed($e->getMessage(), $e->getCode());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user