npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

medusa-payment-paystation

v1.0.1

Published

Paystation payment provider plugin for MedusaJS v2

Readme

medusa-payment-paystation

A Paystation payment provider plugin for MedusaJS v2. Paystation is a Bangladeshi payment gateway aggregator supporting bKash, Nagad, Rocket, cards, and mobile banking.

Ships as a self-contained MedusaJS plugin: the payment provider itself, plus the redirect/webhook route Paystation calls back to after a hosted checkout completes.

Installation

yarn add medusa-payment-paystation
# or
npm install medusa-payment-paystation

Register it as a payment provider in medusa-config.ts:

module.exports = defineConfig({
  modules: [
    {
      resolve: '@medusajs/medusa/payment',
      options: {
        providers: [
          {
            resolve: 'medusa-payment-paystation/providers/paystation',
            id: 'paystation',
            options: {
              merchantId: process.env.PAYSTATION_MERCHANT_ID,
              password: process.env.PAYSTATION_PASSWORD,
              isSandbox: process.env.PAYSTATION_IS_SANDBOX === 'true'
            }
          }
        ]
      }
    }
  ]
});

Then enable paystation as a payment provider on the relevant region(s) in the admin dashboard (Settings → Regions → Payment providers).

Configuration

PAYSTATION_MERCHANT_ID=your_merchant_id
PAYSTATION_PASSWORD=your_password
PAYSTATION_IS_SANDBOX=true
BACKEND_URL=http://localhost:9000
NEXT_PUBLIC_BASE_URL=http://localhost:3000

| Variable | Purpose | | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | PAYSTATION_MERCHANT_ID / PAYSTATION_PASSWORD | Credentials from your Paystation merchant dashboard | | PAYSTATION_IS_SANDBOX | true uses Paystation's public sandbox endpoint and test credentials; false uses production and your real credentials | | BACKEND_URL | Used to build the callback_url sent to Paystation when initiating a payment | | NEXT_PUBLIC_BASE_URL (or STOREFRONT_URL) | Where the webhook route redirects the customer's browser after payment |

How it works

Paystation is a hosted-checkout gateway: your storefront initiates a payment, redirects the customer to a Paystation-hosted page, and the customer is redirected back to your backend when done. There is no reliable server-to-server webhook — in practice, the browser redirect is the only notification you get, so this plugin treats it as the source of truth but never trusts it blindly:

  1. initiatePayment creates an invoice with Paystation and returns the redirect URL.
  2. The customer pays on Paystation's hosted page and is redirected to <BACKEND_URL>/payment/hooks/paystation.
  3. That route independently re-verifies the transaction against Paystation's /transaction-status API before doing anything — the redirect's own status query param is attacker-controllable and invoice_number is a low-entropy, guessable value, so it is never trusted on its own.
  4. Once verified, the payment is captured via Medusa's capturePaymentWorkflow (not the raw module service, so the CAPTURED event fires for downstream subscribers), and the customer is redirected to their order confirmation page.

Webhook / callback URL

Configure this in the Paystation merchant dashboard, if it offers a separate webhook/notify URL setting (some accounts don't expose one — the redirect above covers that case regardless):

<BACKEND_URL>/payment/hooks/paystation

Storefront provider id

pp_paystation_paystation

Requirements

  • MedusaJS ^2.11.3
  • Node.js >=20

License

MIT