@payabli/sdk-node 0.0.116 → 0.0.117
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 +24 -7
- package/dist/cjs/BaseClient.d.ts +10 -1
- package/dist/cjs/BaseClient.js +57 -0
- package/dist/cjs/Client.d.ts +87 -86
- package/dist/cjs/Client.js +31 -72
- package/dist/cjs/api/resources/bill/client/Client.d.ts +33 -33
- package/dist/cjs/api/resources/bill/client/Client.js +69 -216
- package/dist/cjs/api/resources/boarding/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
- package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +17 -15
- package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
- package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
- package/dist/cjs/api/resources/cloud/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
- package/dist/cjs/api/resources/customer/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/customer/client/Client.js +31 -113
- package/dist/cjs/api/resources/export/client/Client.d.ts +93 -89
- package/dist/cjs/api/resources/export/client/Client.js +205 -582
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
- package/dist/cjs/api/resources/import/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/import/client/Client.js +19 -62
- package/dist/cjs/api/resources/invoice/client/Client.d.ts +31 -31
- package/dist/cjs/api/resources/invoice/client/Client.js +62 -209
- package/dist/cjs/api/resources/lineItem/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
- package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +39 -39
- package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
- package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +43 -26
- 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 +16 -16
- package/dist/cjs/api/resources/notification/client/Client.js +32 -101
- package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
- package/dist/cjs/api/resources/ocr/client/Client.d.ts +13 -9
- package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
- package/dist/cjs/api/resources/organization/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/organization/client/Client.js +35 -130
- package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/paymentLink/client/Client.js +43 -164
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
- package/dist/cjs/api/resources/paypoint/client/Client.d.ts +22 -22
- package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
- package/dist/cjs/api/resources/query/client/Client.d.ts +71 -71
- 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 +50 -50
- 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 +13 -13
- package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
- package/dist/cjs/api/resources/templates/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/templates/client/Client.js +28 -84
- package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
- package/dist/cjs/api/resources/user/client/Client.d.ts +54 -32
- package/dist/cjs/api/resources/user/client/Client.js +84 -222
- package/dist/cjs/api/resources/vendor/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +13 -13
- 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/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/QueryResponseSettlements.d.ts +1 -1
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -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/{version.js → core/auth/AuthProvider.js} +0 -2
- 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/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/esm/BaseClient.d.mts +10 -1
- package/dist/esm/BaseClient.mjs +22 -1
- package/dist/esm/Client.d.mts +87 -86
- package/dist/esm/Client.mjs +59 -67
- package/dist/esm/api/resources/bill/client/Client.d.mts +33 -33
- package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
- package/dist/esm/api/resources/boarding/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
- package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +17 -15
- package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
- package/dist/esm/api/resources/checkCapture/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
- package/dist/esm/api/resources/cloud/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
- package/dist/esm/api/resources/customer/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
- package/dist/esm/api/resources/export/client/Client.d.mts +93 -89
- package/dist/esm/api/resources/export/client/Client.mjs +204 -581
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
- package/dist/esm/api/resources/import/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/import/client/Client.mjs +17 -60
- package/dist/esm/api/resources/invoice/client/Client.d.mts +31 -31
- package/dist/esm/api/resources/invoice/client/Client.mjs +60 -207
- package/dist/esm/api/resources/lineItem/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
- package/dist/esm/api/resources/moneyIn/client/Client.d.mts +39 -39
- package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
- package/dist/esm/api/resources/moneyOut/client/Client.d.mts +43 -26
- 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 +16 -16
- package/dist/esm/api/resources/notification/client/Client.mjs +31 -100
- package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
- package/dist/esm/api/resources/ocr/client/Client.d.mts +13 -9
- package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
- package/dist/esm/api/resources/organization/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
- package/dist/esm/api/resources/paymentLink/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/paymentLink/client/Client.mjs +41 -162
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
- package/dist/esm/api/resources/paypoint/client/Client.d.mts +22 -22
- package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
- package/dist/esm/api/resources/query/client/Client.d.mts +71 -71
- 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 +50 -50
- 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 +13 -13
- package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
- package/dist/esm/api/resources/templates/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
- package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
- package/dist/esm/api/resources/user/client/Client.d.mts +54 -32
- package/dist/esm/api/resources/user/client/Client.mjs +83 -221
- package/dist/esm/api/resources/vendor/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
- package/dist/esm/api/resources/wallet/client/Client.d.mts +13 -13
- 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/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/QueryResponseSettlements.d.mts +1 -1
- package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -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/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/package.json +4 -4
- package/reference.md +761 -473
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/cjs/version.d.ts +0 -1
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
- package/dist/esm/version.d.mts +0 -1
- package/dist/esm/version.mjs +0 -1
|
@@ -43,21 +43,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.PaypointClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
50
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
53
|
const Payabli = __importStar(require("../../../index.js"));
|
|
52
|
-
class
|
|
53
|
-
constructor(
|
|
54
|
-
this._options =
|
|
54
|
+
class PaypointClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Gets the basic details for a paypoint.
|
|
58
60
|
*
|
|
59
61
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
60
|
-
* @param {
|
|
62
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
63
|
*
|
|
62
64
|
* @throws {@link Payabli.BadRequestError}
|
|
63
65
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -73,7 +75,8 @@ class Paypoint {
|
|
|
73
75
|
__getBasicEntry(entry, requestOptions) {
|
|
74
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
77
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
76
|
-
const
|
|
78
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
79
|
+
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);
|
|
77
80
|
const _response = yield core.fetcher({
|
|
78
81
|
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)}`),
|
|
79
82
|
method: "GET",
|
|
@@ -106,28 +109,14 @@ class Paypoint {
|
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
|
-
|
|
110
|
-
case "non-json":
|
|
111
|
-
throw new errors.PayabliError({
|
|
112
|
-
statusCode: _response.error.statusCode,
|
|
113
|
-
body: _response.error.rawBody,
|
|
114
|
-
rawResponse: _response.rawResponse,
|
|
115
|
-
});
|
|
116
|
-
case "timeout":
|
|
117
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/basic/{entry}.");
|
|
118
|
-
case "unknown":
|
|
119
|
-
throw new errors.PayabliError({
|
|
120
|
-
message: _response.error.errorMessage,
|
|
121
|
-
rawResponse: _response.rawResponse,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
112
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Paypoint/basic/{entry}");
|
|
124
113
|
});
|
|
125
114
|
}
|
|
126
115
|
/**
|
|
127
116
|
* Retrieves the basic details for a paypoint by ID.
|
|
128
117
|
*
|
|
129
|
-
* @param {string}
|
|
130
|
-
* @param {
|
|
118
|
+
* @param {string} IdPaypoint - Paypoint ID. You can find this value by querying `/api/Query/paypoints/{orgId}`
|
|
119
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
131
120
|
*
|
|
132
121
|
* @throws {@link Payabli.BadRequestError}
|
|
133
122
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -137,15 +126,16 @@ class Paypoint {
|
|
|
137
126
|
* @example
|
|
138
127
|
* await client.paypoint.getBasicEntryById("198")
|
|
139
128
|
*/
|
|
140
|
-
getBasicEntryById(
|
|
141
|
-
return core.HttpResponsePromise.fromPromise(this.__getBasicEntryById(
|
|
129
|
+
getBasicEntryById(IdPaypoint, requestOptions) {
|
|
130
|
+
return core.HttpResponsePromise.fromPromise(this.__getBasicEntryById(IdPaypoint, requestOptions));
|
|
142
131
|
}
|
|
143
|
-
__getBasicEntryById(
|
|
132
|
+
__getBasicEntryById(IdPaypoint, requestOptions) {
|
|
144
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
134
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
146
|
-
const
|
|
135
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
136
|
+
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);
|
|
147
137
|
const _response = yield core.fetcher({
|
|
148
|
-
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(
|
|
138
|
+
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)}`),
|
|
149
139
|
method: "GET",
|
|
150
140
|
headers: _headers,
|
|
151
141
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -176,21 +166,7 @@ class Paypoint {
|
|
|
176
166
|
});
|
|
177
167
|
}
|
|
178
168
|
}
|
|
179
|
-
|
|
180
|
-
case "non-json":
|
|
181
|
-
throw new errors.PayabliError({
|
|
182
|
-
statusCode: _response.error.statusCode,
|
|
183
|
-
body: _response.error.rawBody,
|
|
184
|
-
rawResponse: _response.rawResponse,
|
|
185
|
-
});
|
|
186
|
-
case "timeout":
|
|
187
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/basicById/{IdPaypoint}.");
|
|
188
|
-
case "unknown":
|
|
189
|
-
throw new errors.PayabliError({
|
|
190
|
-
message: _response.error.errorMessage,
|
|
191
|
-
rawResponse: _response.rawResponse,
|
|
192
|
-
});
|
|
193
|
-
}
|
|
169
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Paypoint/basicById/{IdPaypoint}");
|
|
194
170
|
});
|
|
195
171
|
}
|
|
196
172
|
/**
|
|
@@ -198,7 +174,7 @@ class Paypoint {
|
|
|
198
174
|
*
|
|
199
175
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
200
176
|
* @param {Payabli.GetEntryConfigRequest} request
|
|
201
|
-
* @param {
|
|
177
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
202
178
|
*
|
|
203
179
|
* @throws {@link Payabli.BadRequestError}
|
|
204
180
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -219,7 +195,8 @@ class Paypoint {
|
|
|
219
195
|
if (entrypages != null) {
|
|
220
196
|
_queryParams.entrypages = entrypages;
|
|
221
197
|
}
|
|
222
|
-
const
|
|
198
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
199
|
+
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);
|
|
223
200
|
const _response = yield core.fetcher({
|
|
224
201
|
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)}`),
|
|
225
202
|
method: "GET",
|
|
@@ -252,21 +229,7 @@ class Paypoint {
|
|
|
252
229
|
});
|
|
253
230
|
}
|
|
254
231
|
}
|
|
255
|
-
|
|
256
|
-
case "non-json":
|
|
257
|
-
throw new errors.PayabliError({
|
|
258
|
-
statusCode: _response.error.statusCode,
|
|
259
|
-
body: _response.error.rawBody,
|
|
260
|
-
rawResponse: _response.rawResponse,
|
|
261
|
-
});
|
|
262
|
-
case "timeout":
|
|
263
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/{entry}.");
|
|
264
|
-
case "unknown":
|
|
265
|
-
throw new errors.PayabliError({
|
|
266
|
-
message: _response.error.errorMessage,
|
|
267
|
-
rawResponse: _response.rawResponse,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
232
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Paypoint/{entry}");
|
|
270
233
|
});
|
|
271
234
|
}
|
|
272
235
|
/**
|
|
@@ -274,7 +237,7 @@ class Paypoint {
|
|
|
274
237
|
*
|
|
275
238
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
276
239
|
* @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`.
|
|
277
|
-
* @param {
|
|
240
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
278
241
|
*
|
|
279
242
|
* @throws {@link Payabli.BadRequestError}
|
|
280
243
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -290,7 +253,8 @@ class Paypoint {
|
|
|
290
253
|
__getPage(entry, subdomain, requestOptions) {
|
|
291
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
292
255
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
293
|
-
const
|
|
256
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
257
|
+
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);
|
|
294
258
|
const _response = yield core.fetcher({
|
|
295
259
|
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)}`),
|
|
296
260
|
method: "GET",
|
|
@@ -323,21 +287,7 @@ class Paypoint {
|
|
|
323
287
|
});
|
|
324
288
|
}
|
|
325
289
|
}
|
|
326
|
-
|
|
327
|
-
case "non-json":
|
|
328
|
-
throw new errors.PayabliError({
|
|
329
|
-
statusCode: _response.error.statusCode,
|
|
330
|
-
body: _response.error.rawBody,
|
|
331
|
-
rawResponse: _response.rawResponse,
|
|
332
|
-
});
|
|
333
|
-
case "timeout":
|
|
334
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/{entry}/{subdomain}.");
|
|
335
|
-
case "unknown":
|
|
336
|
-
throw new errors.PayabliError({
|
|
337
|
-
message: _response.error.errorMessage,
|
|
338
|
-
rawResponse: _response.rawResponse,
|
|
339
|
-
});
|
|
340
|
-
}
|
|
290
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Paypoint/{entry}/{subdomain}");
|
|
341
291
|
});
|
|
342
292
|
}
|
|
343
293
|
/**
|
|
@@ -345,7 +295,7 @@ class Paypoint {
|
|
|
345
295
|
*
|
|
346
296
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
347
297
|
* @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`.
|
|
348
|
-
* @param {
|
|
298
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
349
299
|
*
|
|
350
300
|
* @throws {@link Payabli.BadRequestError}
|
|
351
301
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -361,7 +311,8 @@ class Paypoint {
|
|
|
361
311
|
__removePage(entry, subdomain, requestOptions) {
|
|
362
312
|
return __awaiter(this, void 0, void 0, function* () {
|
|
363
313
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
364
|
-
const
|
|
314
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
315
|
+
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);
|
|
365
316
|
const _response = yield core.fetcher({
|
|
366
317
|
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)}`),
|
|
367
318
|
method: "DELETE",
|
|
@@ -397,21 +348,7 @@ class Paypoint {
|
|
|
397
348
|
});
|
|
398
349
|
}
|
|
399
350
|
}
|
|
400
|
-
|
|
401
|
-
case "non-json":
|
|
402
|
-
throw new errors.PayabliError({
|
|
403
|
-
statusCode: _response.error.statusCode,
|
|
404
|
-
body: _response.error.rawBody,
|
|
405
|
-
rawResponse: _response.rawResponse,
|
|
406
|
-
});
|
|
407
|
-
case "timeout":
|
|
408
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling DELETE /Paypoint/{entry}/{subdomain}.");
|
|
409
|
-
case "unknown":
|
|
410
|
-
throw new errors.PayabliError({
|
|
411
|
-
message: _response.error.errorMessage,
|
|
412
|
-
rawResponse: _response.rawResponse,
|
|
413
|
-
});
|
|
414
|
-
}
|
|
351
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/Paypoint/{entry}/{subdomain}");
|
|
415
352
|
});
|
|
416
353
|
}
|
|
417
354
|
/**
|
|
@@ -419,7 +356,7 @@ class Paypoint {
|
|
|
419
356
|
*
|
|
420
357
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
421
358
|
* @param {Payabli.FileContent} request
|
|
422
|
-
* @param {
|
|
359
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
423
360
|
*
|
|
424
361
|
* @throws {@link Payabli.BadRequestError}
|
|
425
362
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -435,7 +372,8 @@ class Paypoint {
|
|
|
435
372
|
__saveLogo(entry, request, requestOptions) {
|
|
436
373
|
return __awaiter(this, void 0, void 0, function* () {
|
|
437
374
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
438
|
-
const
|
|
375
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
376
|
+
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);
|
|
439
377
|
const _response = yield core.fetcher({
|
|
440
378
|
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)}`),
|
|
441
379
|
method: "PUT",
|
|
@@ -474,28 +412,14 @@ class Paypoint {
|
|
|
474
412
|
});
|
|
475
413
|
}
|
|
476
414
|
}
|
|
477
|
-
|
|
478
|
-
case "non-json":
|
|
479
|
-
throw new errors.PayabliError({
|
|
480
|
-
statusCode: _response.error.statusCode,
|
|
481
|
-
body: _response.error.rawBody,
|
|
482
|
-
rawResponse: _response.rawResponse,
|
|
483
|
-
});
|
|
484
|
-
case "timeout":
|
|
485
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /Paypoint/logo/{entry}.");
|
|
486
|
-
case "unknown":
|
|
487
|
-
throw new errors.PayabliError({
|
|
488
|
-
message: _response.error.errorMessage,
|
|
489
|
-
rawResponse: _response.rawResponse,
|
|
490
|
-
});
|
|
491
|
-
}
|
|
415
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/Paypoint/logo/{entry}");
|
|
492
416
|
});
|
|
493
417
|
}
|
|
494
418
|
/**
|
|
495
419
|
* Retrieves an paypoint's basic settings like custom fields, identifiers, and invoicing settings.
|
|
496
420
|
*
|
|
497
421
|
* @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
|
|
498
|
-
* @param {
|
|
422
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
499
423
|
*
|
|
500
424
|
* @throws {@link Payabli.BadRequestError}
|
|
501
425
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -511,7 +435,8 @@ class Paypoint {
|
|
|
511
435
|
__settingsPage(entry, requestOptions) {
|
|
512
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
513
437
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
514
|
-
const
|
|
438
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
439
|
+
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);
|
|
515
440
|
const _response = yield core.fetcher({
|
|
516
441
|
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)}`),
|
|
517
442
|
method: "GET",
|
|
@@ -544,28 +469,14 @@ class Paypoint {
|
|
|
544
469
|
});
|
|
545
470
|
}
|
|
546
471
|
}
|
|
547
|
-
|
|
548
|
-
case "non-json":
|
|
549
|
-
throw new errors.PayabliError({
|
|
550
|
-
statusCode: _response.error.statusCode,
|
|
551
|
-
body: _response.error.rawBody,
|
|
552
|
-
rawResponse: _response.rawResponse,
|
|
553
|
-
});
|
|
554
|
-
case "timeout":
|
|
555
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Paypoint/settings/{entry}.");
|
|
556
|
-
case "unknown":
|
|
557
|
-
throw new errors.PayabliError({
|
|
558
|
-
message: _response.error.errorMessage,
|
|
559
|
-
rawResponse: _response.rawResponse,
|
|
560
|
-
});
|
|
561
|
-
}
|
|
472
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Paypoint/settings/{entry}");
|
|
562
473
|
});
|
|
563
474
|
}
|
|
564
475
|
/**
|
|
565
476
|
* Migrates a paypoint to a new parent organization.
|
|
566
477
|
*
|
|
567
478
|
* @param {Payabli.PaypointMoveRequest} request
|
|
568
|
-
* @param {
|
|
479
|
+
* @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
569
480
|
*
|
|
570
481
|
* @throws {@link Payabli.BadRequestError}
|
|
571
482
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -591,7 +502,8 @@ class Paypoint {
|
|
|
591
502
|
__migrate(request, requestOptions) {
|
|
592
503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
593
504
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
594
|
-
const
|
|
505
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
506
|
+
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);
|
|
595
507
|
const _response = yield core.fetcher({
|
|
596
508
|
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"),
|
|
597
509
|
method: "POST",
|
|
@@ -627,28 +539,8 @@ class Paypoint {
|
|
|
627
539
|
});
|
|
628
540
|
}
|
|
629
541
|
}
|
|
630
|
-
|
|
631
|
-
case "non-json":
|
|
632
|
-
throw new errors.PayabliError({
|
|
633
|
-
statusCode: _response.error.statusCode,
|
|
634
|
-
body: _response.error.rawBody,
|
|
635
|
-
rawResponse: _response.rawResponse,
|
|
636
|
-
});
|
|
637
|
-
case "timeout":
|
|
638
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /Paypoint/migrate.");
|
|
639
|
-
case "unknown":
|
|
640
|
-
throw new errors.PayabliError({
|
|
641
|
-
message: _response.error.errorMessage,
|
|
642
|
-
rawResponse: _response.rawResponse,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
_getCustomAuthorizationHeaders() {
|
|
648
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
649
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
650
|
-
return { requestToken: apiKeyValue };
|
|
542
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/Paypoint/migrate");
|
|
651
543
|
});
|
|
652
544
|
}
|
|
653
545
|
}
|
|
654
|
-
exports.
|
|
546
|
+
exports.PaypointClient = PaypointClient;
|