Skip to content

Latest commit

 

History

History
108 lines (87 loc) · 2.6 KB

README_en-US.md

File metadata and controls

108 lines (87 loc) · 2.6 KB

VNPay API Nodejs

VI | EN

An open-source library support to payment with VNPay.

VNPay documents: https://sandbox.vnpayment.vn/apis/docs/huong-dan-tich-hop/

Installation:

Install vnpay with npm:

npm install vnpay

Install vnpay with yarn:

yarn add vnpay

Install vnpay with pnpm:

pnpm add vnpay

Usage:

Initialize

import { VNPay } from 'vnpay';

const vnpay = new VNPay({
    tmnCode: '2QXUI4B4',
    secureSecret: 'secret',
    vnpayHost: 'https://sandbox.vnpayment.vn',
    testMode: true, // optional
    hashAlgorithm: 'SHA512', // optional
});

Methods

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.

Example here: Click here

Contribution