Overview
Icon for MakePay

MakePay

Accept crypto payments via MakePay

MakePay for Medusa

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.

Install

npm install @makecrypto/medusa-plugin-makepay

Configure

Register MakePay as a provider under the Medusa Payment Module:

// medusa-config.ts
import { defineConfig, Modules } from "@medusajs/framework/utils";
export default defineConfig({
modules: [
{
resolve: "@medusajs/medusa/payment",
options: {
providers: [
{
resolve: "@makecrypto/medusa-plugin-makepay/providers/makepay",
id: "makepay",
options: {
keyId: process.env.MAKEPAY_KEY_ID!,
keySecret: process.env.MAKEPAY_KEY_SECRET!,
webhookSecret: process.env.MAKEPAY_WEBHOOK_SECRET!,
settlementCurrency:
process.env.MAKEPAY_SETTLEMENT_CURRENCY || "USDT",
expirationTime: "12h",
},

The default Medusa payment webhook URL for the provider is:

/hooks/payment/makepay_makepay

Configure that URL in MakePay developer settings and store the generated webhook secret as Copy to clipboardMAKEPAY_WEBHOOK_SECRET.

Options

Option Required Description Copy to clipboardkeyId yes MakePay API key ID. Copy to clipboardkeySecret yes MakePay API key secret. Copy to clipboardwebhookSecret yes MakePay webhook signing secret. Copy to clipboardbaseUrl no MakeCrypto API base URL. Defaults to production. Copy to clipboardcheckoutBaseUrl no MakePay hosted checkout base URL. Defaults to production. Copy to clipboardsettlementCurrency no Settlement symbol sent to MakePay. Defaults to Copy to clipboardUSDT. Copy to clipboardexpirationTime no Hosted link expiration. Defaults to Copy to clipboard12h. Copy to clipboardreturnUrl no Fallback return URL for MakePay checkout. Copy to clipboardsuccessUrl no Success return URL for MakePay checkout. Copy to clipboardfailureUrl no Failure return URL for MakePay checkout.

Storefront flow

Copy to clipboardinitiatePayment returns provider data with a hosted checkout URL:

paymentSession.data.next_action
// { 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.

Development

npm ci
npm run check

Copy to clipboardnpm run check builds the TypeScript provider, runs the unit tests, and verifies the npm package contents with Copy to clipboardnpm pack --dry-run.

You may also like

Browse all integrations

Build your own

Develop your own custom integration

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?