Wompi El Salvador payment provider plugin for MedusaJS v2
Receive payments on your Medusa commerce application using Wompi El Salvador.
Medusa Website | Wompi Docs | Wompi API
[!NOTE] This plugin supports the Enlace de Pago (hosted payment page) flow. Tokenization () and recurring payments are not yet supported. The WompiClient includes methods for these endpoints, ready to be wired into the provider in a future release.
From the Wompi Panel, navigate to your business detail to find:
# npmnpm install @mantissaio/medusa-payment-wompi# pnpmpnpm add @mantissaio/medusa-payment-wompi# yarnyarn add @mantissaio/medusa-payment-wompi
WOMPI_CLIENT_ID=<your_app_id>WOMPI_CLIENT_SECRET=<your_api_secret>WOMPI_API_SECRET=<your_api_secret>
In your :
module.exports = defineConfig({// ...modules: [{resolve: "@medusajs/medusa/payment",options: {providers: [{resolve: "@mantissaio/medusa-payment-wompi/providers/wompi",id: "wompi",options: {clientId: process.env.WOMPI_CLIENT_ID,clientSecret: process.env.WOMPI_CLIENT_SECRET,apiSecret: process.env.WOMPI_API_SECRET,sandbox: true,defaultRedirectUrl: "https://your-store.com/checkout/confirm",defaultWebhookUrl: "https://your-store.com/hooks/payment/wompi_wompi",},},],},},],});
| Option | Required | Description |
|---|---|---|
| Yes | App ID from Wompi panel | |
| Yes | API Secret for OAuth authentication | |
| Yes | API Secret for webhook HMAC validation | |
| No | for development mode (default: ) | |
| No | URL where the customer is redirected after payment | |
| No | Webhook URL for payment notifications | |
| No | Override which payment methods are enabled on the payment page |
Medusa automatically exposes a webhook endpoint at:
For local development:
Wompi sends a header (HMAC-SHA256 of the body using your API Secret) which the plugin validates automatically.
POST
Request:
{ "paymentSessionId": "ps_01ABC..." }
Response:
{"urlEnlace": "https://lk.wompi.sv/abc123","idEnlace": 12345,"urlQrCodeEnlace": "https://wompistorage.blob.core.windows.net/...","urlEnlaceLargo": "https://wompi.sv/pago/..."}
Wompi does not expose a refund API. When a refund is issued from the Medusa admin, the plugin records it in Medusa for traceability (with status ) but the actual fund return must be processed manually through the Wompi Panel or directly with Banco Agricola.
# Install dependenciespnpm install# Run testspnpm test# Buildpnpm build# Dev mode (watch)pnpm dev
# From your Medusa project directorypnpm add ../path-to/medusa-payment-wompi