Test GoCardless webhooks for valid events

This commit is contained in:
David Bomba 2022-01-11 08:55:11 +11:00
parent ddc19547c5
commit 9910e4f997
2 changed files with 10 additions and 1 deletions

View File

@ -234,6 +234,15 @@ class GoCardlessPaymentDriver extends BaseDriver
$this->init(); $this->init();
if(!is_array($request->events) || !is_object($request->events)){
nlog("No GoCardless events to process in response?");
return response()->json([], 200);
}
foreach ($request->events as $event) { foreach ($request->events as $event) {
if ($event['action'] === 'confirmed') { if ($event['action'] === 'confirmed') {
$payment = Payment::query() $payment = Payment::query()

View File

@ -87,7 +87,7 @@ class UpdateInvoicePayment
$invoice->refresh(); $invoice->refresh();
$invoice->service() $invoice->service()
->touchPdf() ->touchPdf(true)
->workFlow() ->workFlow()
->save(); ->save();