Skip to content

Create orders via webhook when necessary#139

Merged
duncanmcclean merged 21 commits into1.xfrom
checkout-flow
Feb 20, 2026
Merged

Create orders via webhook when necessary#139
duncanmcclean merged 21 commits into1.xfrom
checkout-flow

Conversation

@duncanmcclean
Copy link
Copy Markdown
Owner

This pull request fixes an issue where orders wouldn't be created unless the customer reaches the payment gateway's "callback URL".

This could happen for a number of reasons -- but specifically in #137, customers were closing the tab after seeing BLIK's confirmation page.

Solution

This PR fixes the issue by creating orders via webhooks if they don't already exist.

I've extracted the logic out of the CheckoutController (the callback URL) into an action, so it can be re-used when processing webhooks.

When the Stripe/Mollie webhooks can't find an order, they'll attempt to find a cart and create an order from it before continuing with the rest of their logic.

If the callback URL is hit while the webhook is creating the order (or vice versa), they'll need to wait on the order being created in the other request before continuing.

If the order can't be created - for example: there's no address, or there's not enough stock available to fulfil the order - the order will be created, immediately cancelled and the payment will be reversed. It's not the best UX right now, but I'm planning on circling back to it in the future.


Fixes #137

@duncanmcclean duncanmcclean marked this pull request as ready for review February 20, 2026 20:25
@duncanmcclean duncanmcclean merged commit 08b39aa into 1.x Feb 20, 2026
8 checks passed
@duncanmcclean duncanmcclean deleted the checkout-flow branch February 20, 2026 20:59
@github-actions
Copy link
Copy Markdown

Released as part of v1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mollie better handling for BLIK payment type

1 participant