Skip to content

Commit

Permalink
Add check in case is a payment not order
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Nov 21, 2023
1 parent cb17a19 commit 6f58195
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Payment/MollieOrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ public function onWebhookAction()
$this->processRefunds($order, $payment);
$this->processChargebacks($order, $payment);
//if the order gets updated to completed at mollie, we need to update the order status
if ($order->get_status() === 'processing' && $payment->isCompleted() && method_exists($payment_object, 'onWebhookCompleted')) {
if (
$order->get_status() === 'processing'
&& method_exists($payment, 'isCompleted')
&& $payment->isCompleted()
&& method_exists($payment_object, 'onWebhookCompleted'
)) {
$payment_object->onWebhookCompleted($order, $payment, $payment_method_title);
}
return;
Expand Down

0 comments on commit 6f58195

Please sign in to comment.