Giter VIP home page Giter VIP logo

monopay's Introduction

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.

monopay's People

Contributors

alitnk avatar keivan-sf avatar scrip7 avatar kasraghoreyshi avatar dependabot[bot] avatar ma-amin avatar mhemrg avatar erfansajjadie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.