@payabli/sdk-node 0.0.116 → 0.0.123
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 +31 -2
- package/dist/cjs/BaseClient.d.ts +13 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +88 -88
- package/dist/cjs/Client.js +31 -72
- package/dist/cjs/api/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/errors/ConflictError.js +5 -1
- package/dist/cjs/api/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/errors/ServiceUnavailableError.js +5 -1
- package/dist/cjs/api/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/bill/client/Client.d.ts +34 -35
- package/dist/cjs/api/resources/bill/client/Client.js +69 -216
- package/dist/cjs/api/resources/boarding/client/Client.d.ts +28 -29
- package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
- package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +18 -17
- package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
- package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +8 -9
- package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
- package/dist/cjs/api/resources/cloud/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
- package/dist/cjs/api/resources/customer/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/customer/client/Client.js +31 -113
- package/dist/cjs/api/resources/export/client/Client.d.ts +94 -91
- package/dist/cjs/api/resources/export/client/Client.js +205 -582
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +12 -13
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
- package/dist/cjs/api/resources/import/client/Client.d.ts +12 -13
- package/dist/cjs/api/resources/import/client/Client.js +19 -62
- package/dist/cjs/api/resources/invoice/client/Client.d.ts +37 -36
- package/dist/cjs/api/resources/invoice/client/Client.js +67 -212
- package/dist/cjs/api/resources/invoice/client/requests/AddInvoiceRequest.d.ts +5 -3
- package/dist/cjs/api/resources/lineItem/client/Client.d.ts +16 -17
- package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
- package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +40 -41
- package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
- package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +5 -1
- package/dist/cjs/api/resources/moneyIn/errors/InvalidTransStatusError.js +5 -1
- package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +44 -28
- package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
- package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
- package/dist/cjs/api/resources/notification/client/Client.d.ts +30 -18
- package/dist/cjs/api/resources/notification/client/Client.js +45 -101
- package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
- package/dist/cjs/api/resources/ocr/client/Client.d.ts +14 -11
- package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
- package/dist/cjs/api/resources/organization/client/Client.d.ts +20 -21
- package/dist/cjs/api/resources/organization/client/Client.js +35 -130
- package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +27 -28
- package/dist/cjs/api/resources/paymentLink/client/Client.js +46 -167
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataBill.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataOut.d.ts +1 -1
- package/dist/cjs/api/resources/paymentLink/types/PaymentPageRequestBody.d.ts +2 -2
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +20 -21
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
- package/dist/cjs/api/resources/paypoint/client/Client.d.ts +23 -24
- package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
- package/dist/cjs/api/resources/query/client/Client.d.ts +72 -73
- package/dist/cjs/api/resources/query/client/Client.js +137 -572
- package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
- package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
- package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/statistic/client/Client.d.ts +51 -52
- package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
- package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
- package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
- package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/statistic/types/index.js +1 -0
- package/dist/cjs/api/resources/subscription/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
- package/dist/cjs/api/resources/templates/client/Client.d.ts +16 -17
- package/dist/cjs/api/resources/templates/client/Client.js +28 -84
- package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
- package/dist/cjs/api/resources/tokenStorage/types/GetMethodResponse.d.ts +1 -1
- package/dist/cjs/api/resources/user/client/Client.d.ts +55 -34
- package/dist/cjs/api/resources/user/client/Client.js +84 -222
- package/dist/cjs/api/resources/vendor/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
- package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
- package/dist/cjs/api/types/Frequency.d.ts +1 -1
- package/dist/cjs/api/types/Frequency.js +1 -1
- package/dist/cjs/api/types/FrequencyList.d.ts +1 -1
- package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
- package/dist/cjs/api/types/NotificationContent.js +1 -0
- package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
- package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
- package/dist/cjs/api/types/PayorDataResponse.d.ts +1 -1
- package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +16 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
- package/dist/cjs/core/fetcher/Fetcher.js +42 -24
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/core/logging/logger.js +1 -1
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/errors/PayabliError.js +5 -1
- package/dist/cjs/errors/PayabliTimeoutError.js +5 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +13 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +88 -88
- package/dist/esm/Client.mjs +59 -67
- package/dist/esm/api/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/errors/ConflictError.mjs +5 -1
- package/dist/esm/api/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/errors/ServiceUnavailableError.mjs +5 -1
- package/dist/esm/api/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/bill/client/Client.d.mts +34 -35
- package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
- package/dist/esm/api/resources/boarding/client/Client.d.mts +28 -29
- package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
- package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +18 -17
- package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
- package/dist/esm/api/resources/checkCapture/client/Client.d.mts +8 -9
- package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
- package/dist/esm/api/resources/cloud/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
- package/dist/esm/api/resources/customer/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
- package/dist/esm/api/resources/export/client/Client.d.mts +94 -91
- package/dist/esm/api/resources/export/client/Client.mjs +204 -581
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +12 -13
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
- package/dist/esm/api/resources/import/client/Client.d.mts +12 -13
- package/dist/esm/api/resources/import/client/Client.mjs +17 -60
- package/dist/esm/api/resources/invoice/client/Client.d.mts +37 -36
- package/dist/esm/api/resources/invoice/client/Client.mjs +65 -210
- package/dist/esm/api/resources/invoice/client/requests/AddInvoiceRequest.d.mts +5 -3
- package/dist/esm/api/resources/lineItem/client/Client.d.mts +16 -17
- package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
- package/dist/esm/api/resources/moneyIn/client/Client.d.mts +40 -41
- package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
- package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +5 -1
- package/dist/esm/api/resources/moneyIn/errors/InvalidTransStatusError.mjs +5 -1
- package/dist/esm/api/resources/moneyOut/client/Client.d.mts +44 -28
- package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
- package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
- package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
- package/dist/esm/api/resources/notification/client/Client.d.mts +30 -18
- package/dist/esm/api/resources/notification/client/Client.mjs +44 -100
- package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
- package/dist/esm/api/resources/ocr/client/Client.d.mts +14 -11
- package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
- package/dist/esm/api/resources/organization/client/Client.d.mts +20 -21
- package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
- package/dist/esm/api/resources/paymentLink/client/Client.d.mts +27 -28
- package/dist/esm/api/resources/paymentLink/client/Client.mjs +44 -165
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataBill.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataOut.d.mts +1 -1
- package/dist/esm/api/resources/paymentLink/types/PaymentPageRequestBody.d.mts +2 -2
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +20 -21
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
- package/dist/esm/api/resources/paypoint/client/Client.d.mts +23 -24
- package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
- package/dist/esm/api/resources/query/client/Client.d.mts +72 -73
- package/dist/esm/api/resources/query/client/Client.mjs +136 -571
- package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
- package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
- package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
- package/dist/esm/api/resources/statistic/client/Client.d.mts +51 -52
- package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
- package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
- package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
- package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
- package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
- package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
- package/dist/esm/api/resources/subscription/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
- package/dist/esm/api/resources/templates/client/Client.d.mts +16 -17
- package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
- package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
- package/dist/esm/api/resources/tokenStorage/types/GetMethodResponse.d.mts +1 -1
- package/dist/esm/api/resources/user/client/Client.d.mts +55 -34
- package/dist/esm/api/resources/user/client/Client.mjs +83 -221
- package/dist/esm/api/resources/vendor/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
- package/dist/esm/api/resources/wallet/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
- package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
- package/dist/esm/api/types/Frequency.d.mts +1 -1
- package/dist/esm/api/types/Frequency.mjs +1 -1
- package/dist/esm/api/types/FrequencyList.d.mts +1 -1
- package/dist/esm/api/types/NotificationContent.d.mts +1 -0
- package/dist/esm/api/types/NotificationContent.mjs +1 -0
- package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
- package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
- package/dist/esm/api/types/PayorDataResponse.d.mts +1 -1
- package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
- package/dist/esm/auth/HeaderAuthProvider.d.mts +16 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/logging/logger.mjs +1 -1
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/errors/PayabliError.mjs +5 -1
- package/dist/esm/errors/PayabliTimeoutError.mjs +5 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +5 -2
- package/reference.md +768 -478
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -8,20 +8,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
12
13
|
import * as core from "../../../../core/index.mjs";
|
|
13
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
14
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
17
|
import * as Payabli from "../../../index.mjs";
|
|
16
|
-
export class
|
|
17
|
-
constructor(
|
|
18
|
-
this._options =
|
|
18
|
+
export class PaypointClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Gets the basic details for a paypoint.
|
|
22
24
|
*
|
|
23
25
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
24
|
-
* @param {
|
|
26
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
27
|
*
|
|
26
28
|
* @throws {@link Payabli.BadRequestError}
|
|
27
29
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -37,7 +39,8 @@ export class Paypoint {
|
|
|
37
39
|
__getBasicEntry(entry, requestOptions) {
|
|
38
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
41
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
-
const
|
|
42
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
43
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
41
44
|
const _response = yield core.fetcher({
|
|
42
45
|
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, `Paypoint/basic/${core.url.encodePathParam(entry)}`),
|
|
43
46
|
method: "GET",
|
|
@@ -70,28 +73,14 @@ export class Paypoint {
|
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
|
-
|
|
74
|
-
case "non-json":
|
|
75
|
-
throw new errors.PayabliError({
|
|
76
|
-
statusCode: _response.error.statusCode,
|
|
77
|
-
body: _response.error.rawBody,
|
|
78
|
-
rawResponse: _response.rawResponse,
|
|
79
|
-
});
|
|
80
|
-
case "timeout":
|
|
81
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/basic/{entry}.");
|
|
82
|
-
case "unknown":
|
|
83
|
-
throw new errors.PayabliError({
|
|
84
|
-
message: _response.error.errorMessage,
|
|
85
|
-
rawResponse: _response.rawResponse,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
76
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Paypoint/basic/{entry}");
|
|
88
77
|
});
|
|
89
78
|
}
|
|
90
79
|
/**
|
|
91
80
|
* Retrieves the basic details for a paypoint by ID.
|
|
92
81
|
*
|
|
93
|
-
* @param {string}
|
|
94
|
-
* @param {
|
|
82
|
+
* @param {string} IdPaypoint - Paypoint ID. You can find this value by querying `/api/Query/paypoints/{orgId}`
|
|
83
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
84
|
*
|
|
96
85
|
* @throws {@link Payabli.BadRequestError}
|
|
97
86
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -101,15 +90,16 @@ export class Paypoint {
|
|
|
101
90
|
* @example
|
|
102
91
|
* await client.paypoint.getBasicEntryById("198")
|
|
103
92
|
*/
|
|
104
|
-
getBasicEntryById(
|
|
105
|
-
return core.HttpResponsePromise.fromPromise(this.__getBasicEntryById(
|
|
93
|
+
getBasicEntryById(IdPaypoint, requestOptions) {
|
|
94
|
+
return core.HttpResponsePromise.fromPromise(this.__getBasicEntryById(IdPaypoint, requestOptions));
|
|
106
95
|
}
|
|
107
|
-
__getBasicEntryById(
|
|
96
|
+
__getBasicEntryById(IdPaypoint, requestOptions) {
|
|
108
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
98
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
110
|
-
const
|
|
99
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
100
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
111
101
|
const _response = yield core.fetcher({
|
|
112
|
-
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, `Paypoint/basicById/${core.url.encodePathParam(
|
|
102
|
+
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, `Paypoint/basicById/${core.url.encodePathParam(IdPaypoint)}`),
|
|
113
103
|
method: "GET",
|
|
114
104
|
headers: _headers,
|
|
115
105
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -140,21 +130,7 @@ export class Paypoint {
|
|
|
140
130
|
});
|
|
141
131
|
}
|
|
142
132
|
}
|
|
143
|
-
|
|
144
|
-
case "non-json":
|
|
145
|
-
throw new errors.PayabliError({
|
|
146
|
-
statusCode: _response.error.statusCode,
|
|
147
|
-
body: _response.error.rawBody,
|
|
148
|
-
rawResponse: _response.rawResponse,
|
|
149
|
-
});
|
|
150
|
-
case "timeout":
|
|
151
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/basicById/{IdPaypoint}.");
|
|
152
|
-
case "unknown":
|
|
153
|
-
throw new errors.PayabliError({
|
|
154
|
-
message: _response.error.errorMessage,
|
|
155
|
-
rawResponse: _response.rawResponse,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
133
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Paypoint/basicById/{IdPaypoint}");
|
|
158
134
|
});
|
|
159
135
|
}
|
|
160
136
|
/**
|
|
@@ -162,7 +138,7 @@ export class Paypoint {
|
|
|
162
138
|
*
|
|
163
139
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
164
140
|
* @param {Payabli.GetEntryConfigRequest} request
|
|
165
|
-
* @param {
|
|
141
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
166
142
|
*
|
|
167
143
|
* @throws {@link Payabli.BadRequestError}
|
|
168
144
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -183,7 +159,8 @@ export class Paypoint {
|
|
|
183
159
|
if (entrypages != null) {
|
|
184
160
|
_queryParams.entrypages = entrypages;
|
|
185
161
|
}
|
|
186
|
-
const
|
|
162
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
163
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
187
164
|
const _response = yield core.fetcher({
|
|
188
165
|
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, `Paypoint/${core.url.encodePathParam(entry)}`),
|
|
189
166
|
method: "GET",
|
|
@@ -216,21 +193,7 @@ export class Paypoint {
|
|
|
216
193
|
});
|
|
217
194
|
}
|
|
218
195
|
}
|
|
219
|
-
|
|
220
|
-
case "non-json":
|
|
221
|
-
throw new errors.PayabliError({
|
|
222
|
-
statusCode: _response.error.statusCode,
|
|
223
|
-
body: _response.error.rawBody,
|
|
224
|
-
rawResponse: _response.rawResponse,
|
|
225
|
-
});
|
|
226
|
-
case "timeout":
|
|
227
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/{entry}.");
|
|
228
|
-
case "unknown":
|
|
229
|
-
throw new errors.PayabliError({
|
|
230
|
-
message: _response.error.errorMessage,
|
|
231
|
-
rawResponse: _response.rawResponse,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
196
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Paypoint/{entry}");
|
|
234
197
|
});
|
|
235
198
|
}
|
|
236
199
|
/**
|
|
@@ -238,7 +201,7 @@ export class Paypoint {
|
|
|
238
201
|
*
|
|
239
202
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
240
203
|
* @param {string} subdomain - Payment page identifier. The subdomain value is the last portion of the payment page URL. For example, in`https://paypages-sandbox.payabli.com/513823dc10/pay-your-fees-1`, the subdomain is `pay-your-fees-1`.
|
|
241
|
-
* @param {
|
|
204
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
242
205
|
*
|
|
243
206
|
* @throws {@link Payabli.BadRequestError}
|
|
244
207
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -254,7 +217,8 @@ export class Paypoint {
|
|
|
254
217
|
__getPage(entry, subdomain, requestOptions) {
|
|
255
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
219
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
257
|
-
const
|
|
220
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
221
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
258
222
|
const _response = yield core.fetcher({
|
|
259
223
|
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, `Paypoint/${core.url.encodePathParam(entry)}/${core.url.encodePathParam(subdomain)}`),
|
|
260
224
|
method: "GET",
|
|
@@ -287,21 +251,7 @@ export class Paypoint {
|
|
|
287
251
|
});
|
|
288
252
|
}
|
|
289
253
|
}
|
|
290
|
-
|
|
291
|
-
case "non-json":
|
|
292
|
-
throw new errors.PayabliError({
|
|
293
|
-
statusCode: _response.error.statusCode,
|
|
294
|
-
body: _response.error.rawBody,
|
|
295
|
-
rawResponse: _response.rawResponse,
|
|
296
|
-
});
|
|
297
|
-
case "timeout":
|
|
298
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/{entry}/{subdomain}.");
|
|
299
|
-
case "unknown":
|
|
300
|
-
throw new errors.PayabliError({
|
|
301
|
-
message: _response.error.errorMessage,
|
|
302
|
-
rawResponse: _response.rawResponse,
|
|
303
|
-
});
|
|
304
|
-
}
|
|
254
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Paypoint/{entry}/{subdomain}");
|
|
305
255
|
});
|
|
306
256
|
}
|
|
307
257
|
/**
|
|
@@ -309,7 +259,7 @@ export class Paypoint {
|
|
|
309
259
|
*
|
|
310
260
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
311
261
|
* @param {string} subdomain - Payment page identifier. The subdomain value is the last portion of the payment page URL. For example, in`https://paypages-sandbox.payabli.com/513823dc10/pay-your-fees-1`, the subdomain is `pay-your-fees-1`.
|
|
312
|
-
* @param {
|
|
262
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
313
263
|
*
|
|
314
264
|
* @throws {@link Payabli.BadRequestError}
|
|
315
265
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -325,7 +275,8 @@ export class Paypoint {
|
|
|
325
275
|
__removePage(entry, subdomain, requestOptions) {
|
|
326
276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
327
277
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
328
|
-
const
|
|
278
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
279
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
329
280
|
const _response = yield core.fetcher({
|
|
330
281
|
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, `Paypoint/${core.url.encodePathParam(entry)}/${core.url.encodePathParam(subdomain)}`),
|
|
331
282
|
method: "DELETE",
|
|
@@ -361,21 +312,7 @@ export class Paypoint {
|
|
|
361
312
|
});
|
|
362
313
|
}
|
|
363
314
|
}
|
|
364
|
-
|
|
365
|
-
case "non-json":
|
|
366
|
-
throw new errors.PayabliError({
|
|
367
|
-
statusCode: _response.error.statusCode,
|
|
368
|
-
body: _response.error.rawBody,
|
|
369
|
-
rawResponse: _response.rawResponse,
|
|
370
|
-
});
|
|
371
|
-
case "timeout":
|
|
372
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling DELETE /Paypoint/{entry}/{subdomain}.");
|
|
373
|
-
case "unknown":
|
|
374
|
-
throw new errors.PayabliError({
|
|
375
|
-
message: _response.error.errorMessage,
|
|
376
|
-
rawResponse: _response.rawResponse,
|
|
377
|
-
});
|
|
378
|
-
}
|
|
315
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/Paypoint/{entry}/{subdomain}");
|
|
379
316
|
});
|
|
380
317
|
}
|
|
381
318
|
/**
|
|
@@ -383,7 +320,7 @@ export class Paypoint {
|
|
|
383
320
|
*
|
|
384
321
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
385
322
|
* @param {Payabli.FileContent} request
|
|
386
|
-
* @param {
|
|
323
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
387
324
|
*
|
|
388
325
|
* @throws {@link Payabli.BadRequestError}
|
|
389
326
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -399,7 +336,8 @@ export class Paypoint {
|
|
|
399
336
|
__saveLogo(entry, request, requestOptions) {
|
|
400
337
|
return __awaiter(this, void 0, void 0, function* () {
|
|
401
338
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
402
|
-
const
|
|
339
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
340
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
403
341
|
const _response = yield core.fetcher({
|
|
404
342
|
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, `Paypoint/logo/${core.url.encodePathParam(entry)}`),
|
|
405
343
|
method: "PUT",
|
|
@@ -438,28 +376,14 @@ export class Paypoint {
|
|
|
438
376
|
});
|
|
439
377
|
}
|
|
440
378
|
}
|
|
441
|
-
|
|
442
|
-
case "non-json":
|
|
443
|
-
throw new errors.PayabliError({
|
|
444
|
-
statusCode: _response.error.statusCode,
|
|
445
|
-
body: _response.error.rawBody,
|
|
446
|
-
rawResponse: _response.rawResponse,
|
|
447
|
-
});
|
|
448
|
-
case "timeout":
|
|
449
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /Paypoint/logo/{entry}.");
|
|
450
|
-
case "unknown":
|
|
451
|
-
throw new errors.PayabliError({
|
|
452
|
-
message: _response.error.errorMessage,
|
|
453
|
-
rawResponse: _response.rawResponse,
|
|
454
|
-
});
|
|
455
|
-
}
|
|
379
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/Paypoint/logo/{entry}");
|
|
456
380
|
});
|
|
457
381
|
}
|
|
458
382
|
/**
|
|
459
383
|
* Retrieves an paypoint's basic settings like custom fields, identifiers, and invoicing settings.
|
|
460
384
|
*
|
|
461
385
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
462
|
-
* @param {
|
|
386
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
463
387
|
*
|
|
464
388
|
* @throws {@link Payabli.BadRequestError}
|
|
465
389
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -475,7 +399,8 @@ export class Paypoint {
|
|
|
475
399
|
__settingsPage(entry, requestOptions) {
|
|
476
400
|
return __awaiter(this, void 0, void 0, function* () {
|
|
477
401
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
478
|
-
const
|
|
402
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
403
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
479
404
|
const _response = yield core.fetcher({
|
|
480
405
|
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, `Paypoint/settings/${core.url.encodePathParam(entry)}`),
|
|
481
406
|
method: "GET",
|
|
@@ -508,28 +433,14 @@ export class Paypoint {
|
|
|
508
433
|
});
|
|
509
434
|
}
|
|
510
435
|
}
|
|
511
|
-
|
|
512
|
-
case "non-json":
|
|
513
|
-
throw new errors.PayabliError({
|
|
514
|
-
statusCode: _response.error.statusCode,
|
|
515
|
-
body: _response.error.rawBody,
|
|
516
|
-
rawResponse: _response.rawResponse,
|
|
517
|
-
});
|
|
518
|
-
case "timeout":
|
|
519
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/settings/{entry}.");
|
|
520
|
-
case "unknown":
|
|
521
|
-
throw new errors.PayabliError({
|
|
522
|
-
message: _response.error.errorMessage,
|
|
523
|
-
rawResponse: _response.rawResponse,
|
|
524
|
-
});
|
|
525
|
-
}
|
|
436
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Paypoint/settings/{entry}");
|
|
526
437
|
});
|
|
527
438
|
}
|
|
528
439
|
/**
|
|
529
440
|
* Migrates a paypoint to a new parent organization.
|
|
530
441
|
*
|
|
531
442
|
* @param {Payabli.PaypointMoveRequest} request
|
|
532
|
-
* @param {
|
|
443
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
533
444
|
*
|
|
534
445
|
* @throws {@link Payabli.BadRequestError}
|
|
535
446
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -555,7 +466,8 @@ export class Paypoint {
|
|
|
555
466
|
__migrate(request, requestOptions) {
|
|
556
467
|
return __awaiter(this, void 0, void 0, function* () {
|
|
557
468
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
558
|
-
const
|
|
469
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
470
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
559
471
|
const _response = yield core.fetcher({
|
|
560
472
|
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, "Paypoint/migrate"),
|
|
561
473
|
method: "POST",
|
|
@@ -591,27 +503,7 @@ export class Paypoint {
|
|
|
591
503
|
});
|
|
592
504
|
}
|
|
593
505
|
}
|
|
594
|
-
|
|
595
|
-
case "non-json":
|
|
596
|
-
throw new errors.PayabliError({
|
|
597
|
-
statusCode: _response.error.statusCode,
|
|
598
|
-
body: _response.error.rawBody,
|
|
599
|
-
rawResponse: _response.rawResponse,
|
|
600
|
-
});
|
|
601
|
-
case "timeout":
|
|
602
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /Paypoint/migrate.");
|
|
603
|
-
case "unknown":
|
|
604
|
-
throw new errors.PayabliError({
|
|
605
|
-
message: _response.error.errorMessage,
|
|
606
|
-
rawResponse: _response.rawResponse,
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
_getCustomAuthorizationHeaders() {
|
|
612
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
613
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
614
|
-
return { requestToken: apiKeyValue };
|
|
506
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/Paypoint/migrate");
|
|
615
507
|
});
|
|
616
508
|
}
|
|
617
509
|
}
|