An open-source library support to payment with VNPay.
VNPay documents: https://sandbox.vnpayment.vn/apis/docs/huong-dan-tich-hop/
Install vnpay
with npm
:
npm install vnpay
Install vnpay
with yarn
:
yarn add vnpay
Install vnpay
with pnpm
:
pnpm add vnpay
import { VNPay } from 'vnpay';
const vnpay = new VNPay({
tmnCode: '2QXUI4B4',
secureSecret: 'secret',
vnpayHost: 'https://sandbox.vnpayment.vn',
testMode: true, // optional
hashAlgorithm: 'SHA512', // optional
});
Method | Description | Status |
---|---|---|
getBankList |
Get VNPay support bank list | ✅ |
buildPaymentUrl |
Build payment url with data | ✅ |
verifyIpnUrl |
Verify ipn call from VNPay | ✅ |
verifyReturnUrl |
Verify return url from VNPay | ✅ |
queryDr |
Query result transaction | ✅ |
refund |
Request refund | ✅ |
Note:
- The ✅ icon indicates that the task has been completed.
- The 📝 icon indicates that the task is todo.
- The ❗ icon indicates that the task needs help.