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
|
@@ -24,7 +24,7 @@ import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
26
26
|
import * as errors from "../../../../errors/index.mjs";
|
|
27
|
-
import * as
|
|
27
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
28
28
|
export class PaymentsClient {
|
|
29
29
|
constructor(options) {
|
|
30
30
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
@@ -32,12 +32,12 @@ export class PaymentsClient {
|
|
|
32
32
|
/**
|
|
33
33
|
* List payments for a project
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {SuwardSDK.GetV1PaymentsRequest} request
|
|
36
36
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
|
-
* @throws {@link
|
|
39
|
-
* @throws {@link
|
|
40
|
-
* @throws {@link
|
|
38
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
39
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
40
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* await client.payments.listPayments()
|
|
@@ -50,7 +50,7 @@ export class PaymentsClient {
|
|
|
50
50
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
51
51
|
const { order, limit, lastId } = request;
|
|
52
52
|
const _queryParams = {
|
|
53
|
-
order,
|
|
53
|
+
order: order != null ? order : undefined,
|
|
54
54
|
limit,
|
|
55
55
|
lastId,
|
|
56
56
|
};
|
|
@@ -80,13 +80,13 @@ export class PaymentsClient {
|
|
|
80
80
|
if (_response.error.reason === "status-code") {
|
|
81
81
|
switch (_response.error.statusCode) {
|
|
82
82
|
case 400:
|
|
83
|
-
throw new
|
|
83
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
84
84
|
case 401:
|
|
85
|
-
throw new
|
|
85
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
86
86
|
case 500:
|
|
87
|
-
throw new
|
|
87
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
88
88
|
default:
|
|
89
|
-
throw new errors.
|
|
89
|
+
throw new errors.SuwardSDKError({
|
|
90
90
|
statusCode: _response.error.statusCode,
|
|
91
91
|
body: _response.error.body,
|
|
92
92
|
rawResponse: _response.rawResponse,
|
|
@@ -99,12 +99,12 @@ export class PaymentsClient {
|
|
|
99
99
|
/**
|
|
100
100
|
* Create a new payment
|
|
101
101
|
*
|
|
102
|
-
* @param {
|
|
102
|
+
* @param {SuwardSDK.CryptopayCreatePaymentRequest} request
|
|
103
103
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
104
|
*
|
|
105
|
-
* @throws {@link
|
|
106
|
-
* @throws {@link
|
|
107
|
-
* @throws {@link
|
|
105
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
106
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
107
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
108
108
|
*
|
|
109
109
|
* @example
|
|
110
110
|
* await client.payments.createPayment()
|
|
@@ -137,13 +137,13 @@ export class PaymentsClient {
|
|
|
137
137
|
if (_response.error.reason === "status-code") {
|
|
138
138
|
switch (_response.error.statusCode) {
|
|
139
139
|
case 400:
|
|
140
|
-
throw new
|
|
140
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
141
141
|
case 401:
|
|
142
|
-
throw new
|
|
142
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
143
143
|
case 500:
|
|
144
|
-
throw new
|
|
144
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
145
145
|
default:
|
|
146
|
-
throw new errors.
|
|
146
|
+
throw new errors.SuwardSDKError({
|
|
147
147
|
statusCode: _response.error.statusCode,
|
|
148
148
|
body: _response.error.body,
|
|
149
149
|
rawResponse: _response.rawResponse,
|
|
@@ -157,10 +157,10 @@ export class PaymentsClient {
|
|
|
157
157
|
* Returns full payment details when called with an API key (merchant view).
|
|
158
158
|
* Returns limited payment details when called without an API key (customer view).
|
|
159
159
|
*
|
|
160
|
-
* @param {
|
|
160
|
+
* @param {SuwardSDK.GetV1PaymentsPaymentIdRequest} request
|
|
161
161
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
162
162
|
*
|
|
163
|
-
* @throws {@link
|
|
163
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
164
164
|
*
|
|
165
165
|
* @example
|
|
166
166
|
* await client.payments.getPayment({
|
|
@@ -196,9 +196,9 @@ export class PaymentsClient {
|
|
|
196
196
|
if (_response.error.reason === "status-code") {
|
|
197
197
|
switch (_response.error.statusCode) {
|
|
198
198
|
case 500:
|
|
199
|
-
throw new
|
|
199
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
200
200
|
default:
|
|
201
|
-
throw new errors.
|
|
201
|
+
throw new errors.SuwardSDKError({
|
|
202
202
|
statusCode: _response.error.statusCode,
|
|
203
203
|
body: _response.error.body,
|
|
204
204
|
rawResponse: _response.rawResponse,
|
|
@@ -208,14 +208,67 @@ export class PaymentsClient {
|
|
|
208
208
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/payments/{paymentId}");
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Activate a payment (public, customer-facing)
|
|
213
|
+
*
|
|
214
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
|
|
215
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
|
+
*
|
|
217
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* await client.payments.activatePayment({
|
|
221
|
+
* paymentId: "paymentId"
|
|
222
|
+
* })
|
|
223
|
+
*/
|
|
224
|
+
activatePayment(request, requestOptions) {
|
|
225
|
+
return core.HttpResponsePromise.fromPromise(this.__activatePayment(request, requestOptions));
|
|
226
|
+
}
|
|
227
|
+
__activatePayment(request, requestOptions) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
230
|
+
const { paymentId } = request;
|
|
231
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
232
|
+
const _response = yield core.fetcher({
|
|
233
|
+
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`),
|
|
234
|
+
method: "POST",
|
|
235
|
+
headers: _headers,
|
|
236
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
237
|
+
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,
|
|
238
|
+
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,
|
|
239
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
240
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
241
|
+
logging: this._options.logging,
|
|
242
|
+
});
|
|
243
|
+
if (_response.ok) {
|
|
244
|
+
return {
|
|
245
|
+
data: _response.body,
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (_response.error.reason === "status-code") {
|
|
250
|
+
switch (_response.error.statusCode) {
|
|
251
|
+
case 500:
|
|
252
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
253
|
+
default:
|
|
254
|
+
throw new errors.SuwardSDKError({
|
|
255
|
+
statusCode: _response.error.statusCode,
|
|
256
|
+
body: _response.error.body,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/payments/{paymentId}/activate");
|
|
262
|
+
});
|
|
263
|
+
}
|
|
211
264
|
/**
|
|
212
265
|
* Cancel a payment
|
|
213
266
|
*
|
|
214
|
-
* @param {
|
|
267
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
215
268
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
269
|
*
|
|
217
|
-
* @throws {@link
|
|
218
|
-
* @throws {@link
|
|
270
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
271
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
219
272
|
*
|
|
220
273
|
* @example
|
|
221
274
|
* await client.payments.cancelPayment({
|
|
@@ -248,11 +301,11 @@ export class PaymentsClient {
|
|
|
248
301
|
if (_response.error.reason === "status-code") {
|
|
249
302
|
switch (_response.error.statusCode) {
|
|
250
303
|
case 401:
|
|
251
|
-
throw new
|
|
304
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
252
305
|
case 500:
|
|
253
|
-
throw new
|
|
306
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
254
307
|
default:
|
|
255
|
-
throw new errors.
|
|
308
|
+
throw new errors.SuwardSDKError({
|
|
256
309
|
statusCode: _response.error.statusCode,
|
|
257
310
|
body: _response.error.body,
|
|
258
311
|
rawResponse: _response.rawResponse,
|
|
@@ -265,12 +318,12 @@ export class PaymentsClient {
|
|
|
265
318
|
/**
|
|
266
319
|
* Simulate payment status change (test mode only)
|
|
267
320
|
*
|
|
268
|
-
* @param {
|
|
321
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
269
322
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
270
323
|
*
|
|
271
|
-
* @throws {@link
|
|
272
|
-
* @throws {@link
|
|
273
|
-
* @throws {@link
|
|
324
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
325
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
326
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
274
327
|
*
|
|
275
328
|
* @example
|
|
276
329
|
* await client.payments.simulatePayment({
|
|
@@ -306,13 +359,13 @@ export class PaymentsClient {
|
|
|
306
359
|
if (_response.error.reason === "status-code") {
|
|
307
360
|
switch (_response.error.statusCode) {
|
|
308
361
|
case 400:
|
|
309
|
-
throw new
|
|
362
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
310
363
|
case 401:
|
|
311
|
-
throw new
|
|
364
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
312
365
|
case 500:
|
|
313
|
-
throw new
|
|
366
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
314
367
|
default:
|
|
315
|
-
throw new errors.
|
|
368
|
+
throw new errors.SuwardSDKError({
|
|
316
369
|
statusCode: _response.error.statusCode,
|
|
317
370
|
body: _response.error.body,
|
|
318
371
|
rawResponse: _response.rawResponse,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {}
|
|
@@ -6,12 +6,12 @@ import type * as SuwardApi from "../../../../index.mjs";
|
|
|
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/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
3
3
|
export type { GetV1PaymentsPaymentIdRequest } from "./GetV1PaymentsPaymentIdRequest.mjs";
|
|
4
4
|
export type { GetV1PaymentsRequest } from "./GetV1PaymentsRequest.mjs";
|
|
5
|
+
export type { PostV1PaymentsPaymentIdActivateRequest } from "./PostV1PaymentsPaymentIdActivateRequest.mjs";
|
|
5
6
|
export type { PostV1PaymentsPaymentIdCancelRequest } from "./PostV1PaymentsPaymentIdCancelRequest.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
export type GetV1PaymentsPaymentIdResponse =
|
|
1
|
+
import type * as SuwardSDK from "../../../index.mjs";
|
|
2
|
+
export type GetV1PaymentsPaymentIdResponse = SuwardSDK.CryptopayPaymentResponse | SuwardSDK.CryptopayPublicPaymentResponse;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
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
|
}
|