xendit-node
Advanced tools
Comparing version 1.19.4 to 1.19.5
@@ -14,3 +14,3 @@ const x = require('../xendit'); | ||
currency: 'PHP', | ||
market: 'PH' | ||
market: 'PH', | ||
}); | ||
@@ -27,3 +27,3 @@ // eslint-disable-next-line no-console | ||
id, | ||
customerName: "DharmaLain", | ||
customerName: 'DharmaLain', | ||
}); | ||
@@ -30,0 +30,0 @@ // eslint-disable-next-line no-console |
@@ -12,3 +12,3 @@ const x = require('../xendit'); | ||
currency: 'PHP', | ||
market: 'PH' | ||
market: 'PH', | ||
}) | ||
@@ -29,3 +29,3 @@ .then(r => { | ||
id, | ||
customerName: "DharmaLain", | ||
customerName: 'DharmaLain', | ||
}); | ||
@@ -32,0 +32,0 @@ }) |
@@ -1,2 +0,2 @@ | ||
console.log('Starting integration test...'); // eslint-disable-line no-console | ||
console.log('Starting Integration Test...'); // eslint-disable-line no-console | ||
Promise.all([ | ||
@@ -16,7 +16,9 @@ require('./card.test')(), | ||
require('./direct_debit.test')(), | ||
require('./regional_retail_outlet.test')(), | ||
require('./report.test')(), | ||
]) | ||
.then(() => { | ||
// eslint-disable-next-line no-console | ||
console.log('Successful integation test!'); | ||
Promise.all([require('./regional_retail_outlet.test')()]).then(() => | ||
// eslint-disable-next-line no-console | ||
console.log('Successful Integration Test!'), | ||
); | ||
}) | ||
@@ -23,0 +25,0 @@ .catch(e => { |
@@ -6,3 +6,3 @@ const x = require('./xendit_ph.test'); | ||
const dynamicReferenceId = Math.floor((Math.random() * 9999) + 1) | ||
const dynamicReferenceId = Math.floor(Math.random() * 9999 + 1); | ||
@@ -17,6 +17,8 @@ module.exports = function() { | ||
currency: 'PHP', | ||
market: 'PH' | ||
market: 'PH', | ||
}) | ||
.then(({ id }) => ro.getPaymentCode({ id })) | ||
.then(({ id }) => ro.updatePaymentCode({ id: id, customerName: "DharmaLain" })) | ||
.then(({ id }) => | ||
ro.updatePaymentCode({ id: id, customerName: 'DharmaLain' }), | ||
) | ||
.then(() => { | ||
@@ -27,4 +29,6 @@ // eslint-disable-next-line no-console | ||
.catch(e => { | ||
throw new Error(`Regional RO integration tests failed with error: ${e.message}`); | ||
throw new Error( | ||
`Regional RO integration tests failed with error: ${e.message}`, | ||
); | ||
}); | ||
}; |
{ | ||
"name": "xendit-node", | ||
"version": "1.19.4", | ||
"version": "1.19.5", | ||
"description": "NodeJS client for Xendit API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -61,4 +61,4 @@ # Xendit API Node.js Client | ||
+ [Unlink tokenization](#unlink-tokenization) | ||
+ [Create payment method](#create-payment-method) | ||
+ [Get payment methods by customer ID](#get-payment-methods-by-customer-id) | ||
+ [Create payment method (E-Wallet)](#create-payment-method-e-wallet) | ||
+ [Get payment methods by customer ID (E-Wallet)](#get-payment-methods-by-customer-id-e-wallet) | ||
* [Balance Services](#balance-services) | ||
@@ -84,4 +84,4 @@ + [Get balance](#get-balance) | ||
+ [Retrieve accessible accounts by linked account token](#retrieve-accessible-accounts-by-linked-account-token) | ||
+ [Create payment method](#create-payment-method-1) | ||
+ [Get payment methods by customer ID](#get-payment-methods-by-customer-id-1) | ||
+ [Create payment method (Direct Debit)](#create-payment-method-direct-debit) | ||
+ [Get payment methods by customer ID (Direct Debit)](#get-payment-methods-by-customer-id-direct-debit) | ||
+ [Create direct debit payment](#create-direct-debit-payment) | ||
@@ -91,2 +91,5 @@ + [Validate OTP for direct debit payment](#validate-otp-for-direct-debit-payment) | ||
+ [Get direct debit payment status by reference ID](#get-direct-debit-payment-status-by-reference-id) | ||
* [Report Service](#report-service) | ||
+ [Generate Report](#generate-report) | ||
+ [Get Report](#get-report) | ||
* [XenPlatform Service](#xenplatform-service) | ||
@@ -752,3 +755,3 @@ + [Create sub-accounts](#create-sub-accounts) | ||
#### Create payment method | ||
#### Create payment method (E-Wallet) | ||
@@ -764,3 +767,3 @@ ```ts | ||
#### Get payment methods by customer ID | ||
#### Get payment methods by customer ID (E-Wallet) | ||
@@ -1066,3 +1069,3 @@ ```ts | ||
#### Create payment method | ||
#### Create payment method (Direct Debit) | ||
@@ -1078,3 +1081,3 @@ ```ts | ||
#### Get payment methods by customer ID | ||
#### Get payment methods by customer ID (Direct Debit) | ||
@@ -1128,2 +1131,50 @@ ```ts | ||
### Report Service | ||
Instantiate the Report service using a constructor which has been injected with Xendit keys. | ||
```js | ||
const { Report } = x; | ||
const reportSpecificOptions = {}; | ||
const r = new Report(reportSpecificOptions); | ||
``` | ||
Example: Generating a report | ||
```js | ||
r.generateReport({ | ||
type: 'BALANCE_HISTORY', | ||
filterDateFrom: new Date(new Date().getTime() - 24 * 60 * 60 * 1000), // Yesterday's Date | ||
filterDateTo: new Date(), | ||
format: 'CSV', | ||
currency: 'IDR', | ||
}) | ||
.then(res => { | ||
console.log('Generated report:', res); | ||
}) | ||
.catch(e => { | ||
console.error(`Generate Report Failed with Error: ${e.message}`); | ||
}) | ||
``` | ||
#### Generate Report | ||
```ts | ||
r.generateReport(data: { | ||
type: reportTypes; | ||
filterDateFrom?: Date; | ||
filterDateTo?: Date; | ||
format?: formatTypes; | ||
currency?: currencyTypes; | ||
}) | ||
``` | ||
#### Get Report | ||
```ts | ||
r.getReport(data: { | ||
id: string | ||
}) | ||
``` | ||
### XenPlatform Service | ||
@@ -1130,0 +1181,0 @@ |
@@ -20,3 +20,3 @@ const { promWithJsErr, Validate, fetchWithHTTPErr, Auth } = require('../utils'); | ||
RegionalRetailOutlet._constructorWithInjectedXenditOpts = function(options) { | ||
RegionalRetailOutlet._injectedOpts = options; | ||
RegionalRetailOutlet._injectedOpts = options; | ||
return RegionalRetailOutlet; | ||
@@ -28,3 +28,10 @@ }; | ||
Validate.rejectOnMissingFields( | ||
['referenceId', 'channelCode', 'amount', 'currency', 'customerName', 'market'], | ||
[ | ||
'referenceId', | ||
'channelCode', | ||
'amount', | ||
'currency', | ||
'customerName', | ||
'market', | ||
], | ||
data, | ||
@@ -50,5 +57,3 @@ reject, | ||
metadata: data.metadata, | ||
expires_at: data.expiresAt | ||
? data.expiresAt.toISOString() | ||
: undefined, | ||
expires_at: data.expiresAt ? data.expiresAt.toISOString() : undefined, | ||
is_single_use: data.isSingleUse, | ||
@@ -75,3 +80,3 @@ }), | ||
currency: data.amount, | ||
customer_name: data.customerName | ||
customer_name: data.customerName, | ||
}), | ||
@@ -78,0 +83,0 @@ }) |
@@ -16,2 +16,3 @@ import Errors from './errors'; | ||
import { DirectDebitService } from './direct_debit'; | ||
import { ReportService } from './report'; | ||
@@ -34,3 +35,4 @@ declare class Xendit { | ||
DirectDebit: typeof DirectDebitService; | ||
Report: typeof ReportService; | ||
} | ||
export = Xendit; |
@@ -15,2 +15,3 @@ const { CardService } = require('./card'); | ||
const { RegionalRetailOutletService } = require('./regional_retail_outlet'); | ||
const { ReportService } = require('./report'); | ||
const Errors = require('./errors'); | ||
@@ -43,2 +44,3 @@ | ||
); | ||
// eslint-disable-next-line | ||
this.RegionalRetailOutlet = RegionalRetailOutletService._constructorWithInjectedXenditOpts( | ||
@@ -53,2 +55,3 @@ this.opts, | ||
); | ||
this.Report = ReportService._constructorWithInjectedXenditOpts(this.opts); | ||
} | ||
@@ -55,0 +58,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195136
170
5353
1266