From 503c7de736bfeb791b4ae1d7ac84afba2af3829f Mon Sep 17 00:00:00 2001 From: Javier Su Weijie Date: Mon, 6 Dec 2021 19:25:53 +0800 Subject: [PATCH 1/6] feature: add metadata to charge request --- examples/with_async/card.js | 3 +++ package.json | 2 +- src/card/charge.d.ts | 1 + src/card/charge.js | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/with_async/card.js b/examples/with_async/card.js index 758a83c..0e09e20 100644 --- a/examples/with_async/card.js +++ b/examples/with_async/card.js @@ -17,6 +17,9 @@ const authID = '5e0461a96113354249aab7ee'; // eslint-disable-next-line max-len externalID: Date.now().toString(), // use your system's ID of the transaction capture: false, + metadata: { + test: "data", + }, }); console.log('charge created:', charge); // eslint-disable-line no-console diff --git a/package.json b/package.json index e26ed4f..26a0700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xendit-node", - "version": "1.19.0", + "version": "1.20.0", "description": "NodeJS client for Xendit API", "main": "index.js", "types": "index.d.ts", diff --git a/src/card/charge.d.ts b/src/card/charge.d.ts index 5607933..824a301 100644 --- a/src/card/charge.d.ts +++ b/src/card/charge.d.ts @@ -12,6 +12,7 @@ export function createCharge(data: { promotion?: object; installment?: object; forUserID?: string; + metadata?: object; }): Promise; export function captureCharge(data: { diff --git a/src/card/charge.js b/src/card/charge.js index 8a011c9..407a85b 100644 --- a/src/card/charge.js +++ b/src/card/charge.js @@ -30,6 +30,7 @@ function createCharge(data) { billing_details: data.billingDetails, promotion: data.promotion, installment: data.installment, + metadata: data.metadata, }), }) .then(resolve) From 23a293e30e97dfcca3de90656228845c983c9e5f Mon Sep 17 00:00:00 2001 From: Hendry Zheng Date: Tue, 7 Dec 2021 14:51:57 +0700 Subject: [PATCH 2/6] update va test update --- integration_test/va.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/va.test.js b/integration_test/va.test.js index 779c2b1..4ff1181 100644 --- a/integration_test/va.test.js +++ b/integration_test/va.test.js @@ -8,7 +8,7 @@ module.exports = function() { .getVABanks() .then(banks => { return va.createFixedVA({ - externalID: '123', + externalID: new Date().toLocaleString(), bankCode: banks[0].code, name: 'Stanley Nguyen', isClosed: true, From b79d7b7f9e26f4b785c59ad9ce657b2836de711c Mon Sep 17 00:00:00 2001 From: Hendry Zheng Date: Tue, 7 Dec 2021 15:10:58 +0700 Subject: [PATCH 3/6] Update test.yml update secret key --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9daeeb2..7bf21ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,4 +25,4 @@ jobs: - run: npm test - run: npm run test:integration env: - SECRET_KEY: xnd_development_chBDpzjQZEI8nncBLrWtwau5r7rgiuunCJ4JCqsd68rXemDd74BnRpdO0bIZAMK + SECRET_KEY: xnd_development_XY2rHKsV2LGwUlZwVmAewGrLVyA1dNFUaO9anpjFuFMveMH4GvrQU8l8JrBX6QZ From c3ea6e23e4cc789b91ff855f1b510155e39c2601 Mon Sep 17 00:00:00 2001 From: Hendry Zheng Date: Tue, 7 Dec 2021 15:11:58 +0700 Subject: [PATCH 4/6] revert back --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7bf21ef..9daeeb2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,4 +25,4 @@ jobs: - run: npm test - run: npm run test:integration env: - SECRET_KEY: xnd_development_XY2rHKsV2LGwUlZwVmAewGrLVyA1dNFUaO9anpjFuFMveMH4GvrQU8l8JrBX6QZ + SECRET_KEY: xnd_development_chBDpzjQZEI8nncBLrWtwau5r7rgiuunCJ4JCqsd68rXemDd74BnRpdO0bIZAMK From d2b53710847cc988fe3a3a8c01f4646af645f18d Mon Sep 17 00:00:00 2001 From: Javier Su Weijie Date: Tue, 7 Dec 2021 16:18:54 +0800 Subject: [PATCH 5/6] Updated changelog and patch --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 758fe49..cec8d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2021-12-07 + +- Added metadata to credit card charge request + ## 2021-11-01 - Add missing recurring payment properties diff --git a/package.json b/package.json index 26a0700..da976cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xendit-node", - "version": "1.20.0", + "version": "1.19.1", "description": "NodeJS client for Xendit API", "main": "index.js", "types": "index.d.ts", From 97c4cf70308feac2d0604a882318a0b5ec7c71d1 Mon Sep 17 00:00:00 2001 From: Javier Su Weijie Date: Tue, 7 Dec 2021 16:26:45 +0800 Subject: [PATCH 6/6] Updateed card charge readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1f54b44..a48bc1e 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ card.createCharge(data: { promotion?: object; installment?: object; forUserID?: string; + metadata?: object; }) ```