mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01: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;
|
||||
}
|
||||
|
||||
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($action == 'failed' || $action == 'charged_back') {
|
||||
if (! $payment->isFailed()) {
|
||||
$payment->markFailed($event['details']['description']);
|
||||
|
@ -474,6 +474,10 @@ class StripePaymentDriver extends BasePaymentDriver
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($eventType == 'charge.failed') {
|
||||
if (! $payment->isFailed()) {
|
||||
$payment->markFailed($source['failure_message']);
|
||||
|
@ -276,6 +276,10 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
throw new Exception('Unknown payment');
|
||||
}
|
||||
|
||||
if ($payment->is_deleted || $payment->invoice->is_deleted) {
|
||||
throw new Exception('Payment is deleted');
|
||||
}
|
||||
|
||||
$wepay = Utils::setupWePay($accountGateway);
|
||||
$checkout = $wepay->request('checkout', [
|
||||
'checkout_id' => intval($objectId),
|
||||
|
Loading…
Reference in New Issue
Block a user