Skip to content

feat: handle checkout order approved event#5

Open
ochicf wants to merge 1 commit intoalphabite-dev:mainfrom
OrigenStudio:feat/order-approved-event
Open

feat: handle checkout order approved event#5
ochicf wants to merge 1 commit intoalphabite-dev:mainfrom
OrigenStudio:feat/order-approved-event

Conversation

@ochicf
Copy link
Copy Markdown

@ochicf ochicf commented Nov 25, 2025

When trying to configure this plugin into my store, I found that after the checkout only the CHECKOUT.ORDER.APPROVED event was triggered through the webhook, but the PAYMENT.CAPTURE.COMPLETED was never called.

This PR handle the CHECKOUT.ORDER.APPROVED and authorizes the payment so Medusa invokes the authorizePayment method of the service. This does invoke the captureOrder, which eventually will trigger the other webhook to fully capture the payment.

Maybe I'm missing something but this is the only way I found to fully capture the payment, so if this is not correct or expected please let me know.

EDIT: I forced push because I started from my fork's main instead of the upstream's, so originally the PR contained other changes. Sorry about that.

This event gets triggered when the checkout of the order finishes. We can authorise the payment in Medusa so the order is created from the cart, and the payment process continues and gets eventually captured.
@ochicf ochicf force-pushed the feat/order-approved-event branch from 9737ee2 to b0695d3 Compare November 25, 2025 11:27
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.

1 participant