Learning Resources

processEvent - Payment Module Reference

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

This method handles a webhook event 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
1await paymentModuleService.processEvent({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<void>
Resolves when the webhook event is handled successfully.
Was this page helpful?