@payabli/sdk-node 0.0.134 → 0.0.136
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 +13 -13
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +52 -42
- package/dist/cjs/api/resources/ghostCard/client/Client.d.ts +67 -0
- package/dist/cjs/api/resources/ghostCard/client/Client.js +201 -0
- package/dist/cjs/api/resources/ghostCard/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/ghostCard/client/index.js +17 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.ts +53 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.js +3 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.ts +14 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.js +3 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/ghostCard/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/ghostCard/exports.d.ts +2 -0
- package/dist/cjs/api/resources/ghostCard/exports.js +21 -0
- package/dist/cjs/api/resources/ghostCard/index.d.ts +2 -0
- package/dist/cjs/api/resources/ghostCard/index.js +18 -0
- package/dist/cjs/api/resources/ghostCard/types/CardStatus.d.ts +8 -0
- package/dist/cjs/api/resources/ghostCard/types/CardStatus.js +11 -0
- package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.d.ts +17 -0
- package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.js +3 -0
- package/dist/cjs/api/resources/ghostCard/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/ghostCard/types/index.js +18 -0
- package/dist/cjs/api/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/index.js +7 -1
- package/dist/cjs/api/resources/payoutSubscription/client/Client.d.ts +156 -0
- package/dist/cjs/api/resources/payoutSubscription/client/Client.js +385 -0
- package/dist/cjs/api/resources/payoutSubscription/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/payoutSubscription/client/index.js +17 -0
- package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.ts +67 -0
- package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/payoutSubscription/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/payoutSubscription/exports.d.ts +2 -0
- package/dist/cjs/api/resources/payoutSubscription/exports.js +21 -0
- package/dist/cjs/api/resources/payoutSubscription/index.d.ts +2 -0
- package/dist/cjs/api/resources/payoutSubscription/index.js +18 -0
- package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.ts +20 -0
- package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.ts +14 -0
- package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.ts +151 -0
- package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.ts +31 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.ts +9 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.d.ts +4 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.ts +195 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.ts +195 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.ts +69 -0
- package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.ts +155 -0
- package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.ts +9 -0
- package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.ts +15 -0
- package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.js +3 -0
- package/dist/cjs/api/resources/payoutSubscription/types/index.d.ts +12 -0
- package/dist/cjs/api/resources/payoutSubscription/types/index.js +28 -0
- package/dist/cjs/api/resources/query/client/Client.d.ts +46 -6
- package/dist/cjs/api/resources/query/client/Client.js +150 -6
- package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.ts +84 -0
- package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.js +3 -0
- package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.ts +84 -0
- package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.js +3 -0
- package/dist/cjs/api/resources/query/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/NotificationStandardRequest.d.ts +0 -31
- package/dist/cjs/api/types/NotificationStandardRequest.js +0 -31
- package/dist/cjs/api/types/Remitaddress1.d.ts +1 -1
- package/dist/cjs/api/types/Remitaddress2.d.ts +1 -1
- package/dist/cjs/api/types/Remitcity.d.ts +1 -1
- package/dist/cjs/api/types/Remitcountry.d.ts +1 -1
- package/dist/cjs/api/types/Remitstate.d.ts +1 -1
- package/dist/cjs/api/types/Remitzip.d.ts +1 -1
- package/dist/cjs/api/types/VendorData.d.ts +6 -6
- package/dist/cjs/api/types/VendorEin.d.ts +1 -1
- package/dist/cjs/api/types/VendorName1.d.ts +1 -1
- package/dist/cjs/api/types/VendorName2.d.ts +1 -1
- package/dist/cjs/api/types/VendorNumber.d.ts +1 -1
- package/dist/cjs/api/types/VendorOutData.d.ts +9 -9
- package/dist/cjs/api/types/VendorQueryRecord.d.ts +1 -1
- package/dist/cjs/api/types/Vendorstatus.d.ts +5 -3
- package/dist/cjs/core/file/file.js +3 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/ghostCard/client/Client.d.mts +67 -0
- package/dist/esm/api/resources/ghostCard/client/Client.mjs +164 -0
- package/dist/esm/api/resources/ghostCard/client/index.d.mts +1 -0
- package/dist/esm/api/resources/ghostCard/client/index.mjs +1 -0
- package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.mts +53 -0
- package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.mjs +2 -0
- package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.mts +14 -0
- package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.mjs +2 -0
- package/dist/esm/api/resources/ghostCard/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/ghostCard/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/ghostCard/exports.d.mts +2 -0
- package/dist/esm/api/resources/ghostCard/exports.mjs +3 -0
- package/dist/esm/api/resources/ghostCard/index.d.mts +2 -0
- package/dist/esm/api/resources/ghostCard/index.mjs +2 -0
- package/dist/esm/api/resources/ghostCard/types/CardStatus.d.mts +8 -0
- package/dist/esm/api/resources/ghostCard/types/CardStatus.mjs +8 -0
- package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.d.mts +17 -0
- package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.mjs +2 -0
- package/dist/esm/api/resources/ghostCard/types/index.d.mts +2 -0
- package/dist/esm/api/resources/ghostCard/types/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/index.mjs +6 -0
- package/dist/esm/api/resources/payoutSubscription/client/Client.d.mts +156 -0
- package/dist/esm/api/resources/payoutSubscription/client/Client.mjs +348 -0
- package/dist/esm/api/resources/payoutSubscription/client/index.d.mts +1 -0
- package/dist/esm/api/resources/payoutSubscription/client/index.mjs +1 -0
- package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.mts +67 -0
- package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/payoutSubscription/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/payoutSubscription/exports.d.mts +2 -0
- package/dist/esm/api/resources/payoutSubscription/exports.mjs +3 -0
- package/dist/esm/api/resources/payoutSubscription/index.d.mts +2 -0
- package/dist/esm/api/resources/payoutSubscription/index.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.mts +20 -0
- package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.mts +14 -0
- package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.mts +151 -0
- package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.mts +31 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.mts +9 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.d.mts +4 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.mts +195 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.mts +195 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.mts +69 -0
- package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.mts +155 -0
- package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.mts +9 -0
- package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.mts +15 -0
- package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.mjs +2 -0
- package/dist/esm/api/resources/payoutSubscription/types/index.d.mts +12 -0
- package/dist/esm/api/resources/payoutSubscription/types/index.mjs +12 -0
- package/dist/esm/api/resources/query/client/Client.d.mts +46 -6
- package/dist/esm/api/resources/query/client/Client.mjs +150 -6
- package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.mts +84 -0
- package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.mjs +2 -0
- package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.mts +84 -0
- package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.mjs +2 -0
- package/dist/esm/api/resources/query/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/NotificationStandardRequest.d.mts +0 -31
- package/dist/esm/api/types/NotificationStandardRequest.mjs +0 -31
- package/dist/esm/api/types/Remitaddress1.d.mts +1 -1
- package/dist/esm/api/types/Remitaddress2.d.mts +1 -1
- package/dist/esm/api/types/Remitcity.d.mts +1 -1
- package/dist/esm/api/types/Remitcountry.d.mts +1 -1
- package/dist/esm/api/types/Remitstate.d.mts +1 -1
- package/dist/esm/api/types/Remitzip.d.mts +1 -1
- package/dist/esm/api/types/VendorData.d.mts +6 -6
- package/dist/esm/api/types/VendorEin.d.mts +1 -1
- package/dist/esm/api/types/VendorName1.d.mts +1 -1
- package/dist/esm/api/types/VendorName2.d.mts +1 -1
- package/dist/esm/api/types/VendorNumber.d.mts +1 -1
- package/dist/esm/api/types/VendorOutData.d.mts +9 -9
- package/dist/esm/api/types/VendorQueryRecord.d.mts +1 -1
- package/dist/esm/api/types/Vendorstatus.d.mts +5 -3
- package/dist/esm/core/file/file.mjs +3 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +29 -7
- package/reference.md +682 -78
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ The Payabli TypeScript library provides convenient access to the Payabli APIs fr
|
|
|
11
11
|
- [Installation](#installation)
|
|
12
12
|
- [Reference](#reference)
|
|
13
13
|
- [Usage](#usage)
|
|
14
|
+
- [Environments](#environments)
|
|
14
15
|
- [Request and Response Types](#request-and-response-types)
|
|
15
16
|
- [Exception Handling](#exception-handling)
|
|
16
17
|
- [File Uploads](#file-uploads)
|
|
@@ -73,6 +74,18 @@ await client.moneyIn.getpaid({
|
|
|
73
74
|
});
|
|
74
75
|
```
|
|
75
76
|
|
|
77
|
+
## Environments
|
|
78
|
+
|
|
79
|
+
This SDK allows you to configure different environments for API requests.
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node";
|
|
83
|
+
|
|
84
|
+
const client = new PayabliClient({
|
|
85
|
+
environment: PayabliEnvironment.Sandbox,
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
76
89
|
## Request and Response Types
|
|
77
90
|
|
|
78
91
|
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
@@ -346,19 +359,6 @@ The SDK works in the following runtimes:
|
|
|
346
359
|
- Bun 1.0+
|
|
347
360
|
- React Native
|
|
348
361
|
|
|
349
|
-
### Customizing Fetch Client
|
|
350
|
-
|
|
351
|
-
The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
352
|
-
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
353
|
-
|
|
354
|
-
```typescript
|
|
355
|
-
import { PayabliClient } from "@payabli/sdk-node";
|
|
356
|
-
|
|
357
|
-
const client = new PayabliClient({
|
|
358
|
-
...
|
|
359
|
-
fetcher: // provide your implementation here
|
|
360
|
-
});
|
|
361
|
-
```
|
|
362
362
|
|
|
363
363
|
## Contributing
|
|
364
364
|
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@payabli/sdk-node",
|
|
46
|
-
"X-Fern-SDK-Version": "0.0.
|
|
47
|
-
"User-Agent": "@payabli/sdk-node/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.136",
|
|
47
|
+
"User-Agent": "@payabli/sdk-node/0.0.136",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CheckCaptureClient } from "./api/resources/checkCapture/client/Client.j
|
|
|
5
5
|
import { CloudClient } from "./api/resources/cloud/client/Client.js";
|
|
6
6
|
import { CustomerClient } from "./api/resources/customer/client/Client.js";
|
|
7
7
|
import { ExportClient } from "./api/resources/export/client/Client.js";
|
|
8
|
+
import { GhostCardClient } from "./api/resources/ghostCard/client/Client.js";
|
|
8
9
|
import { HostedPaymentPagesClient } from "./api/resources/hostedPaymentPages/client/Client.js";
|
|
9
10
|
import { ImportClient } from "./api/resources/import/client/Client.js";
|
|
10
11
|
import { InvoiceClient } from "./api/resources/invoice/client/Client.js";
|
|
@@ -17,6 +18,7 @@ import { OcrClient } from "./api/resources/ocr/client/Client.js";
|
|
|
17
18
|
import { OrganizationClient } from "./api/resources/organization/client/Client.js";
|
|
18
19
|
import { PaymentLinkClient } from "./api/resources/paymentLink/client/Client.js";
|
|
19
20
|
import { PaymentMethodDomainClient } from "./api/resources/paymentMethodDomain/client/Client.js";
|
|
21
|
+
import { PayoutSubscriptionClient } from "./api/resources/payoutSubscription/client/Client.js";
|
|
20
22
|
import { PaypointClient } from "./api/resources/paypoint/client/Client.js";
|
|
21
23
|
import { QueryClient } from "./api/resources/query/client/Client.js";
|
|
22
24
|
import { StatisticClient } from "./api/resources/statistic/client/Client.js";
|
|
@@ -43,6 +45,7 @@ export declare class PayabliClient {
|
|
|
43
45
|
protected _cloud: CloudClient | undefined;
|
|
44
46
|
protected _customer: CustomerClient | undefined;
|
|
45
47
|
protected _export: ExportClient | undefined;
|
|
48
|
+
protected _ghostCard: GhostCardClient | undefined;
|
|
46
49
|
protected _hostedPaymentPages: HostedPaymentPagesClient | undefined;
|
|
47
50
|
protected _import: ImportClient | undefined;
|
|
48
51
|
protected _invoice: InvoiceClient | undefined;
|
|
@@ -55,6 +58,7 @@ export declare class PayabliClient {
|
|
|
55
58
|
protected _organization: OrganizationClient | undefined;
|
|
56
59
|
protected _paymentLink: PaymentLinkClient | undefined;
|
|
57
60
|
protected _paymentMethodDomain: PaymentMethodDomainClient | undefined;
|
|
61
|
+
protected _payoutSubscription: PayoutSubscriptionClient | undefined;
|
|
58
62
|
protected _paypoint: PaypointClient | undefined;
|
|
59
63
|
protected _query: QueryClient | undefined;
|
|
60
64
|
protected _statistic: StatisticClient | undefined;
|
|
@@ -72,6 +76,7 @@ export declare class PayabliClient {
|
|
|
72
76
|
get cloud(): CloudClient;
|
|
73
77
|
get customer(): CustomerClient;
|
|
74
78
|
get export(): ExportClient;
|
|
79
|
+
get ghostCard(): GhostCardClient;
|
|
75
80
|
get hostedPaymentPages(): HostedPaymentPagesClient;
|
|
76
81
|
get import(): ImportClient;
|
|
77
82
|
get invoice(): InvoiceClient;
|
|
@@ -84,6 +89,7 @@ export declare class PayabliClient {
|
|
|
84
89
|
get organization(): OrganizationClient;
|
|
85
90
|
get paymentLink(): PaymentLinkClient;
|
|
86
91
|
get paymentMethodDomain(): PaymentMethodDomainClient;
|
|
92
|
+
get payoutSubscription(): PayoutSubscriptionClient;
|
|
87
93
|
get paypoint(): PaypointClient;
|
|
88
94
|
get query(): QueryClient;
|
|
89
95
|
get statistic(): StatisticClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -51,27 +51,29 @@ const Client_js_4 = require("./api/resources/checkCapture/client/Client.js");
|
|
|
51
51
|
const Client_js_5 = require("./api/resources/cloud/client/Client.js");
|
|
52
52
|
const Client_js_6 = require("./api/resources/customer/client/Client.js");
|
|
53
53
|
const Client_js_7 = require("./api/resources/export/client/Client.js");
|
|
54
|
-
const Client_js_8 = require("./api/resources/
|
|
55
|
-
const Client_js_9 = require("./api/resources/
|
|
56
|
-
const Client_js_10 = require("./api/resources/
|
|
57
|
-
const Client_js_11 = require("./api/resources/
|
|
58
|
-
const Client_js_12 = require("./api/resources/
|
|
59
|
-
const Client_js_13 = require("./api/resources/
|
|
60
|
-
const Client_js_14 = require("./api/resources/
|
|
61
|
-
const Client_js_15 = require("./api/resources/
|
|
62
|
-
const Client_js_16 = require("./api/resources/
|
|
63
|
-
const Client_js_17 = require("./api/resources/
|
|
64
|
-
const Client_js_18 = require("./api/resources/
|
|
65
|
-
const Client_js_19 = require("./api/resources/
|
|
66
|
-
const Client_js_20 = require("./api/resources/
|
|
67
|
-
const Client_js_21 = require("./api/resources/
|
|
68
|
-
const Client_js_22 = require("./api/resources/
|
|
69
|
-
const Client_js_23 = require("./api/resources/
|
|
70
|
-
const Client_js_24 = require("./api/resources/
|
|
71
|
-
const Client_js_25 = require("./api/resources/
|
|
72
|
-
const Client_js_26 = require("./api/resources/
|
|
73
|
-
const Client_js_27 = require("./api/resources/
|
|
74
|
-
const Client_js_28 = require("./api/resources/
|
|
54
|
+
const Client_js_8 = require("./api/resources/ghostCard/client/Client.js");
|
|
55
|
+
const Client_js_9 = require("./api/resources/hostedPaymentPages/client/Client.js");
|
|
56
|
+
const Client_js_10 = require("./api/resources/import/client/Client.js");
|
|
57
|
+
const Client_js_11 = require("./api/resources/invoice/client/Client.js");
|
|
58
|
+
const Client_js_12 = require("./api/resources/lineItem/client/Client.js");
|
|
59
|
+
const Client_js_13 = require("./api/resources/moneyIn/client/Client.js");
|
|
60
|
+
const Client_js_14 = require("./api/resources/moneyOut/client/Client.js");
|
|
61
|
+
const Client_js_15 = require("./api/resources/notification/client/Client.js");
|
|
62
|
+
const Client_js_16 = require("./api/resources/notificationlogs/client/Client.js");
|
|
63
|
+
const Client_js_17 = require("./api/resources/ocr/client/Client.js");
|
|
64
|
+
const Client_js_18 = require("./api/resources/organization/client/Client.js");
|
|
65
|
+
const Client_js_19 = require("./api/resources/paymentLink/client/Client.js");
|
|
66
|
+
const Client_js_20 = require("./api/resources/paymentMethodDomain/client/Client.js");
|
|
67
|
+
const Client_js_21 = require("./api/resources/payoutSubscription/client/Client.js");
|
|
68
|
+
const Client_js_22 = require("./api/resources/paypoint/client/Client.js");
|
|
69
|
+
const Client_js_23 = require("./api/resources/query/client/Client.js");
|
|
70
|
+
const Client_js_24 = require("./api/resources/statistic/client/Client.js");
|
|
71
|
+
const Client_js_25 = require("./api/resources/subscription/client/Client.js");
|
|
72
|
+
const Client_js_26 = require("./api/resources/templates/client/Client.js");
|
|
73
|
+
const Client_js_27 = require("./api/resources/tokenStorage/client/Client.js");
|
|
74
|
+
const Client_js_28 = require("./api/resources/user/client/Client.js");
|
|
75
|
+
const Client_js_29 = require("./api/resources/vendor/client/Client.js");
|
|
76
|
+
const Client_js_30 = require("./api/resources/wallet/client/Client.js");
|
|
75
77
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
76
78
|
const core = __importStar(require("./core/index.js"));
|
|
77
79
|
class PayabliClient {
|
|
@@ -106,89 +108,97 @@ class PayabliClient {
|
|
|
106
108
|
var _a;
|
|
107
109
|
return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new Client_js_7.ExportClient(this._options)));
|
|
108
110
|
}
|
|
111
|
+
get ghostCard() {
|
|
112
|
+
var _a;
|
|
113
|
+
return ((_a = this._ghostCard) !== null && _a !== void 0 ? _a : (this._ghostCard = new Client_js_8.GhostCardClient(this._options)));
|
|
114
|
+
}
|
|
109
115
|
get hostedPaymentPages() {
|
|
110
116
|
var _a;
|
|
111
|
-
return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new
|
|
117
|
+
return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new Client_js_9.HostedPaymentPagesClient(this._options)));
|
|
112
118
|
}
|
|
113
119
|
get import() {
|
|
114
120
|
var _a;
|
|
115
|
-
return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new
|
|
121
|
+
return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new Client_js_10.ImportClient(this._options)));
|
|
116
122
|
}
|
|
117
123
|
get invoice() {
|
|
118
124
|
var _a;
|
|
119
|
-
return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new
|
|
125
|
+
return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new Client_js_11.InvoiceClient(this._options)));
|
|
120
126
|
}
|
|
121
127
|
get lineItem() {
|
|
122
128
|
var _a;
|
|
123
|
-
return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new
|
|
129
|
+
return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new Client_js_12.LineItemClient(this._options)));
|
|
124
130
|
}
|
|
125
131
|
get moneyIn() {
|
|
126
132
|
var _a;
|
|
127
|
-
return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new
|
|
133
|
+
return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new Client_js_13.MoneyInClient(this._options)));
|
|
128
134
|
}
|
|
129
135
|
get moneyOut() {
|
|
130
136
|
var _a;
|
|
131
|
-
return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new
|
|
137
|
+
return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new Client_js_14.MoneyOutClient(this._options)));
|
|
132
138
|
}
|
|
133
139
|
get notification() {
|
|
134
140
|
var _a;
|
|
135
|
-
return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new
|
|
141
|
+
return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new Client_js_15.NotificationClient(this._options)));
|
|
136
142
|
}
|
|
137
143
|
get notificationlogs() {
|
|
138
144
|
var _a;
|
|
139
|
-
return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new
|
|
145
|
+
return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new Client_js_16.NotificationlogsClient(this._options)));
|
|
140
146
|
}
|
|
141
147
|
get ocr() {
|
|
142
148
|
var _a;
|
|
143
|
-
return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new
|
|
149
|
+
return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new Client_js_17.OcrClient(this._options)));
|
|
144
150
|
}
|
|
145
151
|
get organization() {
|
|
146
152
|
var _a;
|
|
147
|
-
return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new
|
|
153
|
+
return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Client_js_18.OrganizationClient(this._options)));
|
|
148
154
|
}
|
|
149
155
|
get paymentLink() {
|
|
150
156
|
var _a;
|
|
151
|
-
return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new
|
|
157
|
+
return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new Client_js_19.PaymentLinkClient(this._options)));
|
|
152
158
|
}
|
|
153
159
|
get paymentMethodDomain() {
|
|
154
160
|
var _a;
|
|
155
|
-
return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new
|
|
161
|
+
return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new Client_js_20.PaymentMethodDomainClient(this._options)));
|
|
162
|
+
}
|
|
163
|
+
get payoutSubscription() {
|
|
164
|
+
var _a;
|
|
165
|
+
return ((_a = this._payoutSubscription) !== null && _a !== void 0 ? _a : (this._payoutSubscription = new Client_js_21.PayoutSubscriptionClient(this._options)));
|
|
156
166
|
}
|
|
157
167
|
get paypoint() {
|
|
158
168
|
var _a;
|
|
159
|
-
return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new
|
|
169
|
+
return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new Client_js_22.PaypointClient(this._options)));
|
|
160
170
|
}
|
|
161
171
|
get query() {
|
|
162
172
|
var _a;
|
|
163
|
-
return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new
|
|
173
|
+
return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Client_js_23.QueryClient(this._options)));
|
|
164
174
|
}
|
|
165
175
|
get statistic() {
|
|
166
176
|
var _a;
|
|
167
|
-
return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new
|
|
177
|
+
return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new Client_js_24.StatisticClient(this._options)));
|
|
168
178
|
}
|
|
169
179
|
get subscription() {
|
|
170
180
|
var _a;
|
|
171
|
-
return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new
|
|
181
|
+
return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new Client_js_25.SubscriptionClient(this._options)));
|
|
172
182
|
}
|
|
173
183
|
get templates() {
|
|
174
184
|
var _a;
|
|
175
|
-
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new
|
|
185
|
+
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_26.TemplatesClient(this._options)));
|
|
176
186
|
}
|
|
177
187
|
get tokenStorage() {
|
|
178
188
|
var _a;
|
|
179
|
-
return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new
|
|
189
|
+
return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new Client_js_27.TokenStorageClient(this._options)));
|
|
180
190
|
}
|
|
181
191
|
get user() {
|
|
182
192
|
var _a;
|
|
183
|
-
return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new
|
|
193
|
+
return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new Client_js_28.UserClient(this._options)));
|
|
184
194
|
}
|
|
185
195
|
get vendor() {
|
|
186
196
|
var _a;
|
|
187
|
-
return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new
|
|
197
|
+
return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new Client_js_29.VendorClient(this._options)));
|
|
188
198
|
}
|
|
189
199
|
get wallet() {
|
|
190
200
|
var _a;
|
|
191
|
-
return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new
|
|
201
|
+
return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new Client_js_30.WalletClient(this._options)));
|
|
192
202
|
}
|
|
193
203
|
/**
|
|
194
204
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as Payabli from "../../../index.js";
|
|
5
|
+
export declare namespace GhostCardClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class GhostCardClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<GhostCardClient.Options>;
|
|
12
|
+
constructor(options?: GhostCardClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Creates a ghost card, a multi-use virtual debit card issued to a vendor for recurring or discretionary spend.
|
|
15
|
+
*
|
|
16
|
+
* Unlike single-use virtual cards issued as part of a payout transaction, ghost cards aren't tied to a specific payout. They're issued directly to a vendor and can be reused up to a configurable number of times within the card's spending limits.
|
|
17
|
+
*
|
|
18
|
+
* @param {Payabli.Entry} entry
|
|
19
|
+
* @param {Payabli.CreateGhostCardRequestBody} request
|
|
20
|
+
* @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
+
*
|
|
22
|
+
* @throws {@link Payabli.BadRequestError}
|
|
23
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
24
|
+
* @throws {@link Payabli.InternalServerError}
|
|
25
|
+
* @throws {@link Payabli.ServiceUnavailableError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.ghostCard.createGhostCard("8cfec2e0fa", {
|
|
29
|
+
* vendorId: 42,
|
|
30
|
+
* expenseLimit: 500,
|
|
31
|
+
* maxNumberOfUses: 3,
|
|
32
|
+
* exactAmount: false,
|
|
33
|
+
* expenseLimitPeriod: "monthly",
|
|
34
|
+
* billingCycle: "monthly",
|
|
35
|
+
* billingCycleDay: "1",
|
|
36
|
+
* dailyTransactionCount: 5,
|
|
37
|
+
* dailyAmountLimit: 200,
|
|
38
|
+
* transactionAmountLimit: 100,
|
|
39
|
+
* mcc: "5411",
|
|
40
|
+
* tcc: "R",
|
|
41
|
+
* misc1: "PO-98765",
|
|
42
|
+
* misc2: "Dept-Finance"
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
createGhostCard(entry: Payabli.Entry, request: Payabli.CreateGhostCardRequestBody, requestOptions?: GhostCardClient.RequestOptions): core.HttpResponsePromise<Payabli.CreateGhostCardResponse>;
|
|
46
|
+
private __createGhostCard;
|
|
47
|
+
/**
|
|
48
|
+
* Updates the status of a virtual card (including ghost cards) under a paypoint.
|
|
49
|
+
*
|
|
50
|
+
* @param {Payabli.Entry} entry
|
|
51
|
+
* @param {Payabli.UpdateCardRequestBody} request
|
|
52
|
+
* @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Payabli.BadRequestError}
|
|
55
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
56
|
+
* @throws {@link Payabli.InternalServerError}
|
|
57
|
+
* @throws {@link Payabli.ServiceUnavailableError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.ghostCard.updateCard("8cfec2e0fa", {
|
|
61
|
+
* cardToken: "gc_abc123def456",
|
|
62
|
+
* status: "Cancelled"
|
|
63
|
+
* })
|
|
64
|
+
*/
|
|
65
|
+
updateCard(entry: Payabli.Entry, request: Payabli.UpdateCardRequestBody, requestOptions?: GhostCardClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponse>;
|
|
66
|
+
private __updateCard;
|
|
67
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.GhostCardClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const Payabli = __importStar(require("../../../index.js"));
|
|
54
|
+
class GhostCardClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates a ghost card, a multi-use virtual debit card issued to a vendor for recurring or discretionary spend.
|
|
60
|
+
*
|
|
61
|
+
* Unlike single-use virtual cards issued as part of a payout transaction, ghost cards aren't tied to a specific payout. They're issued directly to a vendor and can be reused up to a configurable number of times within the card's spending limits.
|
|
62
|
+
*
|
|
63
|
+
* @param {Payabli.Entry} entry
|
|
64
|
+
* @param {Payabli.CreateGhostCardRequestBody} request
|
|
65
|
+
* @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link Payabli.BadRequestError}
|
|
68
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
69
|
+
* @throws {@link Payabli.InternalServerError}
|
|
70
|
+
* @throws {@link Payabli.ServiceUnavailableError}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await client.ghostCard.createGhostCard("8cfec2e0fa", {
|
|
74
|
+
* vendorId: 42,
|
|
75
|
+
* expenseLimit: 500,
|
|
76
|
+
* maxNumberOfUses: 3,
|
|
77
|
+
* exactAmount: false,
|
|
78
|
+
* expenseLimitPeriod: "monthly",
|
|
79
|
+
* billingCycle: "monthly",
|
|
80
|
+
* billingCycleDay: "1",
|
|
81
|
+
* dailyTransactionCount: 5,
|
|
82
|
+
* dailyAmountLimit: 200,
|
|
83
|
+
* transactionAmountLimit: 100,
|
|
84
|
+
* mcc: "5411",
|
|
85
|
+
* tcc: "R",
|
|
86
|
+
* misc1: "PO-98765",
|
|
87
|
+
* misc2: "Dept-Finance"
|
|
88
|
+
* })
|
|
89
|
+
*/
|
|
90
|
+
createGhostCard(entry, request, requestOptions) {
|
|
91
|
+
return core.HttpResponsePromise.fromPromise(this.__createGhostCard(entry, request, requestOptions));
|
|
92
|
+
}
|
|
93
|
+
__createGhostCard(entry, request, requestOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
96
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
97
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
98
|
+
const _response = yield core.fetcher({
|
|
99
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/GhostCard/${core.url.encodePathParam(entry)}`),
|
|
100
|
+
method: "POST",
|
|
101
|
+
headers: _headers,
|
|
102
|
+
contentType: "application/json",
|
|
103
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
104
|
+
requestType: "json",
|
|
105
|
+
body: request,
|
|
106
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
107
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
108
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
109
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
110
|
+
logging: this._options.logging,
|
|
111
|
+
});
|
|
112
|
+
if (_response.ok) {
|
|
113
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
114
|
+
}
|
|
115
|
+
if (_response.error.reason === "status-code") {
|
|
116
|
+
switch (_response.error.statusCode) {
|
|
117
|
+
case 400:
|
|
118
|
+
throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
|
|
119
|
+
case 401:
|
|
120
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
121
|
+
case 500:
|
|
122
|
+
throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
|
|
123
|
+
case 503:
|
|
124
|
+
throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
125
|
+
default:
|
|
126
|
+
throw new errors.PayabliError({
|
|
127
|
+
statusCode: _response.error.statusCode,
|
|
128
|
+
body: _response.error.body,
|
|
129
|
+
rawResponse: _response.rawResponse,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/MoneyOutCard/GhostCard/{entry}");
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Updates the status of a virtual card (including ghost cards) under a paypoint.
|
|
138
|
+
*
|
|
139
|
+
* @param {Payabli.Entry} entry
|
|
140
|
+
* @param {Payabli.UpdateCardRequestBody} request
|
|
141
|
+
* @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @throws {@link Payabli.BadRequestError}
|
|
144
|
+
* @throws {@link Payabli.UnauthorizedError}
|
|
145
|
+
* @throws {@link Payabli.InternalServerError}
|
|
146
|
+
* @throws {@link Payabli.ServiceUnavailableError}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* await client.ghostCard.updateCard("8cfec2e0fa", {
|
|
150
|
+
* cardToken: "gc_abc123def456",
|
|
151
|
+
* status: "Cancelled"
|
|
152
|
+
* })
|
|
153
|
+
*/
|
|
154
|
+
updateCard(entry, request, requestOptions) {
|
|
155
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCard(entry, request, requestOptions));
|
|
156
|
+
}
|
|
157
|
+
__updateCard(entry, request, requestOptions) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
160
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
161
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
162
|
+
const _response = yield core.fetcher({
|
|
163
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/card/${core.url.encodePathParam(entry)}`),
|
|
164
|
+
method: "PATCH",
|
|
165
|
+
headers: _headers,
|
|
166
|
+
contentType: "application/json",
|
|
167
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
168
|
+
requestType: "json",
|
|
169
|
+
body: request,
|
|
170
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
171
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
172
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
173
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
174
|
+
logging: this._options.logging,
|
|
175
|
+
});
|
|
176
|
+
if (_response.ok) {
|
|
177
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
178
|
+
}
|
|
179
|
+
if (_response.error.reason === "status-code") {
|
|
180
|
+
switch (_response.error.statusCode) {
|
|
181
|
+
case 400:
|
|
182
|
+
throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
|
|
183
|
+
case 401:
|
|
184
|
+
throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 500:
|
|
186
|
+
throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
|
|
187
|
+
case 503:
|
|
188
|
+
throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
189
|
+
default:
|
|
190
|
+
throw new errors.PayabliError({
|
|
191
|
+
statusCode: _response.error.statusCode,
|
|
192
|
+
body: _response.error.body,
|
|
193
|
+
rawResponse: _response.rawResponse,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/MoneyOutCard/card/{entry}");
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.GhostCardClient = GhostCardClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* vendorId: 42,
|
|
5
|
+
* expenseLimit: 500,
|
|
6
|
+
* maxNumberOfUses: 3,
|
|
7
|
+
* exactAmount: false,
|
|
8
|
+
* expenseLimitPeriod: "monthly",
|
|
9
|
+
* billingCycle: "monthly",
|
|
10
|
+
* billingCycleDay: "1",
|
|
11
|
+
* dailyTransactionCount: 5,
|
|
12
|
+
* dailyAmountLimit: 200,
|
|
13
|
+
* transactionAmountLimit: 100,
|
|
14
|
+
* mcc: "5411",
|
|
15
|
+
* tcc: "R",
|
|
16
|
+
* misc1: "PO-98765",
|
|
17
|
+
* misc2: "Dept-Finance"
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface CreateGhostCardRequestBody {
|
|
21
|
+
/** ID of the vendor who receives the card. The vendor must belong to the paypoint and have an active status. */
|
|
22
|
+
vendorId: number;
|
|
23
|
+
/** Spending limit for the card. Must be greater than `0` and can't exceed the paypoint's configured payout credit limit. */
|
|
24
|
+
expenseLimit: number;
|
|
25
|
+
/** Requested expiration date for the card. If not provided, defaults to 30 days from creation. */
|
|
26
|
+
expirationDate?: string;
|
|
27
|
+
/** Initial load amount for the card. Defaults to `0`. */
|
|
28
|
+
amount?: number;
|
|
29
|
+
/** Maximum number of times the card can be used. If `0` or negative, defaults to `9999`. Ignored and set to `1` when `exactAmount` is `true`. */
|
|
30
|
+
maxNumberOfUses?: number;
|
|
31
|
+
/** When `true`, restricts the card to a single use. `maxNumberOfUses` is automatically set to `1` regardless of any other value provided. */
|
|
32
|
+
exactAmount?: boolean;
|
|
33
|
+
/** Time period over which `expenseLimit` applies (for example, `monthly` or `weekly`). No server-side enforcement. */
|
|
34
|
+
expenseLimitPeriod?: string;
|
|
35
|
+
/** Billing cycle identifier. */
|
|
36
|
+
billingCycle?: string;
|
|
37
|
+
/** Day within the billing cycle. */
|
|
38
|
+
billingCycleDay?: string;
|
|
39
|
+
/** Maximum number of transactions allowed per day. Defaults to `0` (unlimited). */
|
|
40
|
+
dailyTransactionCount?: number;
|
|
41
|
+
/** Maximum total spend allowed per day. Defaults to `0` (unlimited). */
|
|
42
|
+
dailyAmountLimit?: number;
|
|
43
|
+
/** Maximum spend allowed per single transaction. Defaults to `0` (unlimited). */
|
|
44
|
+
transactionAmountLimit?: number;
|
|
45
|
+
/** Merchant Category Code to restrict where the card can be used. Must be a valid MCC if provided. */
|
|
46
|
+
mcc?: string;
|
|
47
|
+
/** Transaction Category Code to restrict where the card can be used. Must be a valid TCC if provided. */
|
|
48
|
+
tcc?: string;
|
|
49
|
+
/** Custom metadata field. Stored on the card record. */
|
|
50
|
+
misc1?: string;
|
|
51
|
+
/** Custom metadata field. Stored on the card record. */
|
|
52
|
+
misc2?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as Payabli from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* cardToken: "gc_abc123def456",
|
|
6
|
+
* status: "Cancelled"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UpdateCardRequestBody {
|
|
10
|
+
/** Token that uniquely identifies the card. This is the `ReferenceId` returned when the card was created. */
|
|
11
|
+
cardToken: string;
|
|
12
|
+
/** The new status to set on the card. */
|
|
13
|
+
status?: Payabli.CardStatus;
|
|
14
|
+
}
|