From e53eeca611c323b8936d3acf6ac41d0c73a75c3d Mon Sep 17 00:00:00 2001 From: lehuygiang28 Date: Mon, 29 Apr 2024 20:18:40 +0700 Subject: [PATCH] chore: :memo: update docs and example --- README.md | 2 +- README_en-US.md | 2 +- example/index.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87a1d84..8496139 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ import { VNPay } from 'vnpay'; const vnpay = new VNPay({ tmnCode: '2QXUI4B4', secureSecret: 'secret', - api_Host: 'https://sandbox.vnpayment.vn', + vnpayHost: 'https://sandbox.vnpayment.vn', testMode: true, // optional hashAlgorithm: 'SHA512', // optional }); diff --git a/README_en-US.md b/README_en-US.md index 72047b2..8c754f2 100644 --- a/README_en-US.md +++ b/README_en-US.md @@ -43,7 +43,7 @@ import { VNPay } from 'vnpay'; const vnpay = new VNPay({ tmnCode: '2QXUI4B4', secureSecret: 'secret', - api_Host: 'https://sandbox.vnpayment.vn', + vnpayHost: 'https://sandbox.vnpayment.vn', testMode: true, // optional hashAlgorithm: 'SHA512', // optional }); diff --git a/example/index.ts b/example/index.ts index a6142fe..737316e 100644 --- a/example/index.ts +++ b/example/index.ts @@ -2,7 +2,8 @@ import crypto from 'crypto'; import { VNPay } from '../src/vnpay'; import { dateFormat } from '../src/utils'; import { ReturnQueryFromVNPay, VerifyReturnUrl } from '../src/types'; -import { RefundTransactionType, VnpLocale, VnpOrderType } from '../src/enums'; +import { RefundTransactionType, VnpLocale } from '../src/enums'; +import { ProductCode } from '../src/constants'; /** * This function is used to generate secure hash for testing purpose only @@ -46,7 +47,7 @@ async function main() { vnp_IpAddr: '1.1.1.1', vnp_TxnRef: orderId, vnp_OrderInfo: '123456', - vnp_OrderType: VnpOrderType.OTHER, + vnp_OrderType: ProductCode.Other, vnp_ReturnUrl: 'http://localhost:3000/return', vnp_Locale: VnpLocale.VN, });