Skip to content

trantuan94/node-vnpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'
    })

About

Support for payment by VNPAY

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published