@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
|
@@ -235,6 +235,73 @@ interface CreateOrderPaymentRequestResponse {
|
|
|
235
235
|
*/
|
|
236
236
|
orderPaymentRequestUrl?: string;
|
|
237
237
|
}
|
|
238
|
+
interface BulkCreateOrderPaymentRequestsRequest {
|
|
239
|
+
/**
|
|
240
|
+
* Order payment requests to create.
|
|
241
|
+
* @minSize 1
|
|
242
|
+
* @maxSize 100
|
|
243
|
+
*/
|
|
244
|
+
orderPaymentRequests: OrderPaymentRequest[];
|
|
245
|
+
/**
|
|
246
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
247
|
+
* Default: `false`.
|
|
248
|
+
*/
|
|
249
|
+
returnEntity?: boolean;
|
|
250
|
+
}
|
|
251
|
+
interface BulkCreateOrderPaymentRequestsResponse {
|
|
252
|
+
/**
|
|
253
|
+
* Results of the bulk create operation in the same order as the request items.
|
|
254
|
+
* @minSize 1
|
|
255
|
+
* @maxSize 100
|
|
256
|
+
*/
|
|
257
|
+
results?: BulkOrderPaymentRequestResult[];
|
|
258
|
+
/** Metadata about the bulk create operation. */
|
|
259
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
260
|
+
}
|
|
261
|
+
interface ItemMetadata {
|
|
262
|
+
/**
|
|
263
|
+
* Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.
|
|
264
|
+
* @format GUID
|
|
265
|
+
*/
|
|
266
|
+
_id?: string | null;
|
|
267
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
268
|
+
originalIndex?: number;
|
|
269
|
+
/** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
|
|
270
|
+
success?: boolean;
|
|
271
|
+
/** Details about the error in case of failure. */
|
|
272
|
+
error?: ApplicationError;
|
|
273
|
+
}
|
|
274
|
+
interface ApplicationError {
|
|
275
|
+
/** Error code. */
|
|
276
|
+
code?: string;
|
|
277
|
+
/** Description of the error. */
|
|
278
|
+
description?: string;
|
|
279
|
+
/** Data related to the error. */
|
|
280
|
+
data?: Record<string, any> | null;
|
|
281
|
+
}
|
|
282
|
+
interface BulkOrderPaymentRequestItem {
|
|
283
|
+
/** Created order payment request. */
|
|
284
|
+
orderPaymentRequest?: OrderPaymentRequest;
|
|
285
|
+
/**
|
|
286
|
+
* Payment page URL for the created order payment request.
|
|
287
|
+
* @format WEB_URL
|
|
288
|
+
*/
|
|
289
|
+
orderPaymentRequestUrl?: string;
|
|
290
|
+
}
|
|
291
|
+
interface BulkOrderPaymentRequestResult {
|
|
292
|
+
/** Metadata about this item, including its original request index and any error. */
|
|
293
|
+
itemMetadata?: ItemMetadata;
|
|
294
|
+
/** Created order payment request and its payment page URL. Returned when `returnEntity` is `true`. */
|
|
295
|
+
item?: BulkOrderPaymentRequestItem;
|
|
296
|
+
}
|
|
297
|
+
interface BulkActionMetadata {
|
|
298
|
+
/** Number of items that were successfully processed. */
|
|
299
|
+
totalSuccesses?: number;
|
|
300
|
+
/** Number of items that couldn't be processed. */
|
|
301
|
+
totalFailures?: number;
|
|
302
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
303
|
+
undetailedFailures?: number;
|
|
304
|
+
}
|
|
238
305
|
interface GetOrderPaymentRequestRequest {
|
|
239
306
|
/**
|
|
240
307
|
* ID of the order payment request to retrieve.
|
|
@@ -391,6 +458,26 @@ interface VoidOrderPaymentRequestRequest {
|
|
|
391
458
|
}
|
|
392
459
|
interface VoidOrderPaymentRequestResponse {
|
|
393
460
|
}
|
|
461
|
+
interface ChargeOrderPaymentRequestRequest {
|
|
462
|
+
/**
|
|
463
|
+
* ID of the order payment request to charge.
|
|
464
|
+
* @format GUID
|
|
465
|
+
*/
|
|
466
|
+
orderPaymentRequestId: string;
|
|
467
|
+
/**
|
|
468
|
+
* 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.
|
|
469
|
+
* @maxLength 100
|
|
470
|
+
*/
|
|
471
|
+
paymentToken?: string | null;
|
|
472
|
+
}
|
|
473
|
+
interface ChargeOrderPaymentRequestResponse {
|
|
474
|
+
/**
|
|
475
|
+
* 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.
|
|
476
|
+
* @minLength 1
|
|
477
|
+
* @maxLength 1000
|
|
478
|
+
*/
|
|
479
|
+
paymentResponseToken?: string | null;
|
|
480
|
+
}
|
|
394
481
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
395
482
|
createdEvent?: EntityCreatedEvent;
|
|
396
483
|
updatedEvent?: EntityUpdatedEvent;
|
|
@@ -618,6 +705,28 @@ type VoidOrderPaymentRequestApplicationErrors = {
|
|
|
618
705
|
description?: string;
|
|
619
706
|
data?: Record<string, any>;
|
|
620
707
|
};
|
|
708
|
+
/** @docsIgnore */
|
|
709
|
+
type ChargeOrderPaymentRequestApplicationErrors = {
|
|
710
|
+
code?: 'ORDER_PAYMENT_REQUEST_NOT_FOUND';
|
|
711
|
+
description?: string;
|
|
712
|
+
data?: Record<string, any>;
|
|
713
|
+
} | {
|
|
714
|
+
code?: 'CANNOT_CHARGE_PAID_ORDER_PAYMENT_REQUEST';
|
|
715
|
+
description?: string;
|
|
716
|
+
data?: Record<string, any>;
|
|
717
|
+
} | {
|
|
718
|
+
code?: 'CANNOT_CHARGE_EXPIRED_ORDER_PAYMENT_REQUEST';
|
|
719
|
+
description?: string;
|
|
720
|
+
data?: Record<string, any>;
|
|
721
|
+
} | {
|
|
722
|
+
code?: 'CANNOT_CHARGE_VOIDED_ORDER_PAYMENT_REQUEST';
|
|
723
|
+
description?: string;
|
|
724
|
+
data?: Record<string, any>;
|
|
725
|
+
} | {
|
|
726
|
+
code?: 'PAYMENT_IN_PROGRESS';
|
|
727
|
+
description?: string;
|
|
728
|
+
data?: Record<string, any>;
|
|
729
|
+
};
|
|
621
730
|
interface BaseEventMetadata {
|
|
622
731
|
/**
|
|
623
732
|
* App instance ID.
|
|
@@ -822,6 +931,36 @@ interface CreateOrderPaymentRequestOptions {
|
|
|
822
931
|
/** Order payment request to create. */
|
|
823
932
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
824
933
|
}
|
|
934
|
+
/**
|
|
935
|
+
* Creates multiple order payment requests in a single request. Works synchronously.
|
|
936
|
+
*
|
|
937
|
+
* The response contains an item-level result for every requested order payment request. Items are processed independently, so some may succeed while others fail.
|
|
938
|
+
*
|
|
939
|
+
* Per-item failures are returned in `results[].itemMetadata.error`. Possible application error codes are:
|
|
940
|
+
* - `ORDER_NOT_FOUND`: The referenced order wasn't found.
|
|
941
|
+
* - `PARTIAL_PAYMENT_NOT_SUPPORTED_FOR_SUBSCRIPTION`: The requested amount doesn't equal the subscription order total.
|
|
942
|
+
* - `INVALID_ORDER_STATUS_FOR_SUBSCRIPTION`: The subscription order isn't in `INITIALIZED` status.
|
|
943
|
+
* - `SITE_NOT_PUBLISHED`: The site isn't published.
|
|
944
|
+
* - `ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND`: The Payment Request Page isn't available on the site.
|
|
945
|
+
* @param orderPaymentRequests - Order payment requests to create.
|
|
946
|
+
* @internal
|
|
947
|
+
* @documentationMaturity preview
|
|
948
|
+
* @requiredField orderPaymentRequests
|
|
949
|
+
* @requiredField orderPaymentRequests.amount
|
|
950
|
+
* @requiredField orderPaymentRequests.orderId
|
|
951
|
+
* @requiredField orderPaymentRequests.source.externalId
|
|
952
|
+
* @requiredField orderPaymentRequests.title
|
|
953
|
+
* @permissionId ecom:v1:order_payment_request:bulk_create_order_payment_requests
|
|
954
|
+
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.BulkCreateOrderPaymentRequests
|
|
955
|
+
*/
|
|
956
|
+
declare function bulkCreateOrderPaymentRequests(orderPaymentRequests: NonNullablePaths<OrderPaymentRequest, `amount` | `orderId` | `source.externalId` | `title`, 3>[], options?: BulkCreateOrderPaymentRequestsOptions): Promise<NonNullablePaths<BulkCreateOrderPaymentRequestsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.orderPaymentRequest.status` | `results.${number}.item.orderPaymentRequest.orderId` | `results.${number}.item.orderPaymentRequest.currency` | `results.${number}.item.orderPaymentRequest.title` | `results.${number}.item.orderPaymentRequestUrl` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
957
|
+
interface BulkCreateOrderPaymentRequestsOptions {
|
|
958
|
+
/**
|
|
959
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
960
|
+
* Default: `false`.
|
|
961
|
+
*/
|
|
962
|
+
returnEntity?: boolean;
|
|
963
|
+
}
|
|
825
964
|
/**
|
|
826
965
|
* Retrieves an order payment request.
|
|
827
966
|
* @param orderPaymentRequestId - ID of the order payment request to retrieve.
|
|
@@ -1191,7 +1330,7 @@ interface UpdateExtendedFieldsOptions {
|
|
|
1191
1330
|
*
|
|
1192
1331
|
* 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.
|
|
1193
1332
|
* @param orderPaymentRequestId - ID of the order payment request to void.
|
|
1194
|
-
* @
|
|
1333
|
+
* @public
|
|
1195
1334
|
* @documentationMaturity preview
|
|
1196
1335
|
* @requiredField orderPaymentRequestId
|
|
1197
1336
|
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
|
|
@@ -1201,5 +1340,36 @@ interface UpdateExtendedFieldsOptions {
|
|
|
1201
1340
|
declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise<void & {
|
|
1202
1341
|
__applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
|
|
1203
1342
|
}>;
|
|
1343
|
+
/**
|
|
1344
|
+
* Charges an order payment request.
|
|
1345
|
+
*
|
|
1346
|
+
* Collects the order payment request's `amount` from the payment method the customer entered in the Wix Cashier payments widget on your page. Before calling this method, call `paymentsApi.initializePayment()` on the `paymentsApi` object provided by the Wix Cashier payments client SDK to collect the customer's payment details, then pass the token it returns as `paymentToken`.
|
|
1347
|
+
*
|
|
1348
|
+
* A successful response doesn't mean the payment was collected:
|
|
1349
|
+
* - If `paymentResponseToken` is returned, the customer must complete an additional step, such as 3D Secure verification or an off-site redirect. Pass the token to `paymentsApi.continuePayment()` to complete the payment.
|
|
1350
|
+
* - If `paymentResponseToken` isn't returned, no further step is needed. The payment was either collected or declined by the payment provider.
|
|
1351
|
+
*
|
|
1352
|
+
* Either way, the order payment request's `status` is the authoritative outcome. It changes to `PAID` asynchronously, after the payment provider settles the transaction, which can happen after this method returns. To be notified, listen to the [Order Payment Request Paid](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/order-payment-request-paid) webhook, or poll [Get Order Payment Request](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/get-order-payment-request).
|
|
1353
|
+
*
|
|
1354
|
+
* Charging requires a client-side Wix Cashier payments session, so a backend-only integration can't obtain a `paymentToken` or complete a payment that needs an additional step.
|
|
1355
|
+
*
|
|
1356
|
+
* At most one charge attempt is processed per order payment request, so retrying is safe. While an attempt is still in progress, further calls fail with `PAYMENT_IN_PROGRESS`. Once the payment is collected, further calls fail with `CANNOT_CHARGE_PAID_ORDER_PAYMENT_REQUEST`. The customer isn't charged twice for the same order payment request.
|
|
1357
|
+
* @param orderPaymentRequestId - ID of the order payment request to charge.
|
|
1358
|
+
* @internal
|
|
1359
|
+
* @documentationMaturity preview
|
|
1360
|
+
* @requiredField orderPaymentRequestId
|
|
1361
|
+
* @permissionId ecom:v1:order_payment_request:charge_order_payment_request
|
|
1362
|
+
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.ChargeOrderPaymentRequest
|
|
1363
|
+
*/
|
|
1364
|
+
declare function chargeOrderPaymentRequest(orderPaymentRequestId: string, options?: ChargeOrderPaymentRequestOptions): Promise<ChargeOrderPaymentRequestResponse & {
|
|
1365
|
+
__applicationErrorsType?: ChargeOrderPaymentRequestApplicationErrors;
|
|
1366
|
+
}>;
|
|
1367
|
+
interface ChargeOrderPaymentRequestOptions {
|
|
1368
|
+
/**
|
|
1369
|
+
* 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.
|
|
1370
|
+
* @maxLength 100
|
|
1371
|
+
*/
|
|
1372
|
+
paymentToken?: string | null;
|
|
1373
|
+
}
|
|
1204
1374
|
|
|
1205
|
-
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, voidOrderPaymentRequest };
|
|
1375
|
+
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, bulkCreateOrderPaymentRequests, chargeOrderPaymentRequest, 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,
|