mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 14:14:31 -04:00
Don't apply webhooks to deleted invoices/payments
This commit is contained in:
parent
a0774b75b5
commit
eef4ab65fb
@ -112,6 +112,10 @@ class GoCardlessV2RedirectPaymentDriver extends BasePaymentDriver
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'failed' || $action == 'charged_back') {
|
if ($action == 'failed' || $action == 'charged_back') {
|
||||||
if (! $payment->isFailed()) {
|
if (! $payment->isFailed()) {
|
||||||
$payment->markFailed($event['details']['description']);
|
$payment->markFailed($event['details']['description']);
|
||||||
|
@ -474,6 +474,10 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($eventType == 'charge.failed') {
|
if ($eventType == 'charge.failed') {
|
||||||
if (! $payment->isFailed()) {
|
if (! $payment->isFailed()) {
|
||||||
$payment->markFailed($source['failure_message']);
|
$payment->markFailed($source['failure_message']);
|
||||||
|
@ -276,6 +276,10 @@ class WePayPaymentDriver extends BasePaymentDriver
|
|||||||
throw new Exception('Unknown payment');
|
throw new Exception('Unknown payment');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||||
|
throw new Exception('Payment is deleted');
|
||||||
|
}
|
||||||
|
|
||||||
$wepay = Utils::setupWePay($accountGateway);
|
$wepay = Utils::setupWePay($accountGateway);
|
||||||
$checkout = $wepay->request('checkout', [
|
$checkout = $wepay->request('checkout', [
|
||||||
'checkout_id' => intval($objectId),
|
'checkout_id' => intval($objectId),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user