MCPcopy Index your code
hub / github.com/cerpinn/monopay

github.com/cerpinn/monopay @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
132 symbols 255 edges 85 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Monopay - مونو‌پِی

monopay

Intended Runtime Environment: Node.js NPM Version License Last Comit

A node.js package for making payment transactions with different Iranian IPGs with one single API. (Previously known as "Polypay")

مونو‌پِی یک پکیج نود جی اس برای انجام تراکنش‌های آنلاین با سرویس های درگاه پرداخت مختلف با یک رابط واحد است.

در صورتی که از پکیج خوشتون اومده، بهش استار بدید تا بیشتر دیده بشه و مشکلاتش زودتر برطرف بشن. 🙏

لطفا قبل از استفاده در پروداکشن،‌ از پایدار بودن درایور مطمئن شوید. - جدول پشتیبانی درایور ها

📖 Documentation

🔌 Installation

For npm users:

npm install monopay

For yarn users:

yarn add monopay

🚀 Usage

⚒ Examples

Getting a payment driver

const driver = getPaymentDriver('zibal')({
  merchantId: 'merchant-id',
  sandbox: true,
});

Requesting for payment

const paymentInfo = await driver.request({
  amount: 200000, // IRR
  callbackUrl: 'mysite.com/callback',
});

Verifying the payment in callback

app.all('/callback', async (req, res) => {
  const receipt = await driver.verify(
    {
      amount: 200000, // IRR
      referenceId: 1234,
    },
    { ...req.query, ...req.body },
  );

  res.json({
    referenceId: receipt.referenceId,
    success: true,
    message: 'The payment transaction was successful.',
  });
});

A full example with express can be found here

📜 TODO List

  • [ ] Support for all the drivers
  • [ ] Add NestJS module integration
  • [ ] Examples for Koa, Fastify and NestJS
  • [ ] "Re-brand" (Logo and banner)

🤝 Contribution

Please read Contribution and Code Of Conduct.

📝 License

MIT License - Please see License File for more information.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Interface 74
Function 30
Class 15
Method 13

Languages

TypeScript100%

Modules by API surface

packages/monopay/src/exceptions.ts11 symbols
packages/monopay/src/drivers/idpay/api.ts8 symbols
packages/monopay/src/drivers/payir/api.ts7 symbols
packages/monopay/src/drivers/payfa/api.ts7 symbols
src/nestjs/monopay.module.ts6 symbols
packages/monopay/src/drivers/parsian/api.ts6 symbols
packages/monopay/src/drivers/nextpay/api.ts6 symbols
packages/monopay/src/drivers/zibal/api.ts5 symbols
packages/monopay/src/drivers/zarinpal/api.ts5 symbols
packages/monopay/src/drivers/vandar/api.ts5 symbols
packages/monopay/src/drivers/sadad/api.ts5 symbols
packages/monopay/src/drivers/payping/api.ts5 symbols

For agents

$ claude mcp add monopay \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page