pkg-sdk-test 0.0.14 → 0.0.16
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 +295 -0
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/Client.d.ts +4 -4
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
- package/dist/cjs/api/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
- package/dist/cjs/api/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
- package/dist/cjs/api/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
- package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +1 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +38 -23
- package/dist/cjs/api/resources/payments/client/Client.js +89 -36
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +3 -3
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +3 -2
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.ts +10 -0
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.ts +2 -2
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +24 -23
- package/dist/cjs/api/resources/staticWallets/client/Client.js +59 -39
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.ts +12 -2
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.js +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/staticWallets/index.d.ts +1 -0
- package/dist/cjs/api/resources/staticWallets/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/staticWallets/types/index.js +18 -0
- package/dist/cjs/api/types/CryptopayAssetId.d.ts +32 -0
- package/dist/cjs/api/types/CryptopayAssetId.js +35 -0
- package/dist/cjs/api/types/CryptopayListPaymentsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticDepositsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticWalletsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +6 -6
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +5 -5
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.d.ts +11 -1
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.d.ts +13 -2
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticWalletResponse.d.ts +2 -1
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
- package/dist/cjs/auth/HeaderAuthProvider.js +1 -1
- package/dist/cjs/errors/{SuwardApiError.d.ts → SuwardSDKError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiError.js → SuwardSDKError.js} +4 -4
- package/dist/{esm/errors/SuwardApiTimeoutError.d.mts → cjs/errors/SuwardSDKTimeoutError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiTimeoutError.js → SuwardSDKTimeoutError.js} +4 -4
- package/dist/cjs/errors/handleNonStatusCodeError.js +5 -5
- package/dist/cjs/errors/index.d.ts +2 -2
- package/dist/cjs/errors/index.js +5 -5
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/Client.d.mts +4 -4
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
- package/dist/esm/api/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
- package/dist/esm/api/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
- package/dist/esm/api/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
- package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +38 -23
- package/dist/esm/api/resources/payments/client/Client.mjs +89 -36
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +3 -3
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +3 -2
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.mts +10 -0
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.mts +2 -2
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +24 -23
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +59 -39
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.mts +12 -2
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.mjs +9 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.mts +13 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.mts +7 -0
- package/dist/esm/api/resources/staticWallets/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/staticWallets/index.d.mts +1 -0
- package/dist/esm/api/resources/staticWallets/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/index.d.mts +2 -0
- package/dist/esm/api/resources/staticWallets/types/index.mjs +2 -0
- package/dist/esm/api/types/CryptopayAssetId.d.mts +32 -0
- package/dist/esm/api/types/CryptopayAssetId.mjs +32 -0
- package/dist/esm/api/types/CryptopayListPaymentsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticDepositsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticWalletsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +6 -6
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +5 -5
- package/dist/esm/api/types/CryptopayRedirectConfigDto.d.mts +11 -1
- package/dist/esm/api/types/CryptopayRedirectConfigDto.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticDepositResponse.d.mts +13 -2
- package/dist/esm/api/types/CryptopayStaticDepositResponse.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticWalletResponse.d.mts +2 -1
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
- package/dist/esm/auth/HeaderAuthProvider.mjs +1 -1
- package/dist/esm/errors/{SuwardApiError.d.mts → SuwardSDKError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiError.mjs → SuwardSDKError.mjs} +2 -2
- package/dist/{cjs/errors/SuwardApiTimeoutError.d.ts → esm/errors/SuwardSDKTimeoutError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiTimeoutError.mjs → SuwardSDKTimeoutError.mjs} +2 -2
- package/dist/esm/errors/handleNonStatusCodeError.mjs +5 -5
- package/dist/esm/errors/index.d.mts +2 -2
- package/dist/esm/errors/index.mjs +2 -2
- package/dist/esm/index.d.mts +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +86 -82
- package/reference.md +771 -0
|
@@ -60,7 +60,7 @@ const headers_js_1 = require("../../../../core/headers.js");
|
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
61
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
62
62
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
63
|
-
const
|
|
63
|
+
const SuwardSDK = __importStar(require("../../../index.js"));
|
|
64
64
|
class PaymentsClient {
|
|
65
65
|
constructor(options) {
|
|
66
66
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -68,12 +68,12 @@ class PaymentsClient {
|
|
|
68
68
|
/**
|
|
69
69
|
* List payments for a project
|
|
70
70
|
*
|
|
71
|
-
* @param {
|
|
71
|
+
* @param {SuwardSDK.GetV1PaymentsRequest} request
|
|
72
72
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
73
|
*
|
|
74
|
-
* @throws {@link
|
|
75
|
-
* @throws {@link
|
|
76
|
-
* @throws {@link
|
|
74
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
75
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
76
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* await client.payments.listPayments()
|
|
@@ -86,7 +86,7 @@ class PaymentsClient {
|
|
|
86
86
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
87
87
|
const { order, limit, lastId } = request;
|
|
88
88
|
const _queryParams = {
|
|
89
|
-
order,
|
|
89
|
+
order: order != null ? order : undefined,
|
|
90
90
|
limit,
|
|
91
91
|
lastId,
|
|
92
92
|
};
|
|
@@ -116,13 +116,13 @@ class PaymentsClient {
|
|
|
116
116
|
if (_response.error.reason === "status-code") {
|
|
117
117
|
switch (_response.error.statusCode) {
|
|
118
118
|
case 400:
|
|
119
|
-
throw new
|
|
119
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
120
120
|
case 401:
|
|
121
|
-
throw new
|
|
121
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
122
122
|
case 500:
|
|
123
|
-
throw new
|
|
123
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
124
124
|
default:
|
|
125
|
-
throw new errors.
|
|
125
|
+
throw new errors.SuwardSDKError({
|
|
126
126
|
statusCode: _response.error.statusCode,
|
|
127
127
|
body: _response.error.body,
|
|
128
128
|
rawResponse: _response.rawResponse,
|
|
@@ -135,12 +135,12 @@ class PaymentsClient {
|
|
|
135
135
|
/**
|
|
136
136
|
* Create a new payment
|
|
137
137
|
*
|
|
138
|
-
* @param {
|
|
138
|
+
* @param {SuwardSDK.CryptopayCreatePaymentRequest} request
|
|
139
139
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
140
|
*
|
|
141
|
-
* @throws {@link
|
|
142
|
-
* @throws {@link
|
|
143
|
-
* @throws {@link
|
|
141
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
142
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
143
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
146
|
* await client.payments.createPayment()
|
|
@@ -173,13 +173,13 @@ class PaymentsClient {
|
|
|
173
173
|
if (_response.error.reason === "status-code") {
|
|
174
174
|
switch (_response.error.statusCode) {
|
|
175
175
|
case 400:
|
|
176
|
-
throw new
|
|
176
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
177
177
|
case 401:
|
|
178
|
-
throw new
|
|
178
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
179
179
|
case 500:
|
|
180
|
-
throw new
|
|
180
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
181
181
|
default:
|
|
182
|
-
throw new errors.
|
|
182
|
+
throw new errors.SuwardSDKError({
|
|
183
183
|
statusCode: _response.error.statusCode,
|
|
184
184
|
body: _response.error.body,
|
|
185
185
|
rawResponse: _response.rawResponse,
|
|
@@ -193,10 +193,10 @@ class PaymentsClient {
|
|
|
193
193
|
* Returns full payment details when called with an API key (merchant view).
|
|
194
194
|
* Returns limited payment details when called without an API key (customer view).
|
|
195
195
|
*
|
|
196
|
-
* @param {
|
|
196
|
+
* @param {SuwardSDK.GetV1PaymentsPaymentIdRequest} request
|
|
197
197
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
198
|
*
|
|
199
|
-
* @throws {@link
|
|
199
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
200
200
|
*
|
|
201
201
|
* @example
|
|
202
202
|
* await client.payments.getPayment({
|
|
@@ -232,9 +232,9 @@ class PaymentsClient {
|
|
|
232
232
|
if (_response.error.reason === "status-code") {
|
|
233
233
|
switch (_response.error.statusCode) {
|
|
234
234
|
case 500:
|
|
235
|
-
throw new
|
|
235
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
236
236
|
default:
|
|
237
|
-
throw new errors.
|
|
237
|
+
throw new errors.SuwardSDKError({
|
|
238
238
|
statusCode: _response.error.statusCode,
|
|
239
239
|
body: _response.error.body,
|
|
240
240
|
rawResponse: _response.rawResponse,
|
|
@@ -244,14 +244,67 @@ class PaymentsClient {
|
|
|
244
244
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/payments/{paymentId}");
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Activate a payment (public, customer-facing)
|
|
249
|
+
*
|
|
250
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
|
|
251
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
252
|
+
*
|
|
253
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* await client.payments.activatePayment({
|
|
257
|
+
* paymentId: "paymentId"
|
|
258
|
+
* })
|
|
259
|
+
*/
|
|
260
|
+
activatePayment(request, requestOptions) {
|
|
261
|
+
return core.HttpResponsePromise.fromPromise(this.__activatePayment(request, requestOptions));
|
|
262
|
+
}
|
|
263
|
+
__activatePayment(request, requestOptions) {
|
|
264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
266
|
+
const { paymentId } = request;
|
|
267
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
268
|
+
const _response = yield core.fetcher({
|
|
269
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/payments/${core.url.encodePathParam(paymentId)}/activate`),
|
|
270
|
+
method: "POST",
|
|
271
|
+
headers: _headers,
|
|
272
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
273
|
+
timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
|
|
274
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
275
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
276
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
277
|
+
logging: this._options.logging,
|
|
278
|
+
});
|
|
279
|
+
if (_response.ok) {
|
|
280
|
+
return {
|
|
281
|
+
data: _response.body,
|
|
282
|
+
rawResponse: _response.rawResponse,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
if (_response.error.reason === "status-code") {
|
|
286
|
+
switch (_response.error.statusCode) {
|
|
287
|
+
case 500:
|
|
288
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
289
|
+
default:
|
|
290
|
+
throw new errors.SuwardSDKError({
|
|
291
|
+
statusCode: _response.error.statusCode,
|
|
292
|
+
body: _response.error.body,
|
|
293
|
+
rawResponse: _response.rawResponse,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/payments/{paymentId}/activate");
|
|
298
|
+
});
|
|
299
|
+
}
|
|
247
300
|
/**
|
|
248
301
|
* Cancel a payment
|
|
249
302
|
*
|
|
250
|
-
* @param {
|
|
303
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
251
304
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
252
305
|
*
|
|
253
|
-
* @throws {@link
|
|
254
|
-
* @throws {@link
|
|
306
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
307
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
255
308
|
*
|
|
256
309
|
* @example
|
|
257
310
|
* await client.payments.cancelPayment({
|
|
@@ -284,11 +337,11 @@ class PaymentsClient {
|
|
|
284
337
|
if (_response.error.reason === "status-code") {
|
|
285
338
|
switch (_response.error.statusCode) {
|
|
286
339
|
case 401:
|
|
287
|
-
throw new
|
|
340
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
288
341
|
case 500:
|
|
289
|
-
throw new
|
|
342
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
290
343
|
default:
|
|
291
|
-
throw new errors.
|
|
344
|
+
throw new errors.SuwardSDKError({
|
|
292
345
|
statusCode: _response.error.statusCode,
|
|
293
346
|
body: _response.error.body,
|
|
294
347
|
rawResponse: _response.rawResponse,
|
|
@@ -301,12 +354,12 @@ class PaymentsClient {
|
|
|
301
354
|
/**
|
|
302
355
|
* Simulate payment status change (test mode only)
|
|
303
356
|
*
|
|
304
|
-
* @param {
|
|
357
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
305
358
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
306
359
|
*
|
|
307
|
-
* @throws {@link
|
|
308
|
-
* @throws {@link
|
|
309
|
-
* @throws {@link
|
|
360
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
361
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
362
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
310
363
|
*
|
|
311
364
|
* @example
|
|
312
365
|
* await client.payments.simulatePayment({
|
|
@@ -342,13 +395,13 @@ class PaymentsClient {
|
|
|
342
395
|
if (_response.error.reason === "status-code") {
|
|
343
396
|
switch (_response.error.statusCode) {
|
|
344
397
|
case 400:
|
|
345
|
-
throw new
|
|
398
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
346
399
|
case 401:
|
|
347
|
-
throw new
|
|
400
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
348
401
|
case 500:
|
|
349
|
-
throw new
|
|
402
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
350
403
|
default:
|
|
351
|
-
throw new errors.
|
|
404
|
+
throw new errors.SuwardSDKError({
|
|
352
405
|
statusCode: _response.error.statusCode,
|
|
353
406
|
body: _response.error.body,
|
|
354
407
|
rawResponse: _response.rawResponse,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {}
|
|
@@ -6,12 +6,12 @@ import type * as SuwardApi from "../../../../index.js";
|
|
|
6
6
|
export interface CryptopayCreatePaymentRequest {
|
|
7
7
|
activationFlowSeconds?: number;
|
|
8
8
|
amount?: string;
|
|
9
|
-
asset?:
|
|
9
|
+
asset?: SuwardSDK.CryptopayAssetId;
|
|
10
10
|
externalId?: string;
|
|
11
11
|
isTest?: boolean;
|
|
12
12
|
metadata?: Record<string, unknown>;
|
|
13
13
|
paymentWindowSeconds?: number;
|
|
14
|
-
redirect?:
|
|
14
|
+
redirect?: SuwardSDK.CryptopayRedirectConfigDto;
|
|
15
15
|
underpaymentTolerance?: string;
|
|
16
16
|
webhookUrl?: string;
|
|
17
17
|
}
|
package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -9,5 +9,5 @@ export interface CryptopaySimulatePaymentRequest {
|
|
|
9
9
|
/** Payment ID */
|
|
10
10
|
paymentId: string;
|
|
11
11
|
amount?: string;
|
|
12
|
-
subStatus?:
|
|
12
|
+
subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum;
|
|
13
13
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
4
5
|
*/
|
|
5
6
|
export interface GetV1PaymentsRequest {
|
|
6
7
|
/** Sort order (asc/desc) */
|
|
7
|
-
order?:
|
|
8
|
-
/** Limit (default 100) */
|
|
8
|
+
order?: SuwardSDK.GetV1PaymentsRequestOrder;
|
|
9
|
+
/** Limit (default 20, max 100) */
|
|
9
10
|
limit?: number;
|
|
10
11
|
/** Last ID for pagination */
|
|
11
12
|
lastId?: string;
|
|
@@ -2,4 +2,5 @@ export type { CryptopayCreatePaymentRequest } from "./CryptopayCreatePaymentRequ
|
|
|
2
2
|
export type { CryptopaySimulatePaymentRequest } from "./CryptopaySimulatePaymentRequest.js";
|
|
3
3
|
export type { GetV1PaymentsPaymentIdRequest } from "./GetV1PaymentsPaymentIdRequest.js";
|
|
4
4
|
export type { GetV1PaymentsRequest } from "./GetV1PaymentsRequest.js";
|
|
5
|
+
export type { PostV1PaymentsPaymentIdActivateRequest } from "./PostV1PaymentsPaymentIdActivateRequest.js";
|
|
5
6
|
export type { PostV1PaymentsPaymentIdCancelRequest } from "./PostV1PaymentsPaymentIdCancelRequest.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
export type GetV1PaymentsPaymentIdResponse =
|
|
1
|
+
import type * as SuwardSDK from "../../../index.js";
|
|
2
|
+
export type GetV1PaymentsPaymentIdResponse = SuwardSDK.CryptopayPaymentResponse | SuwardSDK.CryptopayPublicPaymentResponse;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GetV1PaymentsRequestOrder = void 0;
|
|
5
|
+
exports.GetV1PaymentsRequestOrder = {
|
|
6
|
+
Asc: "asc",
|
|
7
|
+
Desc: "desc",
|
|
8
|
+
};
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./GetV1PaymentsPaymentIdResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./GetV1PaymentsRequestOrder.js"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import * as core from "../../../../core/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as SuwardSDK from "../../../index.js";
|
|
5
5
|
export declare namespace StaticWalletsClient {
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -11,95 +11,96 @@ export declare class StaticWalletsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<StaticWalletsClient.Options>;
|
|
12
12
|
constructor(options: StaticWalletsClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* @param {SuwardSDK.GetV1StaticWalletsRequest} request
|
|
14
15
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
16
|
*
|
|
16
|
-
* @throws {@link
|
|
17
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
19
20
|
* await client.staticWallets.listStaticWallets()
|
|
20
21
|
*/
|
|
21
|
-
listStaticWallets(requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<
|
|
22
|
+
listStaticWallets(request?: SuwardSDK.GetV1StaticWalletsRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticWalletsResponse>;
|
|
22
23
|
private __listStaticWallets;
|
|
23
24
|
/**
|
|
24
25
|
* Create a reusable deposit address with an accepted-asset allow-list
|
|
25
26
|
*
|
|
26
|
-
* @param {
|
|
27
|
+
* @param {SuwardSDK.CryptopayCreateStaticWalletRequest} request
|
|
27
28
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
29
|
*
|
|
29
|
-
* @throws {@link
|
|
30
|
-
* @throws {@link
|
|
30
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
31
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* await client.staticWallets.createStaticWallet()
|
|
34
35
|
*/
|
|
35
|
-
createStaticWallet(request?:
|
|
36
|
+
createStaticWallet(request?: SuwardSDK.CryptopayCreateStaticWalletRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
36
37
|
private __createStaticWallet;
|
|
37
38
|
/**
|
|
38
|
-
* @param {
|
|
39
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest} request
|
|
39
40
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
41
|
*
|
|
41
|
-
* @throws {@link
|
|
42
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
42
43
|
*
|
|
43
44
|
* @example
|
|
44
45
|
* await client.staticWallets.getStaticWallet({
|
|
45
46
|
* staticWalletId: "staticWalletId"
|
|
46
47
|
* })
|
|
47
48
|
*/
|
|
48
|
-
getStaticWallet(request:
|
|
49
|
+
getStaticWallet(request: SuwardSDK.GetV1StaticWalletsStaticWalletIdRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
49
50
|
private __getStaticWallet;
|
|
50
51
|
/**
|
|
51
|
-
* @param {
|
|
52
|
+
* @param {SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest} request
|
|
52
53
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
54
|
*
|
|
54
|
-
* @throws {@link
|
|
55
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
55
56
|
*
|
|
56
57
|
* @example
|
|
57
58
|
* await client.staticWallets.deleteStaticWallet({
|
|
58
59
|
* staticWalletId: "staticWalletId"
|
|
59
60
|
* })
|
|
60
61
|
*/
|
|
61
|
-
deleteStaticWallet(request:
|
|
62
|
+
deleteStaticWallet(request: SuwardSDK.DeleteV1StaticWalletsStaticWalletIdRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<Record<string, boolean>>;
|
|
62
63
|
private __deleteStaticWallet;
|
|
63
64
|
/**
|
|
64
|
-
* @param {
|
|
65
|
+
* @param {SuwardSDK.CryptopayUpdateStaticWalletRequest} request
|
|
65
66
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
67
|
*
|
|
67
|
-
* @throws {@link
|
|
68
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
68
69
|
*
|
|
69
70
|
* @example
|
|
70
71
|
* await client.staticWallets.updateStaticWallet({
|
|
71
72
|
* staticWalletId: "staticWalletId"
|
|
72
73
|
* })
|
|
73
74
|
*/
|
|
74
|
-
updateStaticWallet(request:
|
|
75
|
+
updateStaticWallet(request: SuwardSDK.CryptopayUpdateStaticWalletRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticWalletResponse>;
|
|
75
76
|
private __updateStaticWallet;
|
|
76
77
|
/**
|
|
77
|
-
* @param {
|
|
78
|
+
* @param {SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest} request
|
|
78
79
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
80
|
*
|
|
80
|
-
* @throws {@link
|
|
81
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* await client.staticWallets.listStaticWalletDeposits({
|
|
84
85
|
* staticWalletId: "staticWalletId"
|
|
85
86
|
* })
|
|
86
87
|
*/
|
|
87
|
-
listStaticWalletDeposits(request:
|
|
88
|
+
listStaticWalletDeposits(request: SuwardSDK.GetV1StaticWalletsStaticWalletIdDepositsRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListStaticDepositsResponse>;
|
|
88
89
|
private __listStaticWalletDeposits;
|
|
89
90
|
/**
|
|
90
91
|
* Drive a synthetic deposit through its lifecycle on a test wallet (no on-chain activity, no balance credit). Test wallets only.
|
|
91
92
|
*
|
|
92
|
-
* @param {
|
|
93
|
+
* @param {SuwardSDK.CryptopaySimulateStaticDepositRequest} request
|
|
93
94
|
* @param {StaticWalletsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
95
|
*
|
|
95
|
-
* @throws {@link
|
|
96
|
-
* @throws {@link
|
|
96
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
97
|
+
* @throws {@link SuwardSDK.NotFoundError}
|
|
97
98
|
*
|
|
98
99
|
* @example
|
|
99
100
|
* await client.staticWallets.simulateStaticWalletDeposit({
|
|
100
101
|
* staticWalletId: "staticWalletId"
|
|
101
102
|
* })
|
|
102
103
|
*/
|
|
103
|
-
simulateStaticWalletDeposit(request:
|
|
104
|
+
simulateStaticWalletDeposit(request: SuwardSDK.CryptopaySimulateStaticDepositRequest, requestOptions?: StaticWalletsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayStaticDepositResponse>;
|
|
104
105
|
private __simulateStaticWalletDeposit;
|
|
105
106
|
}
|