node-vnpay

1.0.1 • Public • Published

node-vnpay

Support for generate URL payment of VNPAY

Installation

    npm i --save node-vnpay

Usage

To use this package, you must register merchant or merchant test account on vnpayment.vn website. You will receive an merchant Code and Secure Secret Key. Save them and continue....

Generate pay url for a payment

    const VNPay = require('node-vnpay')
    let vnpay = new VNPay({
        secretKey: 'YOUR_VNPAY_SECRET_KEY',
        returnUrl: 'YOUR_RETURN_URL_TO_RECEIVE_RESPONSE',
        merchantCode: 'YOUR_MERCHANT_CODE',
        hashAlgorithm: 'sha256' // optional 
    });
    // require pay 10000 VND.
    let payURL = await vnpay.genPayURL({
        transactionRef: 'PT20200520103101_007',
        orderInfo: 'Thanh toan hoa don dich vu',
        orderType: '100000',
        amount: 100000,
        bankCode: 'NCB'
    })

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    163
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    163
  • 1.0.0
    2

Package Sidebar

Install

npm i node-vnpay

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

20.2 kB

Total Files

10

Last publish

Collaborators

  • trantuan94