@wix/auto_sdk_ecom_order-payment-requests 1.0.61 → 1.0.63
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/build/cjs/index.d.ts +16 -3
- package/build/cjs/index.js +159 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +139 -1
- package/build/cjs/index.typings.js +141 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +113 -2
- package/build/cjs/meta.js +104 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +5 -1
- package/build/cjs/schemas.js +13 -2
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +16 -3
- package/build/es/index.mjs +157 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +139 -1
- package/build/es/index.typings.mjs +139 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +113 -2
- package/build/es/meta.mjs +102 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +5 -1
- package/build/es/schemas.mjs +10 -1
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +48 -5
- package/build/internal/cjs/index.js +159 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +172 -2
- package/build/internal/cjs/index.typings.js +141 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +113 -2
- package/build/internal/cjs/meta.js +104 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +5 -1
- package/build/internal/cjs/schemas.js +13 -2
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +48 -5
- package/build/internal/es/index.mjs +157 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +172 -2
- package/build/internal/es/index.typings.mjs +139 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +113 -2
- package/build/internal/es/meta.mjs +102 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +5 -1
- package/build/internal/es/schemas.mjs +10 -1
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -217,6 +217,73 @@ interface CreateOrderPaymentRequestResponse {
|
|
|
217
217
|
*/
|
|
218
218
|
orderPaymentRequestUrl?: string;
|
|
219
219
|
}
|
|
220
|
+
interface BulkCreateOrderPaymentRequestsRequest {
|
|
221
|
+
/**
|
|
222
|
+
* Order payment requests to create.
|
|
223
|
+
* @minSize 1
|
|
224
|
+
* @maxSize 100
|
|
225
|
+
*/
|
|
226
|
+
orderPaymentRequests: OrderPaymentRequest[];
|
|
227
|
+
/**
|
|
228
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
229
|
+
* Default: `false`.
|
|
230
|
+
*/
|
|
231
|
+
returnEntity?: boolean;
|
|
232
|
+
}
|
|
233
|
+
interface BulkCreateOrderPaymentRequestsResponse {
|
|
234
|
+
/**
|
|
235
|
+
* Results of the bulk create operation in the same order as the request items.
|
|
236
|
+
* @minSize 1
|
|
237
|
+
* @maxSize 100
|
|
238
|
+
*/
|
|
239
|
+
results?: BulkOrderPaymentRequestResult[];
|
|
240
|
+
/** Metadata about the bulk create operation. */
|
|
241
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
242
|
+
}
|
|
243
|
+
interface ItemMetadata {
|
|
244
|
+
/**
|
|
245
|
+
* Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.
|
|
246
|
+
* @format GUID
|
|
247
|
+
*/
|
|
248
|
+
_id?: string | null;
|
|
249
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
250
|
+
originalIndex?: number;
|
|
251
|
+
/** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
|
|
252
|
+
success?: boolean;
|
|
253
|
+
/** Details about the error in case of failure. */
|
|
254
|
+
error?: ApplicationError;
|
|
255
|
+
}
|
|
256
|
+
interface ApplicationError {
|
|
257
|
+
/** Error code. */
|
|
258
|
+
code?: string;
|
|
259
|
+
/** Description of the error. */
|
|
260
|
+
description?: string;
|
|
261
|
+
/** Data related to the error. */
|
|
262
|
+
data?: Record<string, any> | null;
|
|
263
|
+
}
|
|
264
|
+
interface BulkOrderPaymentRequestItem {
|
|
265
|
+
/** Created order payment request. */
|
|
266
|
+
orderPaymentRequest?: OrderPaymentRequest;
|
|
267
|
+
/**
|
|
268
|
+
* Payment page URL for the created order payment request.
|
|
269
|
+
* @format WEB_URL
|
|
270
|
+
*/
|
|
271
|
+
orderPaymentRequestUrl?: string;
|
|
272
|
+
}
|
|
273
|
+
interface BulkOrderPaymentRequestResult {
|
|
274
|
+
/** Metadata about this item, including its original request index and any error. */
|
|
275
|
+
itemMetadata?: ItemMetadata;
|
|
276
|
+
/** Created order payment request and its payment page URL. Returned when `returnEntity` is `true`. */
|
|
277
|
+
item?: BulkOrderPaymentRequestItem;
|
|
278
|
+
}
|
|
279
|
+
interface BulkActionMetadata {
|
|
280
|
+
/** Number of items that were successfully processed. */
|
|
281
|
+
totalSuccesses?: number;
|
|
282
|
+
/** Number of items that couldn't be processed. */
|
|
283
|
+
totalFailures?: number;
|
|
284
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
285
|
+
undetailedFailures?: number;
|
|
286
|
+
}
|
|
220
287
|
interface GetOrderPaymentRequestRequest {
|
|
221
288
|
/**
|
|
222
289
|
* ID of the order payment request to retrieve.
|
|
@@ -373,6 +440,26 @@ interface VoidOrderPaymentRequestRequest {
|
|
|
373
440
|
}
|
|
374
441
|
interface VoidOrderPaymentRequestResponse {
|
|
375
442
|
}
|
|
443
|
+
interface ChargeOrderPaymentRequestRequest {
|
|
444
|
+
/**
|
|
445
|
+
* ID of the order payment request to charge.
|
|
446
|
+
* @format GUID
|
|
447
|
+
*/
|
|
448
|
+
orderPaymentRequestId: string;
|
|
449
|
+
/**
|
|
450
|
+
* Token representing the payment details the customer entered, including their card and payment provider. Obtain it by calling `paymentsApi.initializePayment()` on the `paymentsApi` object provided by the Wix Cashier payments client SDK. Valid for a single charge attempt.
|
|
451
|
+
* @maxLength 100
|
|
452
|
+
*/
|
|
453
|
+
paymentToken?: string | null;
|
|
454
|
+
}
|
|
455
|
+
interface ChargeOrderPaymentRequestResponse {
|
|
456
|
+
/**
|
|
457
|
+
* Token for completing a payment that requires an additional step from the customer, such as 3D Secure verification or an off-site redirect. Returned only when such a step is required. Pass it to `paymentsApi.continuePayment()` in the Wix Cashier payments client SDK.
|
|
458
|
+
* @minLength 1
|
|
459
|
+
* @maxLength 1000
|
|
460
|
+
*/
|
|
461
|
+
paymentResponseToken?: string | null;
|
|
462
|
+
}
|
|
376
463
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
377
464
|
createdEvent?: EntityCreatedEvent;
|
|
378
465
|
updatedEvent?: EntityUpdatedEvent;
|
|
@@ -600,6 +687,28 @@ type VoidOrderPaymentRequestApplicationErrors = {
|
|
|
600
687
|
description?: string;
|
|
601
688
|
data?: Record<string, any>;
|
|
602
689
|
};
|
|
690
|
+
/** @docsIgnore */
|
|
691
|
+
type ChargeOrderPaymentRequestApplicationErrors = {
|
|
692
|
+
code?: 'ORDER_PAYMENT_REQUEST_NOT_FOUND';
|
|
693
|
+
description?: string;
|
|
694
|
+
data?: Record<string, any>;
|
|
695
|
+
} | {
|
|
696
|
+
code?: 'CANNOT_CHARGE_PAID_ORDER_PAYMENT_REQUEST';
|
|
697
|
+
description?: string;
|
|
698
|
+
data?: Record<string, any>;
|
|
699
|
+
} | {
|
|
700
|
+
code?: 'CANNOT_CHARGE_EXPIRED_ORDER_PAYMENT_REQUEST';
|
|
701
|
+
description?: string;
|
|
702
|
+
data?: Record<string, any>;
|
|
703
|
+
} | {
|
|
704
|
+
code?: 'CANNOT_CHARGE_VOIDED_ORDER_PAYMENT_REQUEST';
|
|
705
|
+
description?: string;
|
|
706
|
+
data?: Record<string, any>;
|
|
707
|
+
} | {
|
|
708
|
+
code?: 'PAYMENT_IN_PROGRESS';
|
|
709
|
+
description?: string;
|
|
710
|
+
data?: Record<string, any>;
|
|
711
|
+
};
|
|
603
712
|
interface BaseEventMetadata {
|
|
604
713
|
/**
|
|
605
714
|
* App instance ID.
|
|
@@ -804,6 +913,13 @@ interface CreateOrderPaymentRequestOptions {
|
|
|
804
913
|
/** Order payment request to create. */
|
|
805
914
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
806
915
|
}
|
|
916
|
+
interface BulkCreateOrderPaymentRequestsOptions {
|
|
917
|
+
/**
|
|
918
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
919
|
+
* Default: `false`.
|
|
920
|
+
*/
|
|
921
|
+
returnEntity?: boolean;
|
|
922
|
+
}
|
|
807
923
|
/**
|
|
808
924
|
* Retrieves an order payment request.
|
|
809
925
|
* @param orderPaymentRequestId - ID of the order payment request to retrieve.
|
|
@@ -1156,5 +1272,27 @@ interface UpdateExtendedFieldsOptions {
|
|
|
1156
1272
|
/** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
|
|
1157
1273
|
namespaceData: Record<string, any> | null;
|
|
1158
1274
|
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Voids the given order payment request.
|
|
1277
|
+
*
|
|
1278
|
+
* Only `UNPAID` order payment requests can be voided. Voiding an order payment request that is already `VOIDED` succeeds without making any changes. Voiding a `PAID` or `EXPIRED` order payment request fails.
|
|
1279
|
+
* @param orderPaymentRequestId - ID of the order payment request to void.
|
|
1280
|
+
* @public
|
|
1281
|
+
* @documentationMaturity preview
|
|
1282
|
+
* @requiredField orderPaymentRequestId
|
|
1283
|
+
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
|
|
1284
|
+
* @applicableIdentity APP
|
|
1285
|
+
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.VoidOrderPaymentRequest
|
|
1286
|
+
*/
|
|
1287
|
+
declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise<void & {
|
|
1288
|
+
__applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
|
|
1289
|
+
}>;
|
|
1290
|
+
interface ChargeOrderPaymentRequestOptions {
|
|
1291
|
+
/**
|
|
1292
|
+
* Token representing the payment details the customer entered, including their card and payment provider. Obtain it by calling `paymentsApi.initializePayment()` on the `paymentsApi` object provided by the Wix Cashier payments client SDK. Valid for a single charge attempt.
|
|
1293
|
+
* @maxLength 100
|
|
1294
|
+
*/
|
|
1295
|
+
paymentToken?: string | null;
|
|
1296
|
+
}
|
|
1159
1297
|
|
|
1160
|
-
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type BaseEventMetadata, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils };
|
|
1298
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateOrderPaymentRequestsOptions, type BulkCreateOrderPaymentRequestsRequest, type BulkCreateOrderPaymentRequestsResponse, type BulkOrderPaymentRequestItem, type BulkOrderPaymentRequestResult, type ChargeOrderPaymentRequestApplicationErrors, type ChargeOrderPaymentRequestOptions, type ChargeOrderPaymentRequestRequest, type ChargeOrderPaymentRequestResponse, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils, voidOrderPaymentRequest };
|
|
@@ -24,6 +24,8 @@ __export(index_typings_exports, {
|
|
|
24
24
|
SortOrder: () => SortOrder,
|
|
25
25
|
Status: () => Status,
|
|
26
26
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
27
|
+
bulkCreateOrderPaymentRequests: () => bulkCreateOrderPaymentRequests2,
|
|
28
|
+
chargeOrderPaymentRequest: () => chargeOrderPaymentRequest2,
|
|
27
29
|
createOrderPaymentRequest: () => createOrderPaymentRequest2,
|
|
28
30
|
deleteOrderPaymentRequest: () => deleteOrderPaymentRequest2,
|
|
29
31
|
getOrderPaymentRequest: () => getOrderPaymentRequest2,
|
|
@@ -130,6 +132,49 @@ function createOrderPaymentRequest(payload) {
|
|
|
130
132
|
}
|
|
131
133
|
return __createOrderPaymentRequest;
|
|
132
134
|
}
|
|
135
|
+
function bulkCreateOrderPaymentRequests(payload) {
|
|
136
|
+
function __bulkCreateOrderPaymentRequests({ host }) {
|
|
137
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
138
|
+
{
|
|
139
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
140
|
+
paths: [
|
|
141
|
+
{ path: "orderPaymentRequests.expirationDate" },
|
|
142
|
+
{ path: "orderPaymentRequests.createdDate" },
|
|
143
|
+
{ path: "orderPaymentRequests.updatedDate" }
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
]);
|
|
147
|
+
const metadata = {
|
|
148
|
+
entityFqdn: "wix.ecom.v1.order_payment_request",
|
|
149
|
+
method: "POST",
|
|
150
|
+
methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.BulkCreateOrderPaymentRequests",
|
|
151
|
+
packageName: PACKAGE_NAME,
|
|
152
|
+
migrationOptions: {
|
|
153
|
+
optInTransformResponse: true
|
|
154
|
+
},
|
|
155
|
+
url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
|
|
156
|
+
{
|
|
157
|
+
protoPath: "/v1/bulk/order-payment-requests/create",
|
|
158
|
+
data: serializedData,
|
|
159
|
+
host
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
data: serializedData,
|
|
163
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
164
|
+
{
|
|
165
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
166
|
+
paths: [
|
|
167
|
+
{ path: "results.item.orderPaymentRequest.expirationDate" },
|
|
168
|
+
{ path: "results.item.orderPaymentRequest.createdDate" },
|
|
169
|
+
{ path: "results.item.orderPaymentRequest.updatedDate" }
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
])
|
|
173
|
+
};
|
|
174
|
+
return metadata;
|
|
175
|
+
}
|
|
176
|
+
return __bulkCreateOrderPaymentRequests;
|
|
177
|
+
}
|
|
133
178
|
function getOrderPaymentRequest(payload) {
|
|
134
179
|
function __getOrderPaymentRequest({ host }) {
|
|
135
180
|
const metadata = {
|
|
@@ -333,6 +378,25 @@ function voidOrderPaymentRequest(payload) {
|
|
|
333
378
|
}
|
|
334
379
|
return __voidOrderPaymentRequest;
|
|
335
380
|
}
|
|
381
|
+
function chargeOrderPaymentRequest(payload) {
|
|
382
|
+
function __chargeOrderPaymentRequest({ host }) {
|
|
383
|
+
const metadata = {
|
|
384
|
+
entityFqdn: "wix.ecom.v1.order_payment_request",
|
|
385
|
+
method: "POST",
|
|
386
|
+
methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.ChargeOrderPaymentRequest",
|
|
387
|
+
packageName: PACKAGE_NAME,
|
|
388
|
+
migrationOptions: {
|
|
389
|
+
optInTransformResponse: true
|
|
390
|
+
},
|
|
391
|
+
url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
|
|
392
|
+
{ protoPath: "/v1/order-payment-requests/charge", data: payload, host }
|
|
393
|
+
),
|
|
394
|
+
data: payload
|
|
395
|
+
};
|
|
396
|
+
return metadata;
|
|
397
|
+
}
|
|
398
|
+
return __chargeOrderPaymentRequest;
|
|
399
|
+
}
|
|
336
400
|
|
|
337
401
|
// src/ecom-v1-order-payment-request-order-payment-requests.universal.ts
|
|
338
402
|
var import_image = require("@wix/sdk-runtime/transformations/image");
|
|
@@ -405,6 +469,52 @@ async function createOrderPaymentRequest2(options) {
|
|
|
405
469
|
throw transformedError;
|
|
406
470
|
}
|
|
407
471
|
}
|
|
472
|
+
async function bulkCreateOrderPaymentRequests2(orderPaymentRequests, options) {
|
|
473
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
474
|
+
const payload = (0, import_transform_paths2.transformPaths)(
|
|
475
|
+
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
476
|
+
orderPaymentRequests,
|
|
477
|
+
returnEntity: options?.returnEntity
|
|
478
|
+
}),
|
|
479
|
+
[
|
|
480
|
+
{
|
|
481
|
+
transformFn: import_image.transformSDKImageToRESTImage,
|
|
482
|
+
paths: [{ path: "orderPaymentRequests.image" }]
|
|
483
|
+
}
|
|
484
|
+
]
|
|
485
|
+
);
|
|
486
|
+
const reqOpts = bulkCreateOrderPaymentRequests(
|
|
487
|
+
payload
|
|
488
|
+
);
|
|
489
|
+
sideEffects?.onSiteCall?.();
|
|
490
|
+
try {
|
|
491
|
+
const result = await httpClient.request(reqOpts);
|
|
492
|
+
sideEffects?.onSuccess?.(result);
|
|
493
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
494
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
495
|
+
{
|
|
496
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
497
|
+
paths: [{ path: "results.item.orderPaymentRequest.image" }]
|
|
498
|
+
}
|
|
499
|
+
])
|
|
500
|
+
);
|
|
501
|
+
} catch (err) {
|
|
502
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
503
|
+
err,
|
|
504
|
+
{
|
|
505
|
+
spreadPathsToArguments: {},
|
|
506
|
+
explicitPathsToArguments: {
|
|
507
|
+
orderPaymentRequests: "$[0]",
|
|
508
|
+
returnEntity: "$[1].returnEntity"
|
|
509
|
+
},
|
|
510
|
+
singleArgumentUnchanged: false
|
|
511
|
+
},
|
|
512
|
+
["orderPaymentRequests", "options"]
|
|
513
|
+
);
|
|
514
|
+
sideEffects?.onError?.(err);
|
|
515
|
+
throw transformedError;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
408
518
|
async function getOrderPaymentRequest2(orderPaymentRequestId) {
|
|
409
519
|
const { httpClient, sideEffects } = arguments[1];
|
|
410
520
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -677,12 +787,43 @@ async function voidOrderPaymentRequest2(orderPaymentRequestId) {
|
|
|
677
787
|
throw transformedError;
|
|
678
788
|
}
|
|
679
789
|
}
|
|
790
|
+
async function chargeOrderPaymentRequest2(orderPaymentRequestId, options) {
|
|
791
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
792
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
793
|
+
orderPaymentRequestId,
|
|
794
|
+
paymentToken: options?.paymentToken
|
|
795
|
+
});
|
|
796
|
+
const reqOpts = chargeOrderPaymentRequest(payload);
|
|
797
|
+
sideEffects?.onSiteCall?.();
|
|
798
|
+
try {
|
|
799
|
+
const result = await httpClient.request(reqOpts);
|
|
800
|
+
sideEffects?.onSuccess?.(result);
|
|
801
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
802
|
+
} catch (err) {
|
|
803
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
804
|
+
err,
|
|
805
|
+
{
|
|
806
|
+
spreadPathsToArguments: {},
|
|
807
|
+
explicitPathsToArguments: {
|
|
808
|
+
orderPaymentRequestId: "$[0]",
|
|
809
|
+
paymentToken: "$[1].paymentToken"
|
|
810
|
+
},
|
|
811
|
+
singleArgumentUnchanged: false
|
|
812
|
+
},
|
|
813
|
+
["orderPaymentRequestId", "options"]
|
|
814
|
+
);
|
|
815
|
+
sideEffects?.onError?.(err);
|
|
816
|
+
throw transformedError;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
680
819
|
// Annotate the CommonJS export names for ESM import in node:
|
|
681
820
|
0 && (module.exports = {
|
|
682
821
|
PaymentMethod,
|
|
683
822
|
SortOrder,
|
|
684
823
|
Status,
|
|
685
824
|
WebhookIdentityType,
|
|
825
|
+
bulkCreateOrderPaymentRequests,
|
|
826
|
+
chargeOrderPaymentRequest,
|
|
686
827
|
createOrderPaymentRequest,
|
|
687
828
|
deleteOrderPaymentRequest,
|
|
688
829
|
getOrderPaymentRequest,
|