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MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,OAQKC,EAA6BC,GAC/B1P,EAAkB0P,IAAgB","sources":["webpack://Msdyn365.Commerce.Online/./src/checkout-errors/checkout-errors.ts?a9e0","webpack://Msdyn365.Commerce.Online/../../src/checkout-state-data-action.ts?8344","webpack://Msdyn365.Commerce.Online/../../src/checkout-state.ts?acd8","webpack://Msdyn365.Commerce.Online/../../../src/module-state-manager/with-module-state.tsx?61ca","webpack://Msdyn365.Commerce.Online/../../../src/module-state-manager/module-state.ts?7579","webpack://Msdyn365.Commerce.Online/../../src/checkout-utilities.data.ts?b2cc","webpack://Msdyn365.Commerce.Online/./src/common/get-checkout-return-url.tsx?1758","webpack://Msdyn365.Commerce.Online/./src/common/index.ts?f3e7","webpack://Msdyn365.Commerce.Online/./src/common/empty-active-cart-invoice.tsx?0df8","webpack://Msdyn365.Commerce.Online/./src/common/place-order.tsx?8526","webpack://Msdyn365.Commerce.Online/./src/common/checkout.tsx?29a4","webpack://Msdyn365.Commerce.Online/./src/common/empty-active-cart.tsx?dc76","webpack://Msdyn365.Commerce.Online/./src/common/payment-instrument.dropin.style.ts?5102","webpack://Msdyn365.Commerce.Online/./src/common/add-payment-form.tsx?1cf5","webpack://Msdyn365.Commerce.Online/./src/common/error.tsx?096f","webpack://Msdyn365.Commerce.Online/./src/common/waiting.tsx?8095","webpack://Msdyn365.Commerce.Online/./src/common/payment-instrument-message.ts?53ea","webpack://Msdyn365.Commerce.Online/./src/common/with-visibility-observer.tsx?95e4","webpack://Msdyn365.Commerce.Online/./src/common/iframe.tsx?feca","webpack://Msdyn365.Commerce.Online/./src/common/country-codes.tsx?befd"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport {\n CheckoutModule,\n ErrorCode,\n ErrorLocation,\n ErrorMessageResource,\n getCheckoutState,\n ICheckoutError,\n ICheckoutState\n} from '@msdyn365-commerce/global-state/';\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class -- create global class\nexport class CheckoutErrors {\n public static readonly ActionError: ICheckoutError = {\n errorCode: ErrorCode.ActionError,\n errorMessageResource: ErrorMessageResource.checkoutTimeoutErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n errorMessageResource: ErrorMessageResource.blockedLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n errorMessageResource: ErrorMessageResource.customerAccountLimitSignDifferentFromAmountDueErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsAvailableCreditLimitErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_FraudRisk: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n errorMessageResource: ErrorMessageResource.fraudRiskErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n errorMessageResource: ErrorMessageResource.giftCardBalanceInquiryFailedErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n errorMessageResource: ErrorMessageResource.giftCardCurrencyMismatchErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n errorMessageResource: ErrorMessageResource.invalidCartVersionErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n errorMessageResource: ErrorMessageResource.invalidLoyaltyCardNumberErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n errorMessageResource: ErrorMessageResource.missingRequiredCartTenderLinesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n errorMessageResource: ErrorMessageResource.multipleCustomerAccountPaymentsNotAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n errorMessageResource: ErrorMessageResource.noMoreThanOneLoyaltyTenderErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n errorMessageResource: ErrorMessageResource.noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n errorMessageResource: ErrorMessageResource.noTenderLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n errorMessageResource: ErrorMessageResource.notEnoughRewardPointsErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n errorMessageResource: ErrorMessageResource.paymentAlreadyVoidedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n errorMessageResource: ErrorMessageResource.paymentAmountExceedsGiftBalanceErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n errorMessageResource: ErrorMessageResource.paymentUsingUnauthorizedAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n errorMessageResource: ErrorMessageResource.refundAmountMoreThanAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n errorMessageResource: ErrorMessageResource.unableToCancelPaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n errorMessageResource: ErrorMessageResource.unableToReadCardTokenInfoErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult,\n errorMessageResource: ErrorMessageResource.unableToRetrieveCardPaymentAcceptResultErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly checkoutErrorsList: ICheckoutError[] = [\n CheckoutErrors.ActionError,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult\n ];\n}\n\nexport async function setCheckoutErrors(\n errorCode: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n resources: any,\n isExpressCheckoutApplied: boolean,\n ctx: IActionContext,\n apiError?: string | undefined\n): Promise {\n let clientCheckoutError: ICheckoutError | undefined;\n const consoleCheckoutErrors: ICheckoutError[] = [];\n\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n // find the checkout errors\n for (const checkoutError of CheckoutErrors.checkoutErrorsList) {\n if (errorCode === checkoutError.errorCode) {\n if (checkoutError.errorLocation === ErrorLocation.Console) {\n const consoleCheckoutError: ICheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n consoleCheckoutErrors.push(consoleCheckoutError);\n } else {\n if (clientCheckoutError) {\n ctx.telemetry.exception(new Error('Invalid number of client checkout errors.'));\n throw new Error('Invalid number of client checkout errors.');\n } else {\n clientCheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n }\n }\n }\n }\n\n // log the console checkout errors\n for (const consoleCheckoutError of consoleCheckoutErrors) {\n consoleCheckoutError.errorMessage = getCheckoutErrorMessage(resources, consoleCheckoutError.errorMessageResource!, apiError!);\n console.log(consoleCheckoutError.errorMessage);\n }\n\n // handle the client checkout error\n if (clientCheckoutError) {\n clientCheckoutError.errorMessage = getCheckoutErrorMessage(resources, clientCheckoutError.errorMessageResource!, apiError!);\n\n if (isExpressCheckoutApplied && clientCheckoutError.errorLocation === ErrorLocation.CheckoutPaymentInstrument) {\n clientCheckoutError.errorLocation = ErrorLocation.Checkout;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: clientCheckoutError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n } else {\n // if could not map to any checkout error(s), show the API error message over generic error\n if (consoleCheckoutErrors.length === 0) {\n const genericError = {\n errorLocation: ErrorLocation.Checkout\n };\n if (apiError) {\n genericError['errorMessage'] = apiError;\n } else {\n genericError['errorMessage'] = resources.genericErrorMessage;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: genericError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n }\n }\n}\n\nexport async function focusOnCheckoutError(checkoutErrorRef: React.RefObject, ctx: IActionContext): Promise {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n checkoutErrorRef.current && checkoutErrorRef.current.scrollIntoView();\n\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule.None });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: false });\n}\n\nexport async function setCheckoutErrorFocus(checkoutModuleId: string, ctx: IActionContext): Promise {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n for (const checkoutModule of Object.keys(CheckoutModule)) {\n if (checkoutModuleId.includes(CheckoutModule[checkoutModule])) {\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule[checkoutModule] });\n return;\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getCheckoutErrorMessage(resources: any, errorMessageResource: ErrorMessageResource, errorMessageFromAPI: string): string {\n const errorResource = Object.keys(resources).find(resource => resource === errorMessageResource);\n // return API error when error resource string is not found in checkout definition file\n return errorResource !== undefined ? resources[errorResource] : errorMessageFromAPI;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { CheckoutState } from './checkout-state';\n\n/**\n * CheckoutState - action input.\n */\nexport class CheckoutStateInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('CheckoutState', this.apiSettings);\n\n public getCacheObjectType = () => 'CheckoutState';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CheckoutState - action.\n * @param input\n * @param ctx\n */\nexport async function checkoutStateAction(input: CheckoutStateInput, ctx: IActionContext): Promise {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction({\n action: >checkoutStateAction,\n input: createInput\n});\n\nexport default checkoutStateActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, GiftCard, Note, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class CheckoutState {\n @observable private _tokenizedPaymentCard: TokenizedPaymentCard | undefined;\n\n @computed public get tokenizedPaymentCard(): Readonly | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined;\n\n @computed public get billingAddress(): Readonly
| undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly
| undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly | undefined {\n return this._cardPrefix;\n }\n\n @observable private _giftCards: GiftCard[] = [];\n\n @computed public get giftCards(): readonly GiftCard[] {\n return this._giftCards;\n }\n\n @observable private _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): readonly IGiftCardExtend[] {\n return this._giftCardExtends;\n }\n\n @observable private _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n @observable private _customerReference: string = '';\n @observable private _customerRequisition: string = '';\n @observable private _note: Note = {};\n\n @computed public get guestCheckoutEmail(): Readonly | string {\n return this._guestCheckoutEmail;\n }\n\n @computed public get customerReference(): Readonly | string {\n return this._customerReference;\n }\n\n @computed public get customerRequisition(): Readonly | string {\n return this._customerRequisition;\n }\n\n @computed public get note(): Readonly | Note[] {\n return this._note;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly | number {\n return this._customerAccountAmount;\n }\n\n @action\n public updateTokenizedPaymentCard(newTokenizedPaymentCard: TokenizedPaymentCard): void {\n this._tokenizedPaymentCard = newTokenizedPaymentCard;\n }\n\n @action\n public updateTenderLine(newTenderLine: TenderLine | undefined): void {\n this._tenderLine = newTenderLine;\n }\n\n @action\n public updateShippingAddress(newShippingAddress: Address): void {\n this._shippingAddress = newShippingAddress;\n }\n\n @action\n public updateBillingAddress(newBillingAddress: Address): void {\n this._billingAddress = newBillingAddress;\n }\n\n @action\n public updateCardPrefix(newCardPrefix: string): void {\n this._cardPrefix = newCardPrefix;\n }\n\n @action\n public removeGiftCard(giftCardNumber: string): void {\n this._giftCards = this._giftCards.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public removeGiftCardExtend(giftCardNumber: string): void {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public addGiftCard(giftCard: GiftCard): void {\n this._giftCards = [giftCard, ...this._giftCards];\n }\n\n @action\n public addGiftCardExtend(giftCard: IGiftCardExtend): void {\n this._giftCardExtends = [giftCard, ...this._giftCards];\n }\n\n @action\n public updateLoyaltyCardNumber(newLoyaltyCardNumber: string): void {\n this._loyaltyCardNumber = newLoyaltyCardNumber;\n }\n\n @action\n public updateLoyaltyAmount(newAmount: number): void {\n this._loyaltyAmount = newAmount;\n }\n\n @action\n public updateGuestCheckoutEmail(\n newGuestCheckoutEmail: string,\n customerReference: string,\n customerRequisition: string,\n note: Note\n ): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\n this._customerReference = customerReference;\n this._customerRequisition = customerRequisition;\n this._note = note;\n }\n\n @action\n public updateTermsAndConditionsAcceptance(newIsTermsAndConditionAccepted: boolean): void {\n this._isTermsAndConditionAccepted = newIsTermsAndConditionAccepted;\n }\n\n @action\n public updateCustomerAccountAmount(newAmount: number): void {\n this._customerAccountAmount = newAmount;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst sectionContainerModuleId = 'section-container';\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst withModuleState =

(WrappedComponent: React.ComponentType

): React.ComponentType

=> {\n /**\n *\n * ModuleState component.\n * @extends {React.Component

}\n */\n @observer\n class ModuleState extends React.Component

{\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public shouldComponentUpdate(nextProps: IModuleStateProps): boolean {\n if (this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return ;\n }\n\n private readonly initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // State has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id.\n * @param id\n */\n private readonly getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState!,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => {\n this.update(id, { isRequired: value });\n },\n setIsCancellable: (value: boolean): void => {\n this.update(id, { isCancellable: value });\n },\n setIsSubmitContainer: (value: boolean): void => {\n this.update(id, { isSubmitContainer: value });\n },\n setHasError: (value: boolean): void => {\n this.update(id, { hasError: value });\n },\n onReady: (): void => {\n this.update(id, { status: 'ready' });\n },\n onUpdating: (): void => {\n this.update(id, { status: 'updating' });\n },\n onPending: (): void => {\n this.update(id, { status: 'pending' });\n },\n onSkip: (): void => {\n this.update(id, { status: 'skipped' });\n },\n onDisable: (): void => {\n this.update(id, { status: 'disabled' });\n },\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial): void => {\n if (moduleState?.hasInitialized) {\n // State has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name.\n * @param typeName\n */\n private readonly getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState?.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states.\n */\n private readonly get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state.\n * @param id\n * @param value\n */\n private readonly update = (id: string, value: Partial): void => {\n // Console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id]!,\n ...value\n };\n };\n\n private readonly _validateLeaf = (id: string, source: Partial): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private readonly _validateContainer = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // Module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n let childIds = module.childIds;\n\n if (this.props.context.app.config.shouldEnableSinglePaymentAuthorizationCheckout) {\n // For new checkout flow, we bypass the isReady check for payment section container to enable the place order button.\n childIds = childIds.filter(childId => !this._isPaymentSectionContainer(childId));\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n if (!moduleId.includes(sectionContainerModuleId)) {\n return false;\n }\n\n const modules = this.get();\n const module = modules[moduleId];\n\n if (module && ArrayExtensions.hasElements(module.childIds.filter(childId => childId.includes(paymentInstrumentModuleId)))) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition.\n * @param id\n * @param source\n * @param allMatched\n * @param skipSkippableItem\n */\n private readonly validate = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * HasExternalSubmitGroup\n * Module will use external submit group.\n */\n private readonly hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * HasModuleState\n * Module is using module state manager.\n * @param id\n */\n private readonly hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput.\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n\n public getCacheObjectType = () => 'ModuleState';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n let moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/**\n * EnabledPaymentsForOBO enum.\n */\n export enum EnabledPaymentsForOBO {\n OnCustomerAccount = 1,\n ExpressPayment = 0,\n Loyalty = 0,\n GiftCard = 0,\n PaymentInstrument = 0,\n ApplePay = 0\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, getUrlSync } from '@msdyn365-commerce/core';\n\nexport const GetCheckoutReturnUrl = (actionContext: IActionContext): string => {\n let returnUrl = getUrlSync('checkout', actionContext) || '';\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(returnUrl);\n if (window && !isAbsoluteUrl) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n return `${returnUrl}${!returnUrl.includes('?') ? '?' : '&'}pv=1`;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport * from './add-payment-form';\nexport * from './error';\nexport * from './iframe';\nexport * from './payment-instrument-message';\nexport * from './waiting';\nexport * from './with-visibility-observer';\nexport * from './interfaces';\nexport * from './place-order';\nexport * from './empty-active-cart';\nexport * from './country-codes';\nexport { CartCheckout } from './checkout';\nexport * from './get-checkout-return-url';\n\n/**\n * AsyncResultStatusCode.\n */\nexport enum AsyncResultStatusCode {\n LOADING = 'LOADING',\n SUCCESS = 'SUCCESS',\n FAILED = 'FAILED'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\n\nexport const EmptyActiveCartInvoice = async (ctx: IActionContext): Promise => {\n let cartState;\n let checkoutState;\n const lineItemIdsToRemove = [];\n\n try {\n cartState = await getCartState(ctx);\n checkoutState = await getCheckoutState(ctx);\n } catch (error) {\n throw error;\n }\n\n if (!cartState || !cartState.cart) {\n throw new Error('Fail to fetch active cart');\n }\n\n if (!checkoutState || !checkoutState.checkoutCart) {\n throw new Error('Fail to fetch checkoutCart cart');\n }\n\n const activeCart = cartState.cart;\n const checkoutCart = checkoutState.checkoutCart.cart;\n if (checkoutState.checkoutCart.hasInvoiceLine) {\n for (const activeCartLine of activeCart.CartLines || []) {\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\n lineItemIdsToRemove.push(activeCartLine.LineId);\n }\n }\n }\n\n try {\n console.log('Removing invoice cart lines');\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\n await cartState.removeAllPromoCodes({});\n } catch (error) {\n throw error;\n }\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { SalesOrder, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartCheckout } from './checkout';\nimport { EmptyActiveCart } from './empty-active-cart';\nimport { EmptyActiveCartInvoice } from './empty-active-cart-invoice';\n\n/**\n * Known action error failure states\n */\nconst enum ActionErrorStatus {\n Timeout = 'Timeout',\n HookTimeout = 'Hook Timeout',\n ServiceUnavailable = 'Service Unavailable'\n}\n\nexport const PlaceOrder = async (\n ctx: IActionContext,\n checkoutState: ICheckoutState | undefined,\n orderedProducts: SimpleProduct[] | undefined,\n redirect: boolean,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n) => {\n return new Promise(async (resolve: () => void, reject: (reason?: Error) => void) => {\n ctx.telemetry.information('Checkout place-order method is triggered.');\n\n let salesOrder: SalesOrder;\n\n // Proceed checkout\n try {\n salesOrder = await CartCheckout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error) {\n if (error.status === ActionErrorStatus.Timeout || error.status === ActionErrorStatus.ServiceUnavailable) {\n console.error('Error: Checkout failed due to timeout or service unavailable.');\n ctx.telemetry.information('Checkout emptyActiveCart is called.');\n await EmptyActiveCartInvoice(ctx);\n }\n reject(error);\n return;\n }\n\n // Remove purchased items from the active cart\n try {\n ctx.telemetry.information('Checkout emptyActiveCart is called.');\n await EmptyActiveCart(ctx);\n } catch (error) {\n reject(error);\n return;\n }\n\n if (redirect) {\n ctx.telemetry.information('Redirect to order confirmation page.');\n\n // Redirect to the order confirmation page\n const orderConfirmationUrl = getUrlSync('orderConfirmation', ctx) || '';\n if (!orderConfirmationUrl) {\n reject(new Error('Error: No orderConfirmationUrl'));\n return;\n }\n\n const separator = orderConfirmationUrl.includes('?') ? '&' : '?';\n const url = `${orderConfirmationUrl}${separator}transactionId=${salesOrder.Id}`;\n window.location.assign(url);\n } else {\n ctx.telemetry.information('Not redirect to order confirmation page.');\n\n if (checkoutState) {\n const result = await checkoutState.updateSalesOrder({\n newSalesOrder: salesOrder,\n newOrderedProducts: orderedProducts || []\n });\n\n if (result.status === 'FAILED') {\n reject(new Error('Error: Updating error state failed'));\n return;\n }\n } else {\n reject(new Error('Error: No checkout state'));\n return;\n }\n resolve();\n }\n });\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\nimport { checkoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { getTenderTypesAsync, resolveCardTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Address,\n CardPaymentAcceptResult,\n CardType,\n CartTenderLine,\n RetailOperation,\n SalesOrder,\n TenderType,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport const OPERATIONS = {\n PayCard: 201,\n PayGiftCertificate: 214,\n PayLoyalty: 207,\n PayCustomerAccount: 202\n};\n\nconst getCardTypeId = async (ctx: IActionContext, cardPrefix: string = ''): Promise => {\n try {\n const response = await resolveCardTypesAsync({ callerContext: ctx }, cardPrefix, CardType.Unknown);\n if (response && response.length > 0) {\n return response[0].TypeId;\n }\n } catch (error) {\n ctx.telemetry.error('Call to resolveCardTypesAsync failed.', error);\n }\n return undefined;\n};\n\nconst findTenderIdTypeByOperationId = (tenderTypes: TenderType[], operationId: RetailOperation): string | undefined => {\n const matchedTenderType = tenderTypes.find(tenderType => tenderType.OperationId === operationId);\n if (matchedTenderType) {\n return matchedTenderType.TenderTypeId;\n }\n return;\n};\n\nconst roundNumber = (value: number) => Number(value.toFixed(2));\n\nasync function getLoyaltyTenderLine(\n ctx: IActionContext,\n LoyaltyCardId: string,\n Amount: number = 0,\n Currency: string = 'USD'\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayLoyalty);\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n LoyaltyCardId\n };\n}\n\nasync function getGiftCardTenderLine(\n ctx: IActionContext,\n GiftCardId: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n tenderTypeId?: string,\n giftCardPin?: string,\n giftCardExpirationYear?: number,\n giftCardExpirationMonth?: number\n): Promise {\n let TenderTypeId = tenderTypeId;\n\n if (!TenderTypeId) {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayGiftCertificate);\n }\n\n const GiftCardPin = giftCardPin;\n const GiftCardExpirationYear = giftCardExpirationYear;\n const GiftCardExpirationMonth = giftCardExpirationMonth;\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n GiftCardId,\n GiftCardPin,\n GiftCardExpirationYear,\n GiftCardExpirationMonth\n };\n}\n\nasync function getCreditCardTenderLine(\n ctx: IActionContext,\n tokenizedPaymentCard: TokenizedPaymentCard,\n cardPrefix: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n billingAddress?: Address\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n let cartTypeId = tokenizedPaymentCard.CardTypeId;\n\n if (!cartTypeId) {\n cartTypeId = await getCardTypeId(ctx, cardPrefix);\n }\n\n if (!tenderTypes) {\n throw new Error('Fail to get card tender type');\n }\n\n if (!cartTypeId) {\n throw new Error('Fail to get card type id');\n }\n\n const TenderTypeId = tokenizedPaymentCard.TenderType ?? findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n Amount,\n TenderTypeId,\n CardTypeId: cartTypeId\n };\n cardTenderLine.TokenizedPaymentCard = {\n ...tokenizedPaymentCard,\n CardTypeId: cartTypeId,\n\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\n House: tokenizedPaymentCard.House || 'N/A',\n ...(tokenizedPaymentCard.CardTokenInfo && {\n CardTokenInfo: {\n ...tokenizedPaymentCard.CardTokenInfo,\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardTokenInfo'\n }\n }),\n ...(billingAddress && {\n Phone: billingAddress.Phone,\n Country: billingAddress.ThreeLetterISORegionName,\n Address1: billingAddress.Street,\n City: billingAddress.City,\n State: billingAddress.State,\n Zip: billingAddress.ZipCode\n })\n };\n\n return cardTenderLine;\n}\n\n/**\n * Get credit card tender line.\n * @param context - Action context.\n * @param amount - Due amount for credit card.\n * @param currency - Currency.\n * @param cardPaymentAcceptResult - CardPaymentAcceptResult.\n * @param billingAddress - BillingAddress.\n * @returns - The credit card tender line.\n */\nasync function getCreditCardTenderLineForSinglePaymentAuth(\n context: IActionContext,\n amount: number = 0,\n currency: string = 'USD',\n cardPaymentAcceptResult?: CardPaymentAcceptResult,\n billingAddress?: Address\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: context, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n const tenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n\n if (cardPaymentAcceptResult) {\n cardPaymentAcceptResult.TokenizedPaymentCard = {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\n House: 'N/A',\n ...(billingAddress && {\n Phone: billingAddress.Phone,\n Country: billingAddress.ThreeLetterISORegionName,\n Address1: billingAddress.Street,\n City: billingAddress.City,\n State: billingAddress.State,\n Zip: billingAddress.ZipCode\n })\n };\n }\n\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error -- existing data.\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency: currency,\n Amount: amount,\n TenderTypeId: tenderTypeId,\n CardPaymentAcceptResult: cardPaymentAcceptResult\n };\n\n return cardTenderLine;\n}\n\nasync function createCustomerAccountTenderLine(ctx: IActionContext, Amount: number, Currency: string = 'USD'): Promise {\n const CustomerId = null;\n if (!ctx.requestContext.user.isAuthenticated) {\n ctx.telemetry.error('A customer id is required to pay with customer account');\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n ctx.telemetry.error('No tender types found for this channel');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCustomerAccount);\n if (!TenderTypeId) {\n ctx.telemetry.error('No customer account tender type');\n }\n return {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n\n // @ts-expect-error\n CustomerId\n };\n}\n\nexport const CartCheckout = async (\n ctx: IActionContext,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n): Promise => {\n const checkoutState = await getCheckoutState(ctx).catch(error => {\n throw error;\n });\n\n const cartState = checkoutState.checkoutCart;\n\n const channelConfiguration = ctx.requestContext.channel;\n\n if (!cartState || Object.keys(cartState).length === 0 || !channelConfiguration) {\n throw new Error('Fail to placeOrder');\n }\n\n const {\n giftCardExtends,\n tokenizedPaymentCard,\n cardPrefix,\n guestCheckoutEmail,\n billingAddress,\n loyaltyAmount,\n cardPaymentAcceptResult,\n shouldEnableSinglePaymentAuthorizationCheckout,\n isExpressCheckoutApplied,\n isExpressAddressApplied\n } = checkoutState;\n const { Currency } = channelConfiguration;\n\n let amountDue = cartState.cart.AmountDue || 0;\n let cartTenderLines;\n const getTenderLinePromises = [];\n const loyaltyCardNumber = cartState.cart.LoyaltyCardId;\n\n // Pay by loyalty first\n if (loyaltyAmount && loyaltyCardNumber) {\n const chargedAmount = roundNumber(Math.min(loyaltyAmount, amountDue));\n const loyaltyTenderLinePromise = getLoyaltyTenderLine(ctx, loyaltyCardNumber, chargedAmount, Currency);\n getTenderLinePromises.push(loyaltyTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout loyalty tender line is added.');\n } else {\n ctx.telemetry.information('Checkout loyalty tender line is not added when no loyaltyAmount or loyaltyCardNumber.');\n }\n\n // Then by customer account\n if (checkoutState.customerAccountAmount > 0) {\n const chargedAmount = roundNumber(Math.min(checkoutState.customerAccountAmount, amountDue));\n const customerAccountTenderLinePromise = createCustomerAccountTenderLine(ctx, chargedAmount, Currency);\n getTenderLinePromises.push(customerAccountTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout customer account amount tender line is added.');\n } else {\n ctx.telemetry.information('Checkout customer account amount tender line is not added when customerAccountAmount is 0.');\n }\n\n // Then by gift card\n if (giftCardExtends && giftCardExtends.length > 0) {\n giftCardExtends.some(giftCardExtend => {\n if (giftCardExtend.Balance && amountDue > 0) {\n const chargedAmount = roundNumber(Math.min(giftCardExtend.Balance, amountDue));\n const tenderTypeId = giftCardExtend.TenderTypeId;\n const giftCardPin = giftCardExtend.Pin;\n const giftCardExpirationYear = giftCardExtend.ExpirationDate\n ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[1], 10)\n : undefined;\n const giftCardExpirationMonth = giftCardExtend.ExpirationDate\n ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[0], 10)\n : undefined;\n const creditCardTenderLinePromise = getGiftCardTenderLine(\n ctx,\n giftCardExtend.Id,\n chargedAmount,\n Currency,\n tenderTypeId,\n giftCardPin,\n giftCardExpirationYear,\n giftCardExpirationMonth\n );\n getTenderLinePromises.push(creditCardTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout gift card tender line is added.');\n } else {\n ctx.telemetry.information('Checkout gift card tender line is not added when no balance or no remaining balance.');\n }\n return amountDue === 0;\n });\n }\n\n // Pay the rest by credit card\n if (amountDue > 0) {\n let creditCardTenderLinePromise: Promise;\n\n if (\n shouldEnableSinglePaymentAuthorizationCheckout &&\n (!(isExpressCheckoutApplied && !isExpressAddressApplied) || (isExpressCheckoutApplied && isPaymentVerificationRedirection))\n ) {\n creditCardTenderLinePromise = getCreditCardTenderLineForSinglePaymentAuth(\n ctx,\n amountDue,\n Currency,\n cardPaymentAcceptResult,\n billingAddress\n );\n } else {\n if (!tokenizedPaymentCard) {\n throw new Error('Fail to placeOrder: no token found');\n }\n creditCardTenderLinePromise = getCreditCardTenderLine(\n ctx,\n tokenizedPaymentCard,\n cardPrefix,\n amountDue,\n Currency,\n billingAddress\n );\n }\n\n getTenderLinePromises.push(creditCardTenderLinePromise);\n\n ctx.telemetry.information('Checkout credit card tender line is added.');\n } else {\n ctx.telemetry.information('Checkout credit card tender line is not added when no remaining balance for credit card.');\n }\n\n if (getTenderLinePromises.length > 0) {\n // When payment methods is required\n cartTenderLines = await Promise.all(getTenderLinePromises).catch(error => {\n throw error;\n });\n\n if (!cartTenderLines || cartTenderLines.length === 0) {\n throw new Error('Fail to placeOrder: fail to get cart tender lines');\n }\n } else {\n ctx.telemetry.information('TenderLinePromises length is 0.');\n }\n\n const cartVersion = updatedCartVersion || cartState.cart.Version;\n\n ctx.telemetry.information('Checkout checkoutAsync is called.');\n\n // Proceed checkout\n const salesOrder = await checkoutAsync(\n { callerContext: ctx, bypassCache: 'get' },\n cartState.cart.Id,\n guestCheckoutEmail,\n undefined,\n undefined,\n cartTenderLines || null,\n cartVersion\n ).catch(async error => {\n if (checkoutState.shouldEnableSinglePaymentAuthorizationCheckout) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n if (error.data?.AdditionalContext) {\n ctx.telemetry.warning('CheckoutAsync call failed. AdditionalContext is sent for single payment auth.');\n\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n await checkoutState.updateRedirectAdditionalContext({\n newRedirectAdditionalContext: error?.data?.AdditionalContext as string\n });\n await checkoutState.updateRedirectPaymentConnectorId({\n newRedirectPaymentConnectorId: cardPaymentAcceptResult?.Settings?.PaymentConnectorId as string\n });\n } else {\n ctx.telemetry.warning('CheckoutAsync call failed. AdditionalContext is not sent for single payment auth.');\n\n await checkoutState.updateIsCheckoutCallFailed({ newIsCheckoutCallFailed: true });\n\n await checkoutState.updateCheckoutErrorPaymentConnectorId({\n newCheckoutErrorPaymentConnectorId: cardPaymentAcceptResult?.Settings?.PaymentConnectorId as string\n });\n\n if (isPaymentVerificationRedirection) {\n ctx.telemetry.warning('RefreshCart when isPaymentVerificationRedirection is true.');\n\n await checkoutState.checkoutCart.refreshCart({});\n await checkoutState.updateIsExpressCheckoutApplied({ newIsExpressCheckoutApplied: false });\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n }\n }\n }\n\n throw error;\n });\n\n if (!salesOrder) {\n ctx.telemetry.error('Failed to placeOrder: fail to checkout.');\n throw new Error('Fail to placeOrder: fail to checkout');\n }\n\n return salesOrder;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\n\nexport const EmptyActiveCart = async (ctx: IActionContext): Promise => {\n let cartState;\n let checkoutState;\n const lineItemIdsToRemove = [];\n\n try {\n cartState = await getCartState(ctx);\n checkoutState = await getCheckoutState(ctx);\n } catch (error) {\n throw error;\n }\n\n if (!cartState || !cartState.cart) {\n throw new Error('Fail to fetch active cart');\n }\n\n if (!checkoutState || !checkoutState.checkoutCart) {\n throw new Error('Fail to fetch checkoutCart cart');\n }\n\n const activeCart = cartState.cart;\n const checkoutCart = checkoutState.checkoutCart.cart;\n\n for (const activeCartLine of activeCart.CartLines || []) {\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\n lineItemIdsToRemove.push(activeCartLine.LineId);\n }\n }\n }\n\n try {\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\n await cartState.removeAllPromoCodes({});\n await checkoutState.removeCheckoutCartId({});\n } catch (error) {\n throw error;\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// eslint-disable-next-line import/no-anonymous-default-export -- Existing code.\nexport default `\n .adyen-dropin {\n font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;\n font-weight: normal;\n font-size: 16px;\n line-height: 21px;\n margin-left: -7px;\n text-transform: none;\n }\n\n /* Card pannel */\n\n .adyen-checkout__payment-method--next-selected,\n .adyen-checkout__payment-method:last-child {\n background-color: #FFFFFF;\n }\n\n .adyen-checkout__payment-method__name {\n color: #1D1D1D;\n font-weight: normal;\n }\n\n .adyen-checkout__label__text--error,\n .adyen-checkout__helper-text,\n .adyen-checkout__label__text {\n color: #1D1D1D;\n font-size: 18px;\n line-height: 24px;\n padding-bottom: 4px;\n }\n\n .adyen-checkout__error-text {\n color: #A80000;\n font-size: 16px;\n line-height: 21px;\n }\n\n .adyen-checkout__input {\n background: white;\n box-shadow: none;\n border: none;\n border-radius: 0;\n box-shadow: none;\n color: #1D1D1D;\n height: 42px;\n padding: 5px 8px;\n }\n\n .adyen-checkout__input--focus,\n .adyen-checkout__input--focus:hover,\n .adyen-checkout__input:active,\n .adyen-checkout__input:active:hover,\n .adyen-checkout__input:focus,\n .adyen-checkout__input:focus:hover {\n border: 1px dashed #fff;\n outline: 1px dashed #000;\n box-shadow: none;\n }\n\n .adyen-checkout__input:hover {\n border: none;\n }\n\n .adyen-checkout__input--error,\n .adyen-checkout__input--error:hover,\n .adyen-checkout__input--invalid,\n .adyen-checkout__input--invalid:hover {\n border: none;\n border-left: 2px solid #A80000;\n color: #A80000;\n }\n\n .adyen-checkout__label--focused .adyen-checkout__label__text {\n color: inherit;\n }\n`;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { Iframe } from './iframe';\nimport defaultPaymentConnectorDropinStyle from './payment-instrument.dropin.style';\nimport defaultPaymentConnectorPaypalStyle from './payment-instrument.paypal.style';\nimport defaultPaymentConnectorStyle from './payment-instrument.style';\n\n/**\n * Interface for add payment form.\n */\nexport interface IAddPaymentFormProps {\n acceptPageUrl?: string;\n acceptPageContent?: string;\n iframeRef?: React.RefObject