Hyperswitch
HyperSwitch payment processor plugin for Medusa v2 — unified checkout, webhooks, refunds, and admin configuration.
HyperSwitch Payment Processor Plugin for Medusa
Medusa v2 payment plugin for HyperSwitch — unified checkout, webhooks, refunds, proxy support, and an admin configuration UI.
Features
- Process payments through HyperSwitch's unified API
- Multiple payment methods with a unified checkout experience
- Webhook handling and payment status synchronization
- Manual and automatic capture modes
- Refund processing
- Admin UI for API keys, proxy, customization, and logging
Prerequisites
- Medusa v2.15+
- Node.js v20+
- A HyperSwitch account and API keys
Installation
Follow these steps in your Medusa store project (the app where you run ), not in this plugin repository.
Step 1: Create a Medusa application (if you don't have one)
Step 2: Install the plugin package
From your Medusa application root directory, install the plugin:
Or with another package manager:
This installs the plugin and its runtime dependencies (, , , and admin UI packages). Your Medusa app must already satisfy the plugin's peer dependencies.
Local development: To test unpublished changes from this repo, use after running in the plugin repo. See Local plugin development.
Step 3: Set the encryption key
Generate a 32-byte key for encrypting secrets stored by the plugin:
Add it to your :
HYPERSWITCH_HASH_KEY=your-generated-base64-key-hereStep 4: Configure Medusa
Update :
Step 5: Run migrations and start
Step 6: Configure in Admin
- Open the Medusa Admin panel (e.g. )
- Go to Extensions → Hyperswitch
- Enter your HyperSwitch API keys, profile ID, and environment
- Enable the payment provider for your region in Settings → Regions
Storefront Integration (Next.js Starter)
Use this plugin with the storefront repo:
https://github.com/Ayyanaruto/hyperswitch-medusa-storefront
Storefront environment variables
In your storefront project's , set:
Enable HyperSwitch in the target region
In Medusa Admin:
- Open Settings → Regions
- Select your region
- Add/enable hyperswitch payment provider
- Save changes
4) Test checkout from the storefront
- Start backend ( in your Medusa app)
- Start storefront ( in your Next.js app)
- Add a product to cart and proceed to checkout
- Select HyperSwitch payment method and place an order
5) Validate webhooks (recommended)
For reliable payment state updates, configure HyperSwitch webhooks to point to your Medusa backend webhook endpoint and verify events are received in backend logs.
Local plugin development
To work on the plugin itself and test it in a Medusa store:
In your Medusa store:
npx medusa plugin:add medusa-payment-hyperswitchKeep running in the plugin repo during development so changes are republished automatically.
Publishing to npm
From the plugin repository:
The script runs the build automatically before publish.
Troubleshooting
- Payment errors — Check Medusa server logs and the plugin's logging dashboard in Admin
- Webhooks — Verify webhook URLs and signing in your HyperSwitch dashboard
- API keys — Confirm sandbox vs production keys match your configured environment
- Proxy — Configure proxy settings in the Admin UI if your server requires one
Resources
License
MIT

