getWebhookActionAndData - Payment Module Reference

This documentation provides a reference to the getWebhookActionAndData method. This belongs to the Payment Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

This method retrieves webhook event data with the associated payment provider.

Learn more about handling webhook events in this guide

Example#

In the following example, req is an instance of MedusaRequest:

Code
1const dataAndAction = await paymentModuleService.getWebhookActionAndData({2  provider: "stripe",3  payload: {4    data: req.body,5    rawData: req.rawBody,6    headers: req.headers,7  },8})

Parameters#

The webhook event's details.

Returns#

PromisePromise<WebhookActionResult>
Resolves when the webhook event is handled successfully.
Was this page helpful?