@liquidcommerce/elements-sdk 2.7.40 → 2.7.42
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 +1 -0
- package/dist/index.checkout.esm.js +9743 -8103
- package/dist/index.esm.js +14982 -13264
- package/dist/ssr-stub.esm.js +6 -0
- package/dist/types/clients/base.d.ts +1 -0
- package/dist/types/clients/helpers.d.ts +2 -1
- package/dist/types/core/api/api-client.service.d.ts +7 -3
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +3 -1
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -1
- package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
- package/dist/types/enums/core.enum.d.ts +6 -0
- package/dist/types/index.checkout.d.ts +2 -1
- package/dist/types/interfaces/api/checkout.interface.d.ts +32 -0
- package/dist/types/interfaces/client.interface.d.ts +3 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +2 -0
- package/dist/types/interfaces/injection.interface.d.ts +6 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +38 -3
- package/dist/types/modules/checkout/checkout.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-buyer.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-delivery-method.component.d.ts +22 -0
- package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +61 -0
- package/dist/types/modules/checkout/components/checkout-express-completion.component.d.ts +21 -0
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +0 -6
- package/dist/types/modules/checkout/components/index.d.ts +3 -0
- package/dist/types/modules/checkout/constant.d.ts +12 -0
- package/dist/types/modules/checkout/customer-prefill.d.ts +4 -1
- package/dist/types/modules/checkout/express-wallet.d.ts +12 -0
- package/dist/types/modules/checkout/styles/delivery-method.style.d.ts +1 -0
- package/dist/types/modules/checkout/styles/express-checkout.style.d.ts +1 -0
- package/dist/types/modules/checkout/styles/express-completion.style.d.ts +1 -0
- package/dist/types/modules/product/components/index.d.ts +1 -0
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-delivery-estimate.component.d.ts +11 -0
- package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/product-fulfillment-text.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +1 -0
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +10 -10
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
- package/dist/types/modules/ui-components/input/input.component.d.ts +1 -1
- package/dist/types/utils/format.d.ts +4 -0
- package/dist/types/utils/product.d.ts +4 -1
- package/docs/v1/api/actions/checkout-actions.md +3 -1
- package/docs/v1/api/client.md +49 -0
- package/docs/v1/api/configuration.md +7 -1
- package/docs/v1/api/typescript-types.md +10 -1
- package/docs/v1/guides/accessibility.md +29 -0
- package/docs/v1/guides/checkout-component.md +77 -3
- package/docs/v1/guides/events.md +35 -0
- package/docs/v1/guides/product-component.md +9 -0
- package/docs/v1/guides/theming.md +1 -0
- package/docs/v1/reference/analytics.md +14 -2
- package/package.json +7 -7
package/dist/ssr-stub.esm.js
CHANGED
|
@@ -128,6 +128,7 @@ const ELEMENTS_ACTIONS_EVENT = {
|
|
|
128
128
|
CHECKOUT_ITEM_QUANTITY_INCREASE: 'checkout_item_quantity_increase',
|
|
129
129
|
CHECKOUT_ITEM_QUANTITY_DECREASE: 'checkout_item_quantity_decrease',
|
|
130
130
|
CHECKOUT_ITEM_ENGRAVING_UPDATED: 'checkout_item_engraving_updated',
|
|
131
|
+
CHECKOUT_DELIVERY_METHOD_UPDATED: 'checkout_delivery_method_updated',
|
|
131
132
|
CHECKOUT_TIP_UPDATED: 'checkout_tip_updated',
|
|
132
133
|
CHECKOUT_SUBMIT_STARTED: 'checkout_submit_started',
|
|
133
134
|
CHECKOUT_SUBMIT_COMPLETED: 'checkout_submit_completed',
|
|
@@ -140,6 +141,7 @@ const ELEMENTS_ACTIONS_EVENT = {
|
|
|
140
141
|
CHECKOUT_GIFT_CARD_FAILED: 'checkout_gift_card_failed',
|
|
141
142
|
CHECKOUT_PRODUCT_ADD_SUCCESS: 'checkout_product_add_success',
|
|
142
143
|
CHECKOUT_PRODUCT_ADD_FAILED: 'checkout_product_add_failed',
|
|
144
|
+
CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY: 'checkout_express_checkout_availability',
|
|
143
145
|
};
|
|
144
146
|
const ELEMENTS_FORM = {
|
|
145
147
|
CUSTOMER: 'customer',
|
|
@@ -169,6 +171,7 @@ const COMPONENT_TYPE = {
|
|
|
169
171
|
PRODUCT_RETAILERS_CAROUSEL: 'product-retailers-carousel',
|
|
170
172
|
PRODUCT_RETAILERS_POPUP: 'product-retailers-popup',
|
|
171
173
|
PRODUCT_RETAILERS_POPUP_LIST: 'product-retailers-popup-list',
|
|
174
|
+
PRODUCT_DELIVERY_ESTIMATE: 'product-delivery-estimate',
|
|
172
175
|
PRODUCT_PRICE: 'product-price',
|
|
173
176
|
PRODUCT_ADD_TO_CART_SECTION: 'product-add-to-cart-section',
|
|
174
177
|
PRODUCT_DRAWER: 'product-drawer',
|
|
@@ -196,6 +199,7 @@ const COMPONENT_TYPE = {
|
|
|
196
199
|
CHECKOUT_INFORMATION: 'checkout-information',
|
|
197
200
|
CHECKOUT_STRIPE_HANDLER: 'checkout-stripe-handler',
|
|
198
201
|
CHECKOUT_STRIPE_FORM: 'checkout-stripe-form',
|
|
202
|
+
CHECKOUT_DELIVERY_METHOD: 'checkout-delivery-method',
|
|
199
203
|
CHECKOUT_PAYMENT: 'checkout-payment',
|
|
200
204
|
CHECKOUT_PAYMENT_SUMMARY: 'checkout-payment-summary',
|
|
201
205
|
CHECKOUT_BILLING: 'checkout-billing',
|
|
@@ -219,6 +223,8 @@ const COMPONENT_TYPE = {
|
|
|
219
223
|
CHECKOUT_PRESALE_COUNTDOWN: 'checkout-presale-countdown',
|
|
220
224
|
CHECKOUT_PRESALE_EXPIRED: 'checkout-presale-expired',
|
|
221
225
|
CHECKOUT_SEND_AS_GIFT: 'checkout-send-as-gift',
|
|
226
|
+
CHECKOUT_EXPRESS_CHECKOUT: 'checkout-express-checkout',
|
|
227
|
+
CHECKOUT_EXPRESS_COMPLETION: 'checkout-express-completion',
|
|
222
228
|
};
|
|
223
229
|
const FULFILLMENT_TYPE = {
|
|
224
230
|
ON_DEMAND: 'onDemand',
|
|
@@ -45,6 +45,7 @@ export declare abstract class ElementsBaseClient {
|
|
|
45
45
|
private initializeHeavyServices;
|
|
46
46
|
get actions(): ILiquidCommerceElementsActions;
|
|
47
47
|
protected processInjectElement(params: IProcessInjectElementParams): Promise<IInjectedComponent | null>;
|
|
48
|
+
private loadCheckoutForExpressCheckout;
|
|
48
49
|
protected processInjectProduct(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
49
50
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
50
51
|
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ComponentType } from '@/enums';
|
|
2
|
-
import type { ICartComponent } from '@/interfaces/configs';
|
|
2
|
+
import type { ICartComponent, ICheckoutComponent } from '@/interfaces/configs';
|
|
3
3
|
export declare function normalizeProductListLists<T extends Record<string, any>>(data: T): T;
|
|
4
4
|
export declare function withCartLayoutDefaults(cart: ICartComponent): ICartComponent;
|
|
5
|
+
export declare function withCheckoutLayoutDefaults(checkout: ICheckoutComponent): ICheckoutComponent;
|
|
5
6
|
export declare function deepMergeConfigs<T extends Record<string, any>>(target: T, source: Partial<T>, currentPath?: string): T;
|
|
6
7
|
export declare const layoutFieldToComponentTypes: Map<string, ComponentType[]>;
|
|
7
8
|
export declare function getComponentTypesForLayoutFields(parentPath: string, layoutFields: Record<string, any>): ComponentType[];
|
|
@@ -3,7 +3,7 @@ import type { AuthClientService } from '@/core/api/auth-client.service';
|
|
|
3
3
|
import type { IPersistedStore, IPersistedStoreAction } from '@/core/store/interfaces/core.interface';
|
|
4
4
|
import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
|
|
5
5
|
import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
|
|
6
|
-
import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse, ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
|
|
6
|
+
import type { CheckoutPaymentSessionType, IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse, ICheckoutComplete, ICheckoutFulfillmentParams, ICheckoutFulfillmentResponse, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
|
|
7
7
|
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
8
8
|
import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
9
9
|
export declare class ApiClientService {
|
|
@@ -24,8 +24,12 @@ export declare class ApiClientService {
|
|
|
24
24
|
updateCart(params: ICartUpdateParams): Promise<ApiResult<ICart>>;
|
|
25
25
|
prepareCheckout(params: ICheckoutPrepareParams): Promise<ApiResult<ICheckoutPrepare>>;
|
|
26
26
|
updateCheckoutItems(params: ICheckoutItemsUpdateParams): Promise<ApiResult<ICheckoutItemsUpdateResponse>>;
|
|
27
|
-
|
|
27
|
+
checkoutFulfillment(params: ICheckoutFulfillmentParams): Promise<ApiResult<ICheckoutFulfillmentResponse>>;
|
|
28
|
+
getPaymentSession(cartId: string, params?: {
|
|
29
|
+
checkoutToken?: string;
|
|
30
|
+
sessionType?: CheckoutPaymentSessionType;
|
|
31
|
+
}): Promise<ApiResult<ICheckoutPaymentSession>>;
|
|
28
32
|
confirmPaymentSession(params: ICheckoutPaymentConfirmParams): Promise<ApiResult<ICheckoutPaymentConfirm>>;
|
|
29
33
|
addAnonymousProduct(params: IAnonymousCheckoutAddProductParams): Promise<ApiResult<IAnonymousCheckoutAddProductResponse>>;
|
|
30
|
-
checkoutComplete(token: string, payment?: string): Promise<ApiResult<ICheckoutComplete>>;
|
|
34
|
+
checkoutComplete(token: string, payment?: string, expressPaymentIntentId?: string): Promise<ApiResult<ICheckoutComplete>>;
|
|
31
35
|
}
|
|
@@ -38,6 +38,12 @@ export interface ICheckoutTipUpdatedEventData {
|
|
|
38
38
|
tip: number;
|
|
39
39
|
}>;
|
|
40
40
|
}
|
|
41
|
+
export interface ICheckoutDeliveryMethodUpdatedEventData {
|
|
42
|
+
cartId: string;
|
|
43
|
+
fulfillmentType: string;
|
|
44
|
+
previousFulfillmentType: string;
|
|
45
|
+
fulfillmentId: string;
|
|
46
|
+
}
|
|
41
47
|
export interface ICheckoutFailedEventData {
|
|
42
48
|
message: string;
|
|
43
49
|
}
|
|
@@ -107,3 +113,8 @@ export interface ICheckoutProductAddFailedEventData {
|
|
|
107
113
|
error: string;
|
|
108
114
|
isPresale?: boolean;
|
|
109
115
|
}
|
|
116
|
+
export interface ICheckoutExpressCheckoutAvailabilityEventData {
|
|
117
|
+
cartId: string;
|
|
118
|
+
available: boolean;
|
|
119
|
+
wallets: string[];
|
|
120
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAddressActionEventData, IAddressFailedEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
2
2
|
import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartShopRetailerEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutDeliveryMethodUpdatedEventData, ICheckoutExpressCheckoutAvailabilityEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
4
4
|
import type { IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
5
5
|
import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
|
|
6
6
|
export interface IElementsClientIsReadyEventData {
|
|
@@ -69,6 +69,7 @@ export interface IElementsActionsEventsMap {
|
|
|
69
69
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
|
|
70
70
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
|
|
71
71
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_ENGRAVING_UPDATED]: ICheckoutItemEngravingUpdatedEventData;
|
|
72
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_DELIVERY_METHOD_UPDATED]: ICheckoutDeliveryMethodUpdatedEventData;
|
|
72
73
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_TIP_UPDATED]: ICheckoutTipUpdatedEventData;
|
|
73
74
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_SUBMIT_STARTED]: ICheckoutSubmitStartedEventData;
|
|
74
75
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_SUBMIT_COMPLETED]: ICheckoutSubmitCompletedEventData;
|
|
@@ -81,6 +82,7 @@ export interface IElementsActionsEventsMap {
|
|
|
81
82
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_CARD_FAILED]: ICheckoutGiftCardFailedEventData;
|
|
82
83
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_SUCCESS]: ICheckoutProductAddEventData;
|
|
83
84
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_FAILED]: ICheckoutProductAddFailedEventData;
|
|
85
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY]: ICheckoutExpressCheckoutAvailabilityEventData;
|
|
84
86
|
}
|
|
85
87
|
export type SpecificActionEvent = keyof IElementsActionsEventsMap;
|
|
86
88
|
export interface IFormEventData {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutFulfillmentMethod, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
|
|
2
2
|
export interface ICheckoutItemStore extends ICheckoutItem {
|
|
3
3
|
loading: boolean;
|
|
4
4
|
updating: boolean;
|
|
@@ -20,6 +20,14 @@ export interface ICheckoutPaymentMethodStore extends ICheckoutPaymentConfirm {
|
|
|
20
20
|
}
|
|
21
21
|
export interface ICheckoutPaymentSessionStore extends ICheckoutPaymentSession {
|
|
22
22
|
}
|
|
23
|
+
export type CheckoutExpressStatus = 'idle' | 'preparing' | 'birthDate' | 'completing' | 'failed';
|
|
24
|
+
export interface ICheckoutExpressStore {
|
|
25
|
+
status: CheckoutExpressStatus;
|
|
26
|
+
wallet: string | null;
|
|
27
|
+
intentId: string | null;
|
|
28
|
+
approvedTotal: number | null;
|
|
29
|
+
error: string | null;
|
|
30
|
+
}
|
|
23
31
|
export interface ICheckoutPaymentFormStore {
|
|
24
32
|
paymentSession: ICheckoutPaymentSessionStore | null;
|
|
25
33
|
paymentMethod: ICheckoutPaymentMethodStore | null;
|
|
@@ -29,6 +37,13 @@ export interface ICheckoutPaymentFormStore {
|
|
|
29
37
|
isValid: boolean;
|
|
30
38
|
isSaving: boolean;
|
|
31
39
|
}
|
|
40
|
+
export interface ICheckoutDeliveryMethodStore {
|
|
41
|
+
methods: ICheckoutFulfillmentMethod[];
|
|
42
|
+
isExpanded: boolean;
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
isSwitching: boolean;
|
|
45
|
+
error: string | null;
|
|
46
|
+
}
|
|
32
47
|
export interface ICheckoutStore {
|
|
33
48
|
initialized: boolean;
|
|
34
49
|
token: string;
|
|
@@ -37,10 +52,12 @@ export interface ICheckoutStore {
|
|
|
37
52
|
isGift: boolean;
|
|
38
53
|
marketingPreferences: ICheckoutMarketingPreferences;
|
|
39
54
|
appliedSavedMarketingPreferences: Partial<ICheckoutMarketingPreferences>;
|
|
55
|
+
deliveryMethod: ICheckoutDeliveryMethodStore;
|
|
40
56
|
customerForm: ICheckoutCustomerFormStore;
|
|
41
57
|
giftRecipientForm: ICheckoutGiftRecipientFormStore;
|
|
42
58
|
paymentForm: ICheckoutPaymentFormStore;
|
|
43
59
|
injectedPaymentMethod: ICheckoutPaymentMethodStore | null;
|
|
60
|
+
express: ICheckoutExpressStore;
|
|
44
61
|
shippingAddress: ICheckoutShippingAddress;
|
|
45
62
|
promoCode: ICheckoutPromoCode | null;
|
|
46
63
|
giftCards: ICheckoutGiftCard[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
2
|
import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutCustomerFormStore, ICheckoutDeliveryMethodStore, ICheckoutExpressStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { ICheckoutInjection, ICheckoutMetadata, IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
5
5
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
6
|
import type { IPLProductStore, IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
@@ -36,7 +36,7 @@ export interface IPersistedStore {
|
|
|
36
36
|
export interface IPersistedStoreAction {
|
|
37
37
|
success: boolean;
|
|
38
38
|
}
|
|
39
|
-
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof ICartRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof ICartFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCode}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.presale.${keyof ICheckoutPresale}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferences}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipient}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCode}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.retailers.${string}` | `checkout.retailers.${string}.${keyof ICheckoutRetailer}` | `checkout.fulfillments.${string}` | `productsList.${string}` | `productsList.${string}.${keyof IProductListStore}` | `productsList.${string}.products.${string}` | `productsList.${string}.products.${string}.${keyof IPLProductStore}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}`;
|
|
39
|
+
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof ICartRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof ICartFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCode}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.deliveryMethod.${keyof ICheckoutDeliveryMethodStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.express.${keyof ICheckoutExpressStore}` | `checkout.presale.${keyof ICheckoutPresale}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferences}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipient}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCode}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.retailers.${string}` | `checkout.retailers.${string}.${keyof ICheckoutRetailer}` | `checkout.fulfillments.${string}` | `productsList.${string}` | `productsList.${string}.${keyof IProductListStore}` | `productsList.${string}.products.${string}` | `productsList.${string}.products.${string}.${keyof IPLProductStore}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}`;
|
|
40
40
|
interface MiddlewareContext {
|
|
41
41
|
action: string;
|
|
42
42
|
payload: any;
|
|
@@ -47,6 +47,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
47
47
|
readonly CHECKOUT_ITEM_QUANTITY_INCREASE: "checkout_item_quantity_increase";
|
|
48
48
|
readonly CHECKOUT_ITEM_QUANTITY_DECREASE: "checkout_item_quantity_decrease";
|
|
49
49
|
readonly CHECKOUT_ITEM_ENGRAVING_UPDATED: "checkout_item_engraving_updated";
|
|
50
|
+
readonly CHECKOUT_DELIVERY_METHOD_UPDATED: "checkout_delivery_method_updated";
|
|
50
51
|
readonly CHECKOUT_TIP_UPDATED: "checkout_tip_updated";
|
|
51
52
|
readonly CHECKOUT_SUBMIT_STARTED: "checkout_submit_started";
|
|
52
53
|
readonly CHECKOUT_SUBMIT_COMPLETED: "checkout_submit_completed";
|
|
@@ -59,6 +60,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
59
60
|
readonly CHECKOUT_GIFT_CARD_FAILED: "checkout_gift_card_failed";
|
|
60
61
|
readonly CHECKOUT_PRODUCT_ADD_SUCCESS: "checkout_product_add_success";
|
|
61
62
|
readonly CHECKOUT_PRODUCT_ADD_FAILED: "checkout_product_add_failed";
|
|
63
|
+
readonly CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY: "checkout_express_checkout_availability";
|
|
62
64
|
};
|
|
63
65
|
export declare const ELEMENTS_FORM: {
|
|
64
66
|
readonly CUSTOMER: "customer";
|
|
@@ -88,6 +90,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
88
90
|
readonly PRODUCT_RETAILERS_CAROUSEL: "product-retailers-carousel";
|
|
89
91
|
readonly PRODUCT_RETAILERS_POPUP: "product-retailers-popup";
|
|
90
92
|
readonly PRODUCT_RETAILERS_POPUP_LIST: "product-retailers-popup-list";
|
|
93
|
+
readonly PRODUCT_DELIVERY_ESTIMATE: "product-delivery-estimate";
|
|
91
94
|
readonly PRODUCT_PRICE: "product-price";
|
|
92
95
|
readonly PRODUCT_ADD_TO_CART_SECTION: "product-add-to-cart-section";
|
|
93
96
|
readonly PRODUCT_DRAWER: "product-drawer";
|
|
@@ -115,6 +118,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
115
118
|
readonly CHECKOUT_INFORMATION: "checkout-information";
|
|
116
119
|
readonly CHECKOUT_STRIPE_HANDLER: "checkout-stripe-handler";
|
|
117
120
|
readonly CHECKOUT_STRIPE_FORM: "checkout-stripe-form";
|
|
121
|
+
readonly CHECKOUT_DELIVERY_METHOD: "checkout-delivery-method";
|
|
118
122
|
readonly CHECKOUT_PAYMENT: "checkout-payment";
|
|
119
123
|
readonly CHECKOUT_PAYMENT_SUMMARY: "checkout-payment-summary";
|
|
120
124
|
readonly CHECKOUT_BILLING: "checkout-billing";
|
|
@@ -138,6 +142,8 @@ export declare const COMPONENT_TYPE: {
|
|
|
138
142
|
readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
|
|
139
143
|
readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
|
|
140
144
|
readonly CHECKOUT_SEND_AS_GIFT: "checkout-send-as-gift";
|
|
145
|
+
readonly CHECKOUT_EXPRESS_CHECKOUT: "checkout-express-checkout";
|
|
146
|
+
readonly CHECKOUT_EXPRESS_COMPLETION: "checkout-express-completion";
|
|
141
147
|
};
|
|
142
148
|
export type ComponentType = (typeof COMPONENT_TYPE)[keyof typeof COMPONENT_TYPE];
|
|
143
149
|
export declare const FULFILLMENT_TYPE: {
|
|
@@ -4,5 +4,6 @@ import { DEBUG_MODE, ELEMENTS_ENV } from '@/enums';
|
|
|
4
4
|
import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/interfaces/client.interface';
|
|
5
5
|
import type { IInjectedComponent } from '@/interfaces/component.interface';
|
|
6
6
|
import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/config.interface';
|
|
7
|
-
|
|
7
|
+
import type { IInjectCheckoutParams, IInjectExpressCheckoutParams } from '@/interfaces/injection.interface';
|
|
8
|
+
export type { DebugMode, ElementsEnv, IElementsCheckoutActions, IElementsCheckoutClient, IInjectCheckoutParams, IInjectExpressCheckoutParams, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig, };
|
|
8
9
|
export { DEBUG_MODE, ELEMENTS_ENV, ElementsCheckout };
|
|
@@ -5,6 +5,11 @@ import type { IProductPresale } from '@/interfaces/api/product.interface';
|
|
|
5
5
|
export interface ICheckoutComplete {
|
|
6
6
|
orderNumber: string;
|
|
7
7
|
}
|
|
8
|
+
export declare const CHECKOUT_PAYMENT_SESSION_TYPE: {
|
|
9
|
+
readonly STANDARD: "standard";
|
|
10
|
+
readonly EXPRESS: "express";
|
|
11
|
+
};
|
|
12
|
+
export type CheckoutPaymentSessionType = (typeof CHECKOUT_PAYMENT_SESSION_TYPE)[keyof typeof CHECKOUT_PAYMENT_SESSION_TYPE];
|
|
8
13
|
export interface ICheckoutPaymentSession {
|
|
9
14
|
key: string;
|
|
10
15
|
secret: string;
|
|
@@ -12,6 +17,8 @@ export interface ICheckoutPaymentSession {
|
|
|
12
17
|
export interface ICheckoutPaymentConfirmParams {
|
|
13
18
|
confirmationTokenId: string;
|
|
14
19
|
setupIntentId: string;
|
|
20
|
+
sessionType?: CheckoutPaymentSessionType;
|
|
21
|
+
checkoutToken?: string;
|
|
15
22
|
}
|
|
16
23
|
export interface ICheckoutPaymentConfirmCard {
|
|
17
24
|
brand: string;
|
|
@@ -115,6 +122,31 @@ export interface IAnonymousCheckoutAddProductResponse {
|
|
|
115
122
|
checkout: ICheckoutPrepare | null;
|
|
116
123
|
unavailableItems: IAnonymousCheckoutUnavailableItem[];
|
|
117
124
|
}
|
|
125
|
+
export type CheckoutFulfillmentUnavailableReason = 'product_not_available' | 'product_not_supported' | 'fulfillment_not_available' | 'outside_operating_hours';
|
|
126
|
+
export interface ICheckoutFulfillmentMethod {
|
|
127
|
+
type: FulfillmentType;
|
|
128
|
+
available: boolean;
|
|
129
|
+
selected: boolean;
|
|
130
|
+
fee: number;
|
|
131
|
+
expectation: string;
|
|
132
|
+
engravingExpectation: string;
|
|
133
|
+
fulfillmentId: string;
|
|
134
|
+
partNumber: string;
|
|
135
|
+
retailerId: string;
|
|
136
|
+
reason: CheckoutFulfillmentUnavailableReason | null;
|
|
137
|
+
}
|
|
138
|
+
export type ICheckoutFulfillmentCarryOver = Omit<ICheckoutPrepareParams, 'cartId' | 'token' | 'deliveryTips' | 'deliveryInstructions'>;
|
|
139
|
+
export interface ICheckoutFulfillmentParams {
|
|
140
|
+
cartId: string;
|
|
141
|
+
location: ILocation;
|
|
142
|
+
fulfillmentType?: FulfillmentType;
|
|
143
|
+
checkout?: ICheckoutFulfillmentCarryOver;
|
|
144
|
+
}
|
|
145
|
+
export interface ICheckoutFulfillmentResponse {
|
|
146
|
+
methods: ICheckoutFulfillmentMethod[];
|
|
147
|
+
cart: ICart | null;
|
|
148
|
+
checkout: ICheckoutPrepare | null;
|
|
149
|
+
}
|
|
118
150
|
export interface ICheckoutAmounts {
|
|
119
151
|
subtotal: number;
|
|
120
152
|
engraving: number;
|
|
@@ -6,7 +6,7 @@ import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
|
6
6
|
import type { IAddressOptions } from '@/modules/address/address.interface';
|
|
7
7
|
import type { IInjectedComponent } from './component.interface';
|
|
8
8
|
import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
|
|
9
|
-
import type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams } from './injection.interface';
|
|
9
|
+
import type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectExpressCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams } from './injection.interface';
|
|
10
10
|
export interface ILiquidCommerceElementsUIMethod {
|
|
11
11
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
12
12
|
floatingCartButton(showItemsCount?: boolean): void;
|
|
@@ -25,6 +25,7 @@ export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCh
|
|
|
25
25
|
}
|
|
26
26
|
export interface IElementsCheckoutClient {
|
|
27
27
|
injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
28
|
+
injectExpressCheckout: (params: IInjectExpressCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
28
29
|
actions: {
|
|
29
30
|
checkout: IElementsCheckoutActions;
|
|
30
31
|
};
|
|
@@ -51,6 +52,7 @@ export interface ILiquidCommerceElementsClient {
|
|
|
51
52
|
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
52
53
|
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
53
54
|
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
55
|
+
injectExpressCheckoutElement(params: IInjectExpressCheckoutParams): Promise<IInjectedComponent | null>;
|
|
54
56
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
55
57
|
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
56
58
|
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
@@ -12,6 +12,7 @@ export interface ICheckoutLayout {
|
|
|
12
12
|
emailOptIn: ICheckoutMarketingOptIn;
|
|
13
13
|
smsOptIn: ICheckoutMarketingOptIn;
|
|
14
14
|
allowGiftCards: boolean;
|
|
15
|
+
requireBirthDate?: boolean;
|
|
15
16
|
legalMessage: ICheckoutLegalMessage;
|
|
16
17
|
continueShoppingUrl: string;
|
|
17
18
|
exitUrl: string;
|
|
@@ -15,6 +15,8 @@ export interface IProductLayout {
|
|
|
15
15
|
enableShippingFulfillment: boolean;
|
|
16
16
|
enableOnDemandFulfillment: boolean;
|
|
17
17
|
primaryFulfillmentMethod: FulfillmentType;
|
|
18
|
+
showOnlyOneRetailer: boolean;
|
|
19
|
+
hideRetailerName: boolean;
|
|
18
20
|
addToCartButtonText: string;
|
|
19
21
|
addToCartButtonShowTotalPrice: boolean;
|
|
20
22
|
buyNowButtonText: string;
|
|
@@ -38,12 +38,18 @@ export interface IProcessInjectElementParams {
|
|
|
38
38
|
options?: IAddressOptions;
|
|
39
39
|
checkoutId?: string;
|
|
40
40
|
hideHeader?: boolean;
|
|
41
|
+
variant?: 'section' | 'buttons';
|
|
41
42
|
}
|
|
42
43
|
export interface IInjectCheckoutParams {
|
|
43
44
|
containerId: string;
|
|
44
45
|
checkoutId?: string;
|
|
45
46
|
hideHeader?: boolean;
|
|
46
47
|
}
|
|
48
|
+
export interface IInjectExpressCheckoutParams {
|
|
49
|
+
containerId: string;
|
|
50
|
+
checkoutId?: string;
|
|
51
|
+
variant?: 'section' | 'buttons';
|
|
52
|
+
}
|
|
47
53
|
export interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
|
|
48
54
|
simulatePresale?: boolean;
|
|
49
55
|
presaleExpiresInMinutes?: number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
2
|
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
3
|
import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
|
-
import type {
|
|
4
|
+
import type { FulfillmentType } from '@/enums';
|
|
5
|
+
import type { CheckoutPaymentSessionType, ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPaymentSession, ICheckoutPrepare } from '@/interfaces/api/checkout.interface';
|
|
5
6
|
import type { AddItemParams } from '@/modules/cart/cart.commands';
|
|
6
7
|
import type { PresaleExpiredReason } from '@/modules/checkout/components';
|
|
8
|
+
import { type IExpressWalletBillingDetails } from '@/modules/checkout/express-wallet';
|
|
7
9
|
export declare class CheckoutCommands extends BaseCommand {
|
|
8
10
|
private readonly uiCommands;
|
|
9
11
|
private lastLoadParams;
|
|
@@ -19,8 +21,11 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
19
21
|
private customerEditRevision;
|
|
20
22
|
private customerEditedGeneration;
|
|
21
23
|
private confirmedPayment;
|
|
24
|
+
private expressHandoff;
|
|
25
|
+
private get requiresBirthDate();
|
|
22
26
|
assertPaymentReady(): void;
|
|
23
27
|
retryLoadCheckout(): Promise<void>;
|
|
28
|
+
private paymentSessionRequest;
|
|
24
29
|
constructor();
|
|
25
30
|
static getInstance(): CheckoutCommands;
|
|
26
31
|
addPresaleItem(params: AddItemParams): Promise<void>;
|
|
@@ -46,7 +51,9 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
46
51
|
private applySavedMarketingPreferences;
|
|
47
52
|
toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<boolean>;
|
|
48
53
|
getPaymentSession(): Promise<void>;
|
|
49
|
-
|
|
54
|
+
getExpressPaymentSession(): Promise<ICheckoutPaymentSession | null>;
|
|
55
|
+
private requestPaymentSession;
|
|
56
|
+
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string, sessionType?: CheckoutPaymentSessionType): Promise<ICheckoutPaymentMethodStore>;
|
|
50
57
|
applyPromoCode(code: string): Promise<void>;
|
|
51
58
|
removePromoCode(): Promise<void>;
|
|
52
59
|
clearPromoCodeError(): Promise<void>;
|
|
@@ -87,11 +94,39 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
87
94
|
paymentSession?: {
|
|
88
95
|
confirmationTokenId: string;
|
|
89
96
|
setupIntentId: string;
|
|
97
|
+
sessionType?: CheckoutPaymentSessionType;
|
|
90
98
|
};
|
|
91
99
|
}): Promise<void>;
|
|
92
100
|
private prepareMarketingForCompletion;
|
|
93
|
-
|
|
101
|
+
beginExpressCompletion({ wallet, confirmationTokenId, intentId, approvedTotal, billingDetails, }: {
|
|
102
|
+
wallet: string;
|
|
103
|
+
confirmationTokenId: string;
|
|
104
|
+
intentId: string;
|
|
105
|
+
approvedTotal: number;
|
|
106
|
+
billingDetails: IExpressWalletBillingDetails | undefined;
|
|
107
|
+
}): Promise<void>;
|
|
108
|
+
private prepareExpressPayment;
|
|
109
|
+
completeExpressOrder(birthDate?: string): Promise<void>;
|
|
110
|
+
cancelExpressCompletion(): void;
|
|
111
|
+
private saveExpressCustomer;
|
|
112
|
+
private assertApprovedTotal;
|
|
113
|
+
private setExpressStatus;
|
|
114
|
+
private failExpressCompletion;
|
|
115
|
+
private writeExpress;
|
|
116
|
+
checkoutComplete(options?: {
|
|
117
|
+
expressPaymentIntentId?: string;
|
|
118
|
+
}): Promise<void>;
|
|
94
119
|
private updateStoreFromCheckoutResponse;
|
|
120
|
+
private getDeliveryMethodLocation;
|
|
121
|
+
loadDeliveryMethods(): Promise<void>;
|
|
122
|
+
toggleDeliveryMethod(): void;
|
|
123
|
+
switchDeliveryMethod(fulfillmentType: FulfillmentType): Promise<void>;
|
|
124
|
+
private watchForReturnFromAddress;
|
|
125
|
+
relocateCheckout(): Promise<void>;
|
|
126
|
+
private requestFulfillment;
|
|
127
|
+
private deliveryMethodCarryOver;
|
|
128
|
+
private refreshPaymentAfterDeliveryMethodSwitch;
|
|
129
|
+
changeDeliveryLocation(trigger?: HTMLElement | null): void;
|
|
95
130
|
private syncFromItemUpdate;
|
|
96
131
|
private syncCheckoutState;
|
|
97
132
|
private refreshCheckout;
|
|
@@ -7,6 +7,7 @@ export declare class CheckoutBuyer extends BaseComponent<null, ICheckoutComponen
|
|
|
7
7
|
get hostClasses(): string[];
|
|
8
8
|
constructor();
|
|
9
9
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
10
|
+
private get requiresBirthDate();
|
|
10
11
|
private updateSaveButtonState;
|
|
11
12
|
protected template(): HTMLElement[];
|
|
12
13
|
}
|
|
@@ -8,6 +8,7 @@ export declare class CheckoutDeliverToComponent extends BaseComponent<null, IChe
|
|
|
8
8
|
get hostClasses(): string[];
|
|
9
9
|
constructor();
|
|
10
10
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
11
|
+
private get requiresBirthDate();
|
|
11
12
|
private updateSaveButtonState;
|
|
12
13
|
protected template(): HTMLElement[];
|
|
13
14
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutDeliveryMethodComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
get hostClasses(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
protected connected(): void;
|
|
7
|
+
onStoreWatch(): void;
|
|
8
|
+
private hasOrderMoved;
|
|
9
|
+
private isSameAddress;
|
|
10
|
+
protected afterRender(): void;
|
|
11
|
+
protected template(): HTMLElement[];
|
|
12
|
+
private createHeader;
|
|
13
|
+
private createSummaryRow;
|
|
14
|
+
private createOptions;
|
|
15
|
+
private createOptionCard;
|
|
16
|
+
private createOptionTitleRow;
|
|
17
|
+
private describeOption;
|
|
18
|
+
private describeUnavailable;
|
|
19
|
+
private describeForScreenReader;
|
|
20
|
+
private createChangeLocationButton;
|
|
21
|
+
private formatFee;
|
|
22
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export interface ICheckoutExpressCheckoutComponentParams {
|
|
4
|
+
variant?: 'section' | 'buttons';
|
|
5
|
+
isIndependentComponent?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class CheckoutExpressCheckoutComponent extends BaseComponent<ICheckoutExpressCheckoutComponentParams, ICheckoutComponent> {
|
|
8
|
+
private section;
|
|
9
|
+
private walletHost;
|
|
10
|
+
private completionElement;
|
|
11
|
+
private stripe;
|
|
12
|
+
private stripeElements;
|
|
13
|
+
private expressElement;
|
|
14
|
+
private sessionSecret;
|
|
15
|
+
private expressSession;
|
|
16
|
+
private sessionAmount;
|
|
17
|
+
private isMounting;
|
|
18
|
+
private isProcessing;
|
|
19
|
+
private hasAvailableWallets;
|
|
20
|
+
private availableWallets;
|
|
21
|
+
private hasSettledAvailability;
|
|
22
|
+
private lastPublishedAvailability;
|
|
23
|
+
get hostClasses(): string[];
|
|
24
|
+
constructor();
|
|
25
|
+
protected onStoreWatch(): void;
|
|
26
|
+
private syncCompletionView;
|
|
27
|
+
private get isCompletingExpress();
|
|
28
|
+
private get isButtonsOnly();
|
|
29
|
+
private get isReadyForPayment();
|
|
30
|
+
private get isGiftOrder();
|
|
31
|
+
protected template(): HTMLElement[];
|
|
32
|
+
protected afterRender(): void;
|
|
33
|
+
private createDividerLine;
|
|
34
|
+
private updateVisibility;
|
|
35
|
+
private publishAvailability;
|
|
36
|
+
private reportUnavailable;
|
|
37
|
+
private mountExpressElement;
|
|
38
|
+
private ensurePaymentSession;
|
|
39
|
+
private createWalletHost;
|
|
40
|
+
private findRootComponent;
|
|
41
|
+
private get orderTotal();
|
|
42
|
+
private buildElementsOptions;
|
|
43
|
+
private readIntentTerms;
|
|
44
|
+
private normaliseFutureUsage;
|
|
45
|
+
private buildAppearance;
|
|
46
|
+
private buildElementOptions;
|
|
47
|
+
private buildLineItems;
|
|
48
|
+
private readAvailability;
|
|
49
|
+
private handleAvailability;
|
|
50
|
+
private handleClick;
|
|
51
|
+
private hasUnmetMinimums;
|
|
52
|
+
private handleConfirm;
|
|
53
|
+
private isTotalUnchanged;
|
|
54
|
+
private toBillingDetails;
|
|
55
|
+
private failPayment;
|
|
56
|
+
private handleCancel;
|
|
57
|
+
private loadStripeJS;
|
|
58
|
+
private teardownExpressElement;
|
|
59
|
+
private remountIfTotalMoved;
|
|
60
|
+
protected disconnected(): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutExpressCompletionComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
private birthDate;
|
|
5
|
+
private isBirthDateValid;
|
|
6
|
+
private completeButton;
|
|
7
|
+
private announcedState;
|
|
8
|
+
private hasFocusedHeading;
|
|
9
|
+
constructor();
|
|
10
|
+
get hostClasses(): string[];
|
|
11
|
+
private get express();
|
|
12
|
+
private get needsBirthDate();
|
|
13
|
+
protected afterRender(): void;
|
|
14
|
+
protected template(): HTMLElement[];
|
|
15
|
+
private headingFor;
|
|
16
|
+
private copyFor;
|
|
17
|
+
private createDots;
|
|
18
|
+
private createBirthDateInput;
|
|
19
|
+
private createCompleteButton;
|
|
20
|
+
private createBackLink;
|
|
21
|
+
}
|
|
@@ -2,18 +2,12 @@ import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.servi
|
|
|
2
2
|
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
3
|
export declare class CheckoutPlaceOrderButtonComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
4
|
private placeOrderButton;
|
|
5
|
-
private errorContainer;
|
|
6
|
-
private errorTimeoutId;
|
|
7
5
|
private lastButtonState;
|
|
8
|
-
private lastAnnouncedError;
|
|
9
6
|
get hostClasses(): string[];
|
|
10
7
|
constructor();
|
|
11
8
|
afterRender(): void;
|
|
12
|
-
disconnected(): void;
|
|
13
9
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
14
10
|
private updateButtonState;
|
|
15
|
-
private clearErrorTimeout;
|
|
16
|
-
private updateErrorDisplay;
|
|
17
11
|
private determineButtonState;
|
|
18
12
|
private handlePlaceOrderClick;
|
|
19
13
|
protected template(): HTMLElement[];
|
|
@@ -5,6 +5,9 @@ export * from './checkout-buyer-summary.component';
|
|
|
5
5
|
export * from './checkout-completed.component';
|
|
6
6
|
export * from './checkout-deliver-to.component';
|
|
7
7
|
export * from './checkout-deliver-to-summary.component';
|
|
8
|
+
export * from './checkout-delivery-method.component';
|
|
9
|
+
export * from './checkout-express-checkout.component';
|
|
10
|
+
export * from './checkout-express-completion.component';
|
|
8
11
|
export * from './checkout-gift-cards.component';
|
|
9
12
|
export * from './checkout-header.component';
|
|
10
13
|
export * from './checkout-information.component';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type FulfillmentType } from '@/enums';
|
|
1
2
|
export declare const STRIPE_SLOT_NAME = "lce-checkout-stripe-slot";
|
|
3
|
+
export declare const STRIPE_MINIMUM_CHARGE = 50;
|
|
4
|
+
export declare const EXPRESS_CHECKOUT_SLOT_NAME = "lce-checkout-express-checkout-slot";
|
|
2
5
|
export declare const customerFormFields: {
|
|
3
6
|
readonly firstName: "firstName";
|
|
4
7
|
readonly lastName: "lastName";
|
|
@@ -31,3 +34,12 @@ export declare const billingFormFields: {
|
|
|
31
34
|
readonly zipCode: "zipCode";
|
|
32
35
|
};
|
|
33
36
|
export type BillingFieldName = (typeof billingFormFields)[keyof typeof billingFormFields];
|
|
37
|
+
export declare const DELIVERY_METHOD_LABEL: Record<FulfillmentType, string>;
|
|
38
|
+
export declare const DELIVERY_METHOD_COLLAPSED_LABEL: Record<FulfillmentType, string>;
|
|
39
|
+
export declare const DELIVERY_METHOD_UNAVAILABLE_COPY: Record<FulfillmentType, {
|
|
40
|
+
unavailable: string;
|
|
41
|
+
closed: string;
|
|
42
|
+
unsupported: string;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const DELIVERY_METHOD_FREE_SHIPPING_THRESHOLD = 5000;
|
|
45
|
+
export declare const CHANGE_LOCATION_FOCUS_KEY = "checkout-delivery-method-change-location";
|