Additional checks for GoCardless webhooks

This commit is contained in:
David Bomba 2022-09-08 15:58:34 +10:00
parent b159a5a08d
commit 99045110ed

View File

@ -261,7 +261,7 @@ class GoCardlessPaymentDriver extends BaseDriver
//finalize payments on invoices here.
}
if ($event['action'] === 'failed') {
if ($event['action'] === 'failed' && array_key_exists('payment', $event['links'])) {
$payment = Payment::query()
->where('transaction_reference', $event['links']['payment'])
->where('company_id', $request->getCompany()->id)