Official MakePay payment provider for Medusa v2 hosted checkout.
Official MakePay payment provider for Medusa v2. The provider creates hosted MakePay checkout links for Medusa payment sessions and reconciles payment status through signed MakePay webhooks.
Need MakePay credentials? Register your merchant account at makepay.io before configuring this plugin. Your merchant account provides the API key and webhook secret used below.
npm install @makecrypto/medusa-plugin-makepayRegister MakePay as a provider under the Medusa Payment Module:
1// medusa-config.ts2import { defineConfig, Modules } from "@medusajs/framework/utils";3
4export default defineConfig({5 modules: [6 {7 resolve: "@medusajs/medusa/payment",8 options: {9 providers: [10 {11 resolve: "@makecrypto/medusa-plugin-makepay/providers/makepay",12 id: "makepay",13 options: {14 keyId: process.env.MAKEPAY_KEY_ID!,15 keySecret: process.env.MAKEPAY_KEY_SECRET!,16 webhookSecret: process.env.MAKEPAY_WEBHOOK_SECRET!,17 settlementCurrency:18 process.env.MAKEPAY_SETTLEMENT_CURRENCY || "USDT",19 expirationTime: "12h",20 },21 },22 ],23 },24 },25 ],26});The default Medusa payment webhook URL for the provider is:
/hooks/payment/makepay_makepayConfigure that URL in MakePay developer settings and store the generated webhook secret as .
| Option | Required | Description |
|---|---|---|
| yes | MakePay API key ID. | |
| yes | MakePay API key secret. | |
| yes | MakePay webhook signing secret. | |
| no | MakeCrypto API base URL. Defaults to production. | |
| no | MakePay hosted checkout base URL. Defaults to production. | |
| no | Settlement symbol sent to MakePay. Defaults to . | |
| no | Hosted link expiration. Defaults to . | |
| no | Fallback return URL for MakePay checkout. | |
| no | Success return URL for MakePay checkout. | |
| no | Failure return URL for MakePay checkout. | |
| no | Signature timestamp tolerance for MakePay webhooks. |
returns provider data with a hosted checkout URL:
1paymentSession.data.next_action2// { type: "redirect", url: "https://makepay.io/payment/..." }Redirect shoppers to that URL, then use MakePay webhooks to update the Medusa payment session when the payment is completed, canceled, or failed.
If Medusa updates an unpaid payment session because the cart amount or fiat currency changed, the provider archives the old MakePay link and creates a new hosted checkout link for the updated session.
1npm ci2npm run checkbuilds the TypeScript provider, runs the unit tests, and verifies the npm package contents with .