@payabli/sdk-node 0.0.108 → 0.0.110
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 +5 -1
- package/dist/cjs/Client.d.ts +2 -2
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/bill/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/boarding/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/chargeBacks/client/requests/ResponseChargeBack.d.ts +1 -2
- package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/cloud/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/customer/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/export/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/import/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/invoice/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/lineItem/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +1 -1
- package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +8 -10
- package/dist/cjs/api/resources/moneyOut/client/Client.js +6 -8
- package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +6 -8
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.d.ts +30 -0
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.js +5 -0
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -10
- package/dist/cjs/api/resources/moneyOutTypes/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/moneyOutTypes/types/index.js +1 -0
- package/dist/cjs/api/resources/notification/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/ocr/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/organization/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/organization/client/requests/AddOrganizationRequest.d.ts +1 -2
- package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/paypoint/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/query/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/query/client/requests/ListTransfersRequest.d.ts +3 -0
- package/dist/cjs/api/resources/query/client/requests/ListVcardsOrgRequest.d.ts +0 -2
- package/dist/cjs/api/resources/query/client/requests/ListVcardsRequest.d.ts +0 -2
- package/dist/cjs/api/resources/queryTypes/types/ListOrganizationsResponse.d.ts +2 -2
- package/dist/cjs/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.ts +7 -7
- package/dist/cjs/api/resources/queryTypes/types/QueryBatchesResponse.d.ts +10 -10
- package/dist/cjs/api/resources/queryTypes/types/QueryTransferDetailResponse.d.ts +72 -72
- package/dist/cjs/api/resources/queryTypes/types/QueryTransferResponse.d.ts +2 -2
- package/dist/cjs/api/resources/queryTypes/types/QueryTransferSummary.d.ts +23 -18
- package/dist/cjs/api/resources/statistic/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/subscription/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/templates/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/user/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/vendor/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +2 -2
- package/dist/cjs/api/types/AdditionalData.d.ts +1 -1
- package/dist/cjs/api/types/BillDetailResponse.d.ts +1 -1
- package/dist/cjs/api/types/BillQueryRecord2.d.ts +37 -38
- package/dist/cjs/api/types/BillQueryResponse.d.ts +8 -8
- package/dist/cjs/api/types/IdempotencyKey.d.ts +1 -1
- package/dist/cjs/api/types/PaymentIdString.d.ts +7 -0
- package/dist/cjs/api/types/PaymentIdString.js +5 -0
- package/dist/cjs/api/types/Paymentid.d.ts +1 -1
- package/dist/cjs/api/types/QueryPayoutTransaction.d.ts +2 -2
- package/dist/cjs/api/types/TransactionOutQueryRecord.d.ts +1 -1
- package/dist/cjs/api/types/Transfer.d.ts +18 -6
- package/dist/cjs/api/types/TransferQueryResponse.d.ts +10 -6
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +34 -2
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +2 -2
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/bill/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/boarding/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/chargeBacks/client/requests/ResponseChargeBack.d.mts +1 -2
- package/dist/esm/api/resources/checkCapture/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/cloud/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/customer/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/export/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/import/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/invoice/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/lineItem/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +1 -1
- package/dist/esm/api/resources/moneyOut/client/Client.d.mts +8 -10
- package/dist/esm/api/resources/moneyOut/client/Client.mjs +6 -8
- package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +6 -8
- package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.d.mts +30 -0
- package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.mjs +4 -0
- package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -10
- package/dist/esm/api/resources/moneyOutTypes/types/index.d.mts +1 -0
- package/dist/esm/api/resources/moneyOutTypes/types/index.mjs +1 -0
- package/dist/esm/api/resources/notification/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/ocr/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/organization/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/organization/client/requests/AddOrganizationRequest.d.mts +1 -2
- package/dist/esm/api/resources/paymentLink/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/paypoint/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/query/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/query/client/requests/ListTransfersRequest.d.mts +3 -0
- package/dist/esm/api/resources/query/client/requests/ListVcardsOrgRequest.d.mts +0 -2
- package/dist/esm/api/resources/query/client/requests/ListVcardsRequest.d.mts +0 -2
- package/dist/esm/api/resources/queryTypes/types/ListOrganizationsResponse.d.mts +2 -2
- package/dist/esm/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.mts +7 -7
- package/dist/esm/api/resources/queryTypes/types/QueryBatchesResponse.d.mts +10 -10
- package/dist/esm/api/resources/queryTypes/types/QueryTransferDetailResponse.d.mts +72 -72
- package/dist/esm/api/resources/queryTypes/types/QueryTransferResponse.d.mts +2 -2
- package/dist/esm/api/resources/queryTypes/types/QueryTransferSummary.d.mts +23 -18
- package/dist/esm/api/resources/statistic/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/subscription/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/templates/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/user/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/vendor/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/wallet/client/Client.d.mts +2 -2
- package/dist/esm/api/types/AdditionalData.d.mts +1 -1
- package/dist/esm/api/types/BillDetailResponse.d.mts +1 -1
- package/dist/esm/api/types/BillQueryRecord2.d.mts +37 -38
- package/dist/esm/api/types/BillQueryResponse.d.mts +8 -8
- package/dist/esm/api/types/IdempotencyKey.d.mts +1 -1
- package/dist/esm/api/types/PaymentIdString.d.mts +7 -0
- package/dist/esm/api/types/PaymentIdString.mjs +4 -0
- package/dist/esm/api/types/Paymentid.d.mts +1 -1
- package/dist/esm/api/types/QueryPayoutTransaction.d.mts +2 -2
- package/dist/esm/api/types/TransactionOutQueryRecord.d.mts +1 -1
- package/dist/esm/api/types/Transfer.d.mts +18 -6
- package/dist/esm/api/types/TransferQueryResponse.d.mts +10 -6
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
- package/dist/esm/core/fetcher/requestWithRetries.mjs +34 -2
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ export interface TransactionOutQueryRecord {
|
|
|
34
34
|
CheckNumber?: string;
|
|
35
35
|
/** Object referencing to paper check image. */
|
|
36
36
|
CheckData?: Payabli.FileContent;
|
|
37
|
-
PaymentId?: Payabli.
|
|
37
|
+
PaymentId?: Payabli.PaymentIdString;
|
|
38
38
|
PaymentData?: Payabli.QueryPaymentData;
|
|
39
39
|
/** Events associated to this transaction. */
|
|
40
40
|
Bills?: Payabli.BillPayOutData[];
|
|
@@ -12,10 +12,14 @@ import * as Payabli from "../index.mjs";
|
|
|
12
12
|
* batchRecords: 1,
|
|
13
13
|
* transferIdentifier: "bbcbfed7-e535-45fe-8d62-000000",
|
|
14
14
|
* batchId: 111430,
|
|
15
|
-
* paypointEntryName: "
|
|
16
|
-
* paypointLegalName: "
|
|
17
|
-
* paypointDbaName: "
|
|
15
|
+
* paypointEntryName: "47ae3de37",
|
|
16
|
+
* paypointLegalName: "Gruzya Outdoor Outfitters LLC",
|
|
17
|
+
* paypointDbaName: "Gruzya Outdoor Outfitters",
|
|
18
18
|
* paypointLogo: "https://example.com/logo.png",
|
|
19
|
+
* parentOrgName: "Pilgrim Planner",
|
|
20
|
+
* parentOrgId: 12345,
|
|
21
|
+
* parentOrgLogo: "https://example.com/parent-logo.png",
|
|
22
|
+
* externalPaypointId: "ext-12345",
|
|
19
23
|
* bankAccount: {
|
|
20
24
|
* accountNumber: "****1234",
|
|
21
25
|
* routingNumber: "123456789"
|
|
@@ -23,15 +27,15 @@ import * as Payabli from "../index.mjs";
|
|
|
23
27
|
* transferDate: "2024-11-17T08:20:07.288+00:00",
|
|
24
28
|
* processor: "gp",
|
|
25
29
|
* transferStatus: 2,
|
|
26
|
-
* grossAmount:
|
|
27
|
-
* chargeBackAmount:
|
|
30
|
+
* grossAmount: 1029,
|
|
31
|
+
* chargeBackAmount: 25,
|
|
28
32
|
* returnedAmount: 0,
|
|
29
33
|
* holdAmount: 0,
|
|
30
34
|
* releasedAmount: 0,
|
|
31
35
|
* billingFeesAmount: 0,
|
|
32
36
|
* thirdPartyPaidAmount: 0,
|
|
33
37
|
* adjustmentsAmount: 0,
|
|
34
|
-
* netTransferAmount:
|
|
38
|
+
* netTransferAmount: 1004,
|
|
35
39
|
* eventsData: [{
|
|
36
40
|
* description: "Transfer Created",
|
|
37
41
|
* eventTime: "2024-11-16T08:15:33.4364067Z",
|
|
@@ -62,6 +66,14 @@ export interface Transfer {
|
|
|
62
66
|
paypointDbaName?: Payabli.Dbaname;
|
|
63
67
|
/** The paypoint logo URL. */
|
|
64
68
|
paypointLogo?: string;
|
|
69
|
+
/** The parent organization name. */
|
|
70
|
+
parentOrgName?: string;
|
|
71
|
+
/** The parent organization ID. */
|
|
72
|
+
parentOrgId?: number;
|
|
73
|
+
/** The parent organization logo URL. */
|
|
74
|
+
parentOrgLogo?: string;
|
|
75
|
+
/** The external paypoint ID. */
|
|
76
|
+
externalPaypointId?: string;
|
|
65
77
|
/** Bank account information for the transfer. */
|
|
66
78
|
bankAccount?: Payabli.TransferBankAccount;
|
|
67
79
|
/** Date when the transfer occurred. */
|
|
@@ -13,10 +13,14 @@ import * as Payabli from "../index.mjs";
|
|
|
13
13
|
* batchRecords: 1,
|
|
14
14
|
* transferIdentifier: "bbcbfed7-e535-45fe-8d62-000000",
|
|
15
15
|
* batchId: 111430,
|
|
16
|
-
* paypointEntryName: "
|
|
17
|
-
* paypointLegalName: "
|
|
18
|
-
* paypointDbaName: "
|
|
16
|
+
* paypointEntryName: "47ae3de37",
|
|
17
|
+
* paypointLegalName: "Gruzya Outdoor Outfitters LLC",
|
|
18
|
+
* paypointDbaName: "Gruzya Outdoor Outfitters",
|
|
19
19
|
* paypointLogo: "https://example.com/logo.png",
|
|
20
|
+
* parentOrgName: "Pilgrim Planner",
|
|
21
|
+
* parentOrgId: 12345,
|
|
22
|
+
* parentOrgLogo: "https://example.com/parent-logo.png",
|
|
23
|
+
* externalPaypointId: "ext-12345",
|
|
20
24
|
* bankAccount: {
|
|
21
25
|
* accountNumber: "****1234",
|
|
22
26
|
* routingNumber: "123456789"
|
|
@@ -24,15 +28,15 @@ import * as Payabli from "../index.mjs";
|
|
|
24
28
|
* transferDate: "2024-11-17T08:20:07.288+00:00",
|
|
25
29
|
* processor: "gp",
|
|
26
30
|
* transferStatus: 2,
|
|
27
|
-
* grossAmount:
|
|
28
|
-
* chargeBackAmount:
|
|
31
|
+
* grossAmount: 1029,
|
|
32
|
+
* chargeBackAmount: 25,
|
|
29
33
|
* returnedAmount: 0,
|
|
30
34
|
* holdAmount: 0,
|
|
31
35
|
* releasedAmount: 0,
|
|
32
36
|
* billingFeesAmount: 0,
|
|
33
37
|
* thirdPartyPaidAmount: 0,
|
|
34
38
|
* adjustmentsAmount: 0,
|
|
35
|
-
* netTransferAmount:
|
|
39
|
+
* netTransferAmount: 1004,
|
|
36
40
|
* eventsData: [{
|
|
37
41
|
* description: "Transfer Created",
|
|
38
42
|
* eventTime: "2024-11-16T08:15:33.4364067Z",
|
|
@@ -353,6 +353,7 @@ export * from "./PaymentCategories.mjs";
|
|
|
353
353
|
export * from "./PaymentDetail.mjs";
|
|
354
354
|
export * from "./PaymentDetailCredit.mjs";
|
|
355
355
|
export * from "./Paymentid.mjs";
|
|
356
|
+
export * from "./PaymentIdString.mjs";
|
|
356
357
|
export * from "./PaymentMethod.mjs";
|
|
357
358
|
export * from "./PayMethodBodyAllFields.mjs";
|
|
358
359
|
export * from "./PayMethodCredit.mjs";
|
|
@@ -353,6 +353,7 @@ export * from "./PaymentCategories.mjs";
|
|
|
353
353
|
export * from "./PaymentDetail.mjs";
|
|
354
354
|
export * from "./PaymentDetailCredit.mjs";
|
|
355
355
|
export * from "./Paymentid.mjs";
|
|
356
|
+
export * from "./PaymentIdString.mjs";
|
|
356
357
|
export * from "./PaymentMethod.mjs";
|
|
357
358
|
export * from "./PayMethodBodyAllFields.mjs";
|
|
358
359
|
export * from "./PayMethodCredit.mjs";
|
|
@@ -6,7 +6,7 @@ export declare namespace Fetcher {
|
|
|
6
6
|
url: string;
|
|
7
7
|
method: string;
|
|
8
8
|
contentType?: string;
|
|
9
|
-
headers?: Record<string, string | Supplier<string | undefined> | undefined>;
|
|
9
|
+
headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
|
|
10
10
|
queryParameters?: Record<string, unknown>;
|
|
11
11
|
body?: unknown;
|
|
12
12
|
timeoutMs?: number;
|
|
@@ -16,13 +16,45 @@ function addJitter(delay) {
|
|
|
16
16
|
const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
|
|
17
17
|
return delay * jitterMultiplier;
|
|
18
18
|
}
|
|
19
|
+
function getRetryDelayFromHeaders(response, retryAttempt) {
|
|
20
|
+
// Check for Retry-After header first (RFC 7231)
|
|
21
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
22
|
+
if (retryAfter) {
|
|
23
|
+
// Parse as number of seconds...
|
|
24
|
+
const retryAfterSeconds = parseInt(retryAfter, 10);
|
|
25
|
+
if (!isNaN(retryAfterSeconds)) {
|
|
26
|
+
// Convert seconds to milliseconds and cap at MAX_RETRY_DELAY
|
|
27
|
+
return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
|
|
28
|
+
}
|
|
29
|
+
// ...or as an HTTP date; both are valid
|
|
30
|
+
const retryAfterDate = new Date(retryAfter);
|
|
31
|
+
if (!isNaN(retryAfterDate.getTime())) {
|
|
32
|
+
const delay = retryAfterDate.getTime() - Date.now();
|
|
33
|
+
return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Then check for industry-standard X-RateLimit-Reset header
|
|
37
|
+
const rateLimitReset = response.headers.get("X-RateLimit-Reset");
|
|
38
|
+
if (rateLimitReset) {
|
|
39
|
+
const resetTime = parseInt(rateLimitReset, 10);
|
|
40
|
+
if (!isNaN(resetTime)) {
|
|
41
|
+
// Assume Unix timestamp in epoch seconds
|
|
42
|
+
const delay = resetTime * 1000 - Date.now();
|
|
43
|
+
if (delay > 0) {
|
|
44
|
+
return Math.min(delay, MAX_RETRY_DELAY);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Fall back to exponential backoff
|
|
49
|
+
return Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY);
|
|
50
|
+
}
|
|
19
51
|
export function requestWithRetries(requestFn_1) {
|
|
20
52
|
return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
|
|
21
53
|
let response = yield requestFn();
|
|
22
54
|
for (let i = 0; i < maxRetries; ++i) {
|
|
23
55
|
if ([408, 429].includes(response.status) || response.status >= 500) {
|
|
24
|
-
//
|
|
25
|
-
const baseDelay =
|
|
56
|
+
// Get delay from headers or fall back to exponential backoff
|
|
57
|
+
const baseDelay = getRetryDelayFromHeaders(response, i);
|
|
26
58
|
// Add jitter to the delay
|
|
27
59
|
const delayWithJitter = addJitter(baseDelay);
|
|
28
60
|
yield new Promise((resolve) => setTimeout(resolve, delayWithJitter));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as core from "./index.mjs";
|
|
2
|
-
export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
|
|
3
|
-
export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
|
|
2
|
+
export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
|
|
3
|
+
export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.110";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.110";
|