xendit-node
Advanced tools
Comparing version 1.19.7 to 1.19.8
@@ -17,2 +17,3 @@ console.log('Starting Integration Test...'); // eslint-disable-line no-console | ||
require('./report.test')(), | ||
require('./transaction.test')(), | ||
]) | ||
@@ -19,0 +20,0 @@ .then(() => { |
{ | ||
"name": "xendit-node", | ||
"version": "1.19.7", | ||
"version": "1.19.8", | ||
"description": "NodeJS client for Xendit API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,7 +71,7 @@ # Xendit API Node.js Client | ||
+ [Update fixed payment code](#update-fixed-payment-code) | ||
+ [Simulate payment (only in dev mode)](#simulate-payment) | ||
+ [Simulate payment for RO (only in dev mode)](#simulate-payment-for-ro-only-in-dev-mode) | ||
* [QR Code Services](#qr-code-services) | ||
+ [Create code](#create-code) | ||
+ [Get code](#get-code) | ||
+ [Simulate payment (only in dev mode)](#simulate-payment-only-in-dev-mode) | ||
+ [Simulate payment for QR (only in dev mode)](#simulate-payment-for-qr-only-in-dev-mode) | ||
+ [Get payments by external ID](#get-payments-by-external-id) | ||
@@ -96,2 +96,5 @@ * [Customer services](#customer-services) | ||
+ [Get Report](#get-report) | ||
* [Transaction Service](#transaction-service) | ||
+ [Get Transaction](#get-transaction) | ||
+ [List Transactions](#list-transactions) | ||
* [XenPlatform Service](#xenplatform-service) | ||
@@ -888,3 +891,3 @@ + [Create sub-accounts](#create-sub-accounts) | ||
#### Simulate payment | ||
#### Simulate payment for RO (only in dev mode) | ||
@@ -945,3 +948,3 @@ ```ts | ||
#### Simulate payment (only in dev mode) | ||
#### Simulate payment for QR (only in dev mode) | ||
@@ -1214,2 +1217,56 @@ ```ts | ||
### Transaction Service | ||
Instantiate the Transaction service using a constructor which has been injected with Xendit keys. | ||
```js | ||
const { Transaction } = x; | ||
const transactionSpecificOptions = {}; | ||
const t = new Transaction(transactionSpecificOptions); | ||
``` | ||
Example: Getting a transaction | ||
```js | ||
t.getTransaction({ | ||
id: "txn_123" | ||
}) | ||
.then(res => { | ||
console.log('Get Transaction:', res); | ||
}) | ||
.catch(e => { | ||
console.error(`Get Transaction Failed with Error: ${e.message}`); | ||
}) | ||
``` | ||
#### Get Transaction | ||
```ts | ||
t.getTransaction(data: { | ||
id: string; | ||
}) | ||
``` | ||
#### List Transactions | ||
```ts | ||
t.listTransactions(data: { | ||
types?: Array<string>; | ||
statuses?: Array<string>; | ||
channelCategories?: Array<string>; | ||
referenceId?: string; | ||
productId?: string; | ||
accountIdentifier?: string; | ||
currency?: string; | ||
amount?: number; | ||
limit?: number; | ||
afterId?: string; | ||
beforeId?: string; | ||
createdDateFrom?: Date; | ||
createdDateTo?: Date; | ||
updatedDateFrom?: Date; | ||
updatedDateTo?: Date; | ||
}) | ||
``` | ||
### XenPlatform Service | ||
@@ -1216,0 +1273,0 @@ |
@@ -17,2 +17,3 @@ import Errors from './errors'; | ||
import { ReportService } from './report'; | ||
import { TransactionService } from './transaction'; | ||
@@ -36,3 +37,4 @@ declare class Xendit { | ||
Report: typeof ReportService; | ||
Transaction: typeof TransactionService; | ||
} | ||
export = Xendit; |
@@ -16,2 +16,3 @@ const { CardService } = require('./card'); | ||
const { ReportService } = require('./report'); | ||
const { TransactionService } = require('./transaction'); | ||
const Errors = require('./errors'); | ||
@@ -55,2 +56,5 @@ | ||
this.Report = ReportService._constructorWithInjectedXenditOpts(this.opts); | ||
this.Transaction = TransactionService._constructorWithInjectedXenditOpts( | ||
this.opts, | ||
); | ||
} | ||
@@ -57,0 +61,0 @@ |
209363
181
5738
1361