🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

polypay

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polypay

A node.js package for making payment transactions with different Iranian IPGs

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

polypay.js

polypay.js

A node.js package for making payment transactions with different Iranian IPGs with one single API.

📖 Documentation

  • Documentation
  • مستندات فارسی

🔌 Installation

For npm users:

npm install polypay

For yarn users:

yarn add polypay

🚀 Usage

⚒ Examples

Getting a payment driver

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

Requesting for payment

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

Verifying the payment in callback

app.all('/callback', async (req, res) => {
  const receipt = await driver.verifyPayment({
      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

🤝 Contribution

Please read Contribution and Code Of Conduct.

📝 License

MIT License - Please see License File for more information.

Keywords

payment

FAQs

Package last updated on 17 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts