@wix/auto_sdk_ecom_order-payment-requests 1.0.62 → 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 +1 -1
- package/build/cjs/index.js +59 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +50 -1
- package/build/cjs/index.typings.js +50 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +45 -2
- package/build/cjs/meta.js +39 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +58 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +50 -1
- package/build/es/index.typings.mjs +49 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +45 -2
- package/build/es/meta.mjs +38 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +28 -3
- package/build/internal/cjs/index.js +59 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +74 -1
- package/build/internal/cjs/index.typings.js +50 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +45 -2
- package/build/internal/cjs/meta.js +39 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +28 -3
- package/build/internal/es/index.mjs +58 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +74 -1
- package/build/internal/es/index.typings.mjs +49 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +45 -2
- package/build/internal/es/meta.mjs +38 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -440,6 +440,26 @@ interface VoidOrderPaymentRequestRequest {
|
|
|
440
440
|
}
|
|
441
441
|
interface VoidOrderPaymentRequestResponse {
|
|
442
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
|
+
}
|
|
443
463
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
444
464
|
createdEvent?: EntityCreatedEvent;
|
|
445
465
|
updatedEvent?: EntityUpdatedEvent;
|
|
@@ -667,6 +687,28 @@ type VoidOrderPaymentRequestApplicationErrors = {
|
|
|
667
687
|
description?: string;
|
|
668
688
|
data?: Record<string, any>;
|
|
669
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
|
+
};
|
|
670
712
|
interface BaseEventMetadata {
|
|
671
713
|
/**
|
|
672
714
|
* App instance ID.
|
|
@@ -1245,5 +1287,12 @@ interface UpdateExtendedFieldsOptions {
|
|
|
1245
1287
|
declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise<void & {
|
|
1246
1288
|
__applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
|
|
1247
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
|
+
}
|
|
1248
1297
|
|
|
1249
|
-
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 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 };
|
|
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 };
|
|
@@ -340,6 +340,25 @@ function voidOrderPaymentRequest(payload) {
|
|
|
340
340
|
}
|
|
341
341
|
return __voidOrderPaymentRequest;
|
|
342
342
|
}
|
|
343
|
+
function chargeOrderPaymentRequest(payload) {
|
|
344
|
+
function __chargeOrderPaymentRequest({ host }) {
|
|
345
|
+
const metadata = {
|
|
346
|
+
entityFqdn: "wix.ecom.v1.order_payment_request",
|
|
347
|
+
method: "POST",
|
|
348
|
+
methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.ChargeOrderPaymentRequest",
|
|
349
|
+
packageName: PACKAGE_NAME,
|
|
350
|
+
migrationOptions: {
|
|
351
|
+
optInTransformResponse: true
|
|
352
|
+
},
|
|
353
|
+
url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
|
|
354
|
+
{ protoPath: "/v1/order-payment-requests/charge", data: payload, host }
|
|
355
|
+
),
|
|
356
|
+
data: payload
|
|
357
|
+
};
|
|
358
|
+
return metadata;
|
|
359
|
+
}
|
|
360
|
+
return __chargeOrderPaymentRequest;
|
|
361
|
+
}
|
|
343
362
|
|
|
344
363
|
// src/ecom-v1-order-payment-request-order-payment-requests.universal.ts
|
|
345
364
|
import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
|
|
@@ -730,12 +749,42 @@ async function voidOrderPaymentRequest2(orderPaymentRequestId) {
|
|
|
730
749
|
throw transformedError;
|
|
731
750
|
}
|
|
732
751
|
}
|
|
752
|
+
async function chargeOrderPaymentRequest2(orderPaymentRequestId, options) {
|
|
753
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
754
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
755
|
+
orderPaymentRequestId,
|
|
756
|
+
paymentToken: options?.paymentToken
|
|
757
|
+
});
|
|
758
|
+
const reqOpts = chargeOrderPaymentRequest(payload);
|
|
759
|
+
sideEffects?.onSiteCall?.();
|
|
760
|
+
try {
|
|
761
|
+
const result = await httpClient.request(reqOpts);
|
|
762
|
+
sideEffects?.onSuccess?.(result);
|
|
763
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
764
|
+
} catch (err) {
|
|
765
|
+
const transformedError = sdkTransformError(
|
|
766
|
+
err,
|
|
767
|
+
{
|
|
768
|
+
spreadPathsToArguments: {},
|
|
769
|
+
explicitPathsToArguments: {
|
|
770
|
+
orderPaymentRequestId: "$[0]",
|
|
771
|
+
paymentToken: "$[1].paymentToken"
|
|
772
|
+
},
|
|
773
|
+
singleArgumentUnchanged: false
|
|
774
|
+
},
|
|
775
|
+
["orderPaymentRequestId", "options"]
|
|
776
|
+
);
|
|
777
|
+
sideEffects?.onError?.(err);
|
|
778
|
+
throw transformedError;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
733
781
|
export {
|
|
734
782
|
PaymentMethod,
|
|
735
783
|
SortOrder,
|
|
736
784
|
Status,
|
|
737
785
|
WebhookIdentityType,
|
|
738
786
|
bulkCreateOrderPaymentRequests2 as bulkCreateOrderPaymentRequests,
|
|
787
|
+
chargeOrderPaymentRequest2 as chargeOrderPaymentRequest,
|
|
739
788
|
createOrderPaymentRequest2 as createOrderPaymentRequest,
|
|
740
789
|
deleteOrderPaymentRequest2 as deleteOrderPaymentRequest,
|
|
741
790
|
getOrderPaymentRequest2 as getOrderPaymentRequest,
|