1
0
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:
Hillel Coren 2017-10-19 12:11:39 +03:00
parent a0774b75b5
commit eef4ab65fb
3 changed files with 12 additions and 0 deletions

View File

@ -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']);

View File

@ -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']);

View File

@ -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),