@channelpayments/node-sdk 1.40.0 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Channel Payments Node SDK
|
|
2
|
+
|
|
3
|
+
Channel Payments provides developers with a user-friendly SDK, designed to streamline the integration process with the Channel Payments API.
|
|
4
|
+
|
|
5
|
+
This SDK offers a range of tools and functionalities that simplify the implementation of our payment features into your applications. For instructions on utilizing specific methods, please refer to the API guides within the Getting Started section.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
> npm i @channelpayments/node-sdk
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { ChannelPaymentsApi } from "@channelpayments/node-sdk";
|
|
15
|
+
import * as fs from 'fs';
|
|
16
|
+
|
|
17
|
+
const channelPaymentsApi = new ChannelPaymentsApi({
|
|
18
|
+
keyId: '<integration key id>',
|
|
19
|
+
privateKey: fs.readFileSync('</path/to/... integration pem file', 'utf8'),
|
|
20
|
+
environment: '<**optional**, set to "sandbox" for sandbox testing>',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export async function getMerchant() {
|
|
24
|
+
const result = await channelPaymentsApi.getMerchant();
|
|
25
|
+
console.log('Merchant', result);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
@@ -120,7 +120,7 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
120
120
|
* Retrieve all child merchants of the merchant associated with the user making the request.
|
|
121
121
|
* Find child merchants
|
|
122
122
|
*/
|
|
123
|
-
getChildMerchants(): Promise<MerchantEntity
|
|
123
|
+
getChildMerchants(): Promise<Array<MerchantEntity>>;
|
|
124
124
|
/**
|
|
125
125
|
* Retrieve the merchant associated with the user making the request.
|
|
126
126
|
* Find merchant
|
|
@@ -359,7 +359,7 @@ class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
359
359
|
});
|
|
360
360
|
let response;
|
|
361
361
|
if (rawResponse.status === 200) {
|
|
362
|
-
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (
|
|
362
|
+
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => jsonValue.map(models_1.MerchantEntityFromJSON));
|
|
363
363
|
}
|
|
364
364
|
if (rawResponse.status === 401) {
|
|
365
365
|
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
@@ -120,7 +120,7 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
120
120
|
* Retrieve all child merchants of the merchant associated with the user making the request.
|
|
121
121
|
* Find child merchants
|
|
122
122
|
*/
|
|
123
|
-
getChildMerchants(): Promise<MerchantEntity
|
|
123
|
+
getChildMerchants(): Promise<Array<MerchantEntity>>;
|
|
124
124
|
/**
|
|
125
125
|
* Retrieve the merchant associated with the user making the request.
|
|
126
126
|
* Find merchant
|
|
@@ -311,7 +311,7 @@ export class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
311
311
|
});
|
|
312
312
|
let response;
|
|
313
313
|
if (rawResponse.status === 200) {
|
|
314
|
-
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => MerchantEntityFromJSON
|
|
314
|
+
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => jsonValue.map(MerchantEntityFromJSON));
|
|
315
315
|
}
|
|
316
316
|
if (rawResponse.status === 401) {
|
|
317
317
|
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|