Don't apply webhooks to deleted invoices/payments
This commit is contained in:
parent
a0774b75b5
commit
eef4ab65fb
3 changed files with 12 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue