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/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; }) ``` 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/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, diff --git a/package.json b/package.json index e26ed4f..da976cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xendit-node", - "version": "1.19.0", + "version": "1.19.1", "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)