Skip to content

Commit

Permalink
Merge pull request #124 from javiersuweijie/fix/add-metadata-to-charge
Browse files Browse the repository at this point in the history
feature: add metadata to charge request
  • Loading branch information
xen-HendryZheng authored Dec 7, 2021
2 parents bc37335 + 97c4cf7 commit b725385
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2021-12-07

- Added metadata to credit card charge request

## 2021-11-01

- Add missing recurring payment properties
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ card.createCharge(data: {
promotion?: object;
installment?: object;
forUserID?: string;
metadata?: object;
})
```

Expand Down
3 changes: 3 additions & 0 deletions examples/with_async/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion integration_test/va.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/card/charge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function createCharge(data: {
promotion?: object;
installment?: object;
forUserID?: string;
metadata?: object;
}): Promise<object>;

export function captureCharge(data: {
Expand Down
1 change: 1 addition & 0 deletions src/card/charge.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function createCharge(data) {
billing_details: data.billingDetails,
promotion: data.promotion,
installment: data.installment,
metadata: data.metadata,
}),
})
.then(resolve)
Expand Down

0 comments on commit b725385

Please sign in to comment.