@lookiero/checkout 9.9.0-beta.1 → 9.9.0
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/dist/index.js +2 -2
- package/dist/src/ExpoRoot.js +5 -7
- package/dist/src/infrastructure/ui/Root.d.ts +2 -0
- package/dist/src/infrastructure/ui/Root.js +4 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +2 -3
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +26 -17
- package/dist/src/infrastructure/ui/hooks/useQueryBus.d.ts +9 -0
- package/dist/src/infrastructure/ui/hooks/useQueryBus.js +10 -0
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
- package/dist/src/infrastructure/ui/i18n/i18n.d.ts +0 -1
- package/dist/src/infrastructure/ui/i18n/i18n.js +0 -1
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +2 -5
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
- package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +2 -2
- package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
- package/dist/src/projection/customer/customer.d.ts +0 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +2 -2
- package/package.json +7 -7
- package/src/ExpoRoot.tsx +5 -7
- package/src/infrastructure/ui/Root.tsx +30 -17
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +1 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +0 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +1 -0
- package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +60 -18
- package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +23 -0
- package/src/infrastructure/ui/hooks/useQueryBus.tsx +27 -0
- package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +58 -0
- package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +77 -33
- package/src/infrastructure/ui/i18n/i18n.ts +0 -1
- package/src/infrastructure/ui/views/checkout/Checkout.style.ts +0 -3
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -12
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +2 -2
- package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
- package/src/projection/customer/customer.ts +0 -2
- package/dist/pact.config.d.ts +0 -21
- package/dist/pact.config.js +0 -16
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -8
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -9
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -11
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -21
- package/dist/src/projection/shared/size.js +0 -4
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
- package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
- package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
- package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
- package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
- package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
- package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
package/dist/index.js
CHANGED
|
@@ -10,11 +10,11 @@ const bootstrap = ({ apiUrl, getAuthToken, translations, sentry, kameleoon }) =>
|
|
|
10
10
|
const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
|
|
11
11
|
const I18n = i18n({
|
|
12
12
|
fetchTranslation: fetchTranslations({ translations }),
|
|
13
|
-
|
|
13
|
+
domain: "CheckoutI18n",
|
|
14
14
|
});
|
|
15
15
|
const firstAvailableCheckoutByCustomerId = ({ customerId }) => queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId: customerId }));
|
|
16
16
|
return {
|
|
17
|
-
root: root({ Messaging, I18n, getAuthToken, sentry, kameleoon }),
|
|
17
|
+
root: root({ Messaging, I18n, queryBus, getAuthToken, sentry, kameleoon }),
|
|
18
18
|
firstAvailableCheckoutByCustomerId,
|
|
19
19
|
};
|
|
20
20
|
};
|
package/dist/src/ExpoRoot.js
CHANGED
|
@@ -24,11 +24,9 @@ const order = {
|
|
|
24
24
|
coupon: "MYLOOKIERO",
|
|
25
25
|
};
|
|
26
26
|
const customer = {
|
|
27
|
-
customerId: "
|
|
27
|
+
customerId: "d3c2354b-9811-46d4-b2ba-5fba012ed94d",
|
|
28
28
|
country: Country.ES,
|
|
29
29
|
segment: Segment.WOMEN,
|
|
30
|
-
email: "email@example.com",
|
|
31
|
-
name: "Adèle Léonce Émilie",
|
|
32
30
|
};
|
|
33
31
|
const sentryConfig = {
|
|
34
32
|
publicKey: "66cadf9444db4ea5945670f12ec08ae7",
|
|
@@ -41,7 +39,7 @@ const apiUrl = Platform.OS !== "web"
|
|
|
41
39
|
: __DEV__
|
|
42
40
|
? "/local-to-dev"
|
|
43
41
|
: "/checkout/api";
|
|
44
|
-
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
42
|
+
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDg3OTAsImV4cCI6MTc0MjM2OTcyNywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjQtMTEtMDgiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiNzRjYjRmNzYtM2YxNC00OTgzLTgxYTYtMmVlMmE5YTI3NWQ0IiwiaWF0IjoxNzM5OTUwNTI3fQ.ajNczGc6YhM23--PsqlAoDrp_GN87TnHEBOYyg2hoWM";
|
|
45
43
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
46
44
|
const externalTranslationsUrl = Platform.OS !== "web"
|
|
47
45
|
? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
|
|
@@ -76,22 +74,22 @@ setPaymentsBridge({
|
|
|
76
74
|
useFeatureFlags: () => ({}),
|
|
77
75
|
locale: () => Promise.resolve("es-ES"),
|
|
78
76
|
scrollView: ScrollView,
|
|
79
|
-
hostUrl: "",
|
|
80
77
|
});
|
|
81
78
|
const kameleoonConfig = {
|
|
82
79
|
siteCode: "aplm4v3ckn",
|
|
83
80
|
experiments: {},
|
|
84
81
|
};
|
|
85
|
-
const { Component: Messaging } = process.env.EXPO_PUBLIC_APP_VARIANT === "test"
|
|
82
|
+
const { Component: Messaging, queryBus } = process.env.EXPO_PUBLIC_APP_VARIANT === "test"
|
|
86
83
|
? checkoutMockBootstrap()
|
|
87
84
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
88
85
|
const I18n = i18n({
|
|
89
86
|
fetchTranslation: fetchTranslations({ translations }),
|
|
90
|
-
|
|
87
|
+
domain: "CheckoutI18n",
|
|
91
88
|
});
|
|
92
89
|
const Root = root({
|
|
93
90
|
Messaging,
|
|
94
91
|
I18n,
|
|
92
|
+
queryBus,
|
|
95
93
|
getAuthToken,
|
|
96
94
|
development: false,
|
|
97
95
|
sentry: () => (process.env.EXPO_PUBLIC_APP_VARIANT === "test" ? {} : sentryConfig),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from "react";
|
|
2
2
|
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
3
3
|
import { I18n } from "@lookiero/i18n-react";
|
|
4
|
+
import { QueryBus } from "@lookiero/messaging";
|
|
4
5
|
import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
|
|
5
6
|
import { Locale } from "@lookiero/sty-psp-locale";
|
|
6
7
|
import { SentryEnvironment, SentryLoggerFunctionArgs } from "@lookiero/sty-psp-logging";
|
|
@@ -12,6 +13,7 @@ import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
|
|
|
12
13
|
interface RootFunctionArgs {
|
|
13
14
|
readonly Messaging: MessagingRoot;
|
|
14
15
|
readonly I18n: I18n;
|
|
16
|
+
readonly queryBus: QueryBus;
|
|
15
17
|
readonly development?: boolean;
|
|
16
18
|
readonly sentry: () => SentryEnvironment;
|
|
17
19
|
readonly getAuthToken: () => Promise<string>;
|
|
@@ -4,15 +4,17 @@ import { Platform } from "react-native";
|
|
|
4
4
|
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
5
5
|
import { Locale } from "@lookiero/sty-psp-locale";
|
|
6
6
|
import { sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
|
|
7
|
+
import { QueryBusProvider } from "./hooks/useQueryBus";
|
|
7
8
|
import { Routing } from "./routing/Routing";
|
|
8
|
-
const root = ({ Messaging, I18n, getAuthToken, development, sentry, kameleoon: kameleoonConfig }) => {
|
|
9
|
+
const root = ({ Messaging, I18n, queryBus, getAuthToken, development, sentry, kameleoon: kameleoonConfig, }) => {
|
|
9
10
|
const logger = sentryLogger(sentry);
|
|
10
11
|
const kameleoon = kameleoonConfig();
|
|
11
12
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
12
13
|
const Root = ({ basePath, locale = Locale.en_GB, customer, order, subscription, layout, onNotAccessible, onCheckoutSubmitted, useRedirect, useRoutes = reactRouterUseRoutes, }) => {
|
|
13
14
|
const handleOnI18nError = useCallback((error) => logger.captureException(error), []);
|
|
14
15
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
15
|
-
React.createElement(
|
|
16
|
+
React.createElement(QueryBusProvider, { queryBus: queryBus },
|
|
17
|
+
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, kameleoon: kameleoon, layout: layout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, useRoutes: useRoutes, onCheckoutSubmitted: onCheckoutSubmitted, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible }))));
|
|
16
18
|
};
|
|
17
19
|
const hoc = sentryLoggerHOC({ logger });
|
|
18
20
|
/**
|
|
@@ -8,7 +8,7 @@ const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParent
|
|
|
8
8
|
const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
|
|
9
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
10
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
11
|
-
return (React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, textAlignVertical: "top", value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
12
12
|
inputField: style.inputField,
|
|
13
13
|
input: { container: style.inputContainer, input: style.input },
|
|
14
14
|
} }));
|
|
@@ -11,7 +11,7 @@ const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, test
|
|
|
11
11
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
12
12
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
|
|
13
13
|
return (React.createElement(View, { style: style.wrapper, testID: "textarea-return-question-item" },
|
|
14
|
-
React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
14
|
+
React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, textAlignVertical: "top", value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
15
15
|
inputField: style.inputField,
|
|
16
16
|
input: { container: style.inputContainer, input: style.input },
|
|
17
17
|
} })));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Logger } from "@lookiero/sty-psp-logging";
|
|
2
2
|
interface UsePaymentInstrumentEventsFunctionArgs {
|
|
3
|
-
readonly
|
|
4
|
-
readonly onError: (payload: PaymentPayload) => void;
|
|
3
|
+
readonly logger: Logger;
|
|
5
4
|
}
|
|
6
5
|
interface UsePaymentInstrumentEventsFunction {
|
|
7
6
|
(args: UsePaymentInstrumentEventsFunctionArgs): void;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useCallback, useEffect } from "react";
|
|
2
|
+
import { useEvent } from "@lookiero/event";
|
|
3
|
+
import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
|
|
4
|
+
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
5
|
+
import { I18nMessages } from "../i18n/i18n";
|
|
6
|
+
const PAYMENT_ERROR = "ERROR";
|
|
7
|
+
const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
|
|
8
|
+
const usePaymentInstrumentEvents = ({ logger }) => {
|
|
9
|
+
const { subscribe, unsubscribe } = useEvent();
|
|
10
|
+
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
11
|
+
const onSuccess = useCallback(({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }), [createNotification]);
|
|
12
|
+
const onError = useCallback(({ error }) => {
|
|
13
|
+
if (error.toaster) {
|
|
14
|
+
createNotification({
|
|
15
|
+
bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
|
|
16
|
+
level: NotificationLevel.ERROR,
|
|
17
|
+
});
|
|
9
18
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}, [onError, onSuccess
|
|
19
|
+
}, [createNotification]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
subscribe({ event: PAYMENT_ERROR }, onError);
|
|
22
|
+
subscribe({ event: PAYMENT_SUCCESS }, onSuccess);
|
|
23
|
+
return () => {
|
|
24
|
+
unsubscribe({ event: PAYMENT_ERROR }, onError);
|
|
25
|
+
unsubscribe({ event: PAYMENT_SUCCESS }, onSuccess);
|
|
26
|
+
};
|
|
27
|
+
}, [subscribe, unsubscribe, createNotification, onError, onSuccess]);
|
|
19
28
|
};
|
|
20
29
|
export { usePaymentInstrumentEvents };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { QueryBus } from "@lookiero/messaging";
|
|
3
|
+
interface QueryBusProviderProps {
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly queryBus: QueryBus;
|
|
6
|
+
}
|
|
7
|
+
declare const QueryBusProvider: FC<QueryBusProviderProps>;
|
|
8
|
+
declare const useQueryBus: () => QueryBus;
|
|
9
|
+
export { useQueryBus, QueryBusProvider };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { createContext, useContext } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
3
|
+
const QueryBusContext = createContext(null);
|
|
4
|
+
const QueryBusProvider = ({ children, queryBus }) => (React.createElement(QueryBusContext.Provider, { value: queryBus }, children));
|
|
5
|
+
const useQueryBus = () => {
|
|
6
|
+
const queryBus = useContext(QueryBusContext);
|
|
7
|
+
invariant(queryBus, "Your are trying to use the useQueryBus hook without wrapping your app with the <QueryBusProvider>.");
|
|
8
|
+
return queryBus;
|
|
9
|
+
};
|
|
10
|
+
export { useQueryBus, QueryBusProvider };
|
|
@@ -16,7 +16,7 @@ interface UseSubmitCheckoutFunctionArgs {
|
|
|
16
16
|
readonly checkoutBookingId: string;
|
|
17
17
|
readonly paymentFlowRef: RefObject<PaymentFlowRef>;
|
|
18
18
|
readonly onError: () => void;
|
|
19
|
-
readonly onSuccess
|
|
19
|
+
readonly onSuccess?: () => void;
|
|
20
20
|
readonly logger: Logger;
|
|
21
21
|
}
|
|
22
22
|
interface UseSubmitCheckoutFunction {
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from "react";
|
|
2
2
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
3
3
|
import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
|
|
4
|
+
import { viewCheckoutBookingById, } from "../../../projection/checkoutBooking/viewCheckoutBookingById";
|
|
4
5
|
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
5
6
|
import { useSubmitCheckout as useSubmitCheckoutCommand } from "../../domain/checkout/react/useSubmitCheckout";
|
|
6
7
|
import { useBlockCheckoutBooking } from "../../domain/checkoutBooking/react/useBlockCheckoutBooking";
|
|
7
8
|
import { I18nMessages } from "../i18n/i18n";
|
|
8
|
-
import {
|
|
9
|
+
import { useQueryBus } from "./useQueryBus";
|
|
10
|
+
var ChargeStatus;
|
|
11
|
+
(function (ChargeStatus) {
|
|
12
|
+
ChargeStatus["EXECUTED"] = "EXECUTED";
|
|
13
|
+
ChargeStatus["REQUIRES_ACTION"] = "REQUIRES_ACTION";
|
|
14
|
+
ChargeStatus["REQUIRED_ACTION_CANCELLED"] = "REQUIRED_ACTION_CANCELLED";
|
|
15
|
+
ChargeStatus["REJECTED"] = "REJECTED";
|
|
16
|
+
ChargeStatus["CANCELLED"] = "CANCELLED";
|
|
17
|
+
ChargeStatus["TO_CONFIRM"] = "TO_CONFIRM";
|
|
18
|
+
ChargeStatus["ERROR"] = "ERROR";
|
|
19
|
+
ChargeStatus["UNKNOWN"] = "UNKNOWN";
|
|
20
|
+
})(ChargeStatus || (ChargeStatus = {}));
|
|
9
21
|
const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onError, onSuccess, logger, }) => {
|
|
22
|
+
const queryBus = useQueryBus();
|
|
10
23
|
const [submitCheckoutCommand, submitCheckoutCommandStatus] = useSubmitCheckoutCommand({ checkoutId, logger });
|
|
11
24
|
const [blockCheckoutBooking, blockCheckoutBookingStatus] = useBlockCheckoutBooking({ checkoutBookingId, logger });
|
|
12
25
|
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
26
|
+
const [checkoutBookingExpired, setCheckoutBookingExpired] = useState(false);
|
|
13
27
|
const [startLegacyBoxCheckoutStatus, setStartLegacyBoxCheckoutStatus] = useState("idle");
|
|
14
28
|
const submitCheckout = useCallback(async ({ paymentFlowPayload, sizeChangeEnabled }) => {
|
|
15
29
|
try {
|
|
@@ -18,27 +32,40 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
|
|
|
18
32
|
catch (error) {
|
|
19
33
|
return;
|
|
20
34
|
}
|
|
21
|
-
|
|
35
|
+
const checkoutBooking = await queryBus(viewCheckoutBookingById({ checkoutBookingId }));
|
|
36
|
+
if (checkoutBooking?.isExpired) {
|
|
37
|
+
setCheckoutBookingExpired(true);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
paymentFlowRef.current?.startLegacyBoxCheckout(
|
|
22
41
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
42
|
// @ts-ignore
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
paymentFlowPayload, async ({ status, toaster, final }) => {
|
|
44
|
+
setStartLegacyBoxCheckoutStatus("loading");
|
|
45
|
+
if (final) {
|
|
46
|
+
if (status === ChargeStatus.EXECUTED) {
|
|
47
|
+
setStartLegacyBoxCheckoutStatus("success");
|
|
48
|
+
await submitCheckoutCommand();
|
|
49
|
+
onSuccess?.();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
createNotification({
|
|
53
|
+
level: NotificationLevel.ERROR,
|
|
54
|
+
bodyI18nKey: toaster?.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
|
|
55
|
+
});
|
|
56
|
+
setStartLegacyBoxCheckoutStatus("error");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
39
59
|
});
|
|
40
|
-
}, [
|
|
41
|
-
|
|
60
|
+
}, [
|
|
61
|
+
queryBus,
|
|
62
|
+
checkoutBookingId,
|
|
63
|
+
paymentFlowRef,
|
|
64
|
+
blockCheckoutBooking,
|
|
65
|
+
submitCheckoutCommand,
|
|
66
|
+
onSuccess,
|
|
67
|
+
createNotification,
|
|
68
|
+
]);
|
|
42
69
|
const status = useMemo(() => {
|
|
43
70
|
if (blockCheckoutBookingStatus === CommandStatus.LOADING ||
|
|
44
71
|
startLegacyBoxCheckoutStatus === "loading" ||
|
|
@@ -48,17 +75,23 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
|
|
|
48
75
|
if (blockCheckoutBookingStatus === CommandStatus.SUCCESS &&
|
|
49
76
|
startLegacyBoxCheckoutStatus === "success" &&
|
|
50
77
|
submitCheckoutCommandStatus === CommandStatus.SUCCESS) {
|
|
51
|
-
onSuccess();
|
|
52
78
|
return "success";
|
|
53
79
|
}
|
|
54
80
|
if (blockCheckoutBookingStatus === CommandStatus.ERROR ||
|
|
55
81
|
startLegacyBoxCheckoutStatus === "error" ||
|
|
56
|
-
submitCheckoutCommandStatus === CommandStatus.ERROR
|
|
82
|
+
submitCheckoutCommandStatus === CommandStatus.ERROR ||
|
|
83
|
+
checkoutBookingExpired) {
|
|
57
84
|
onError();
|
|
58
85
|
return "error";
|
|
59
86
|
}
|
|
60
87
|
return "idle";
|
|
61
|
-
}, [
|
|
88
|
+
}, [
|
|
89
|
+
blockCheckoutBookingStatus,
|
|
90
|
+
startLegacyBoxCheckoutStatus,
|
|
91
|
+
submitCheckoutCommandStatus,
|
|
92
|
+
checkoutBookingExpired,
|
|
93
|
+
onError,
|
|
94
|
+
]);
|
|
62
95
|
return [submitCheckout, status];
|
|
63
96
|
};
|
|
64
97
|
export { useSubmitCheckout };
|
|
@@ -46,7 +46,6 @@ declare enum I18nMessages {
|
|
|
46
46
|
CHECKOUT_TITLE = "checkout.title",
|
|
47
47
|
CHECKOUT_PAY_BUTTON = "checkout.pay_button",
|
|
48
48
|
CHECKOUT_TOAST_PAYMENT_ERROR = "checkout.toast_payment_error",
|
|
49
|
-
CHECKOUT_TOAST_PAYMENT_SUCCESS = "checkout.toast_payment_success",
|
|
50
49
|
CHECKOUT_SUCCESS_MODAL_TITLE = "checkout.success_modal_title",
|
|
51
50
|
CHECKOUT_SUCCESS_MODAL_DESCRIPTION = "checkout.success_modal_description",
|
|
52
51
|
CHECKOUT_SUCCESS_MODAL_BUTTON = "checkout.success_modal_button",
|
|
@@ -48,7 +48,6 @@ var I18nMessages;
|
|
|
48
48
|
I18nMessages["CHECKOUT_TITLE"] = "checkout.title";
|
|
49
49
|
I18nMessages["CHECKOUT_PAY_BUTTON"] = "checkout.pay_button";
|
|
50
50
|
I18nMessages["CHECKOUT_TOAST_PAYMENT_ERROR"] = "checkout.toast_payment_error";
|
|
51
|
-
I18nMessages["CHECKOUT_TOAST_PAYMENT_SUCCESS"] = "checkout.toast_payment_success";
|
|
52
51
|
I18nMessages["CHECKOUT_SUCCESS_MODAL_TITLE"] = "checkout.success_modal_title";
|
|
53
52
|
I18nMessages["CHECKOUT_SUCCESS_MODAL_DESCRIPTION"] = "checkout.success_modal_description";
|
|
54
53
|
I18nMessages["CHECKOUT_SUCCESS_MODAL_BUTTON"] = "checkout.success_modal_button";
|
|
@@ -4,7 +4,6 @@ import { useNavigate } from "react-router-native";
|
|
|
4
4
|
import { Box, Button, Layout as AuroraLayout, Spinner, Text, useDevice } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
7
|
-
import { Country } from "@lookiero/sty-psp-locale";
|
|
8
7
|
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
9
8
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
10
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
@@ -78,15 +77,13 @@ const Checkout = ({ children, layout: Layout, useRedirect }) => {
|
|
|
78
77
|
React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [screen.L && style.desktopLayoutSpacing, !screen.L && { paddingBottom: pricingHeight }] },
|
|
79
78
|
React.createElement(Box, { size: { L: "2/3" }, style: screen.L && style.desktopListSpacing },
|
|
80
79
|
React.createElement(View, { style: [style.contentWrapper, screen.L && style.desktopContentWrapper] },
|
|
81
|
-
country === Country.NL && (React.createElement(View, { style: style.paymentSelectorNL },
|
|
82
|
-
React.createElement(PaymentInstrument, { useRedirect: useRedirect }))),
|
|
83
80
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
84
81
|
checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, testID: "checkout-items-kept" },
|
|
85
82
|
React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, status: checkoutItem.status, size: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
|
86
83
|
? checkoutItem.replacedFor.size
|
|
87
84
|
: checkoutItem.productVariant.size })))),
|
|
88
|
-
|
|
89
|
-
React.createElement(PaymentInstrument, { useRedirect: useRedirect }))))
|
|
85
|
+
React.createElement(View, { style: style.paymentSelector },
|
|
86
|
+
React.createElement(PaymentInstrument, { useRedirect: useRedirect })))),
|
|
90
87
|
React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L && style.desktopResume] }, pricing ? (React.createElement(View, { style: [style.princingWrapper, !screen.L && style.princingWrapperSmall] },
|
|
91
88
|
React.createElement(Pricing, { pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0 }),
|
|
92
89
|
screen.L ? (React.createElement(Button, { testID: "confirm-checkout-button", onPress: handleOnSubmit }, submitButtonText)) : null)) : null))),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { useNavigate } from "react-router-native";
|
|
3
3
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
4
|
-
import { PaymentFlow
|
|
4
|
+
import { PaymentFlow } from "@lookiero/payments-front";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
6
6
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
7
7
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
@@ -85,6 +85,6 @@ const CheckoutPaymentModal = ({ coupon, isFirstOrder, subscription, orderNumber,
|
|
|
85
85
|
const dependenciesLoaded = (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout) && authToken;
|
|
86
86
|
if (!dependenciesLoaded)
|
|
87
87
|
return null;
|
|
88
|
-
return React.createElement(PaymentFlow, { ref: paymentFlowRef,
|
|
88
|
+
return React.createElement(PaymentFlow, { ref: paymentFlowRef, token: authToken });
|
|
89
89
|
};
|
|
90
90
|
export { CheckoutPaymentModal };
|
package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useRef } from "react";
|
|
2
2
|
import { PaymentInstrumentSelect, Section } from "@lookiero/payments-front";
|
|
3
|
-
import {
|
|
3
|
+
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
4
|
+
import { usePaymentInstrumentEvents } from "../../../../hooks/usePaymentInstrumentEvents";
|
|
4
5
|
const PaymentInstrument = ({ useRedirect }) => {
|
|
6
|
+
const paymentInstrumentSelectRef = useRef(null);
|
|
5
7
|
const { returnUrl } = useRedirect();
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: customer.name,
|
|
10
|
-
}, showSingleUsePaymentMethods: true }));
|
|
8
|
+
const logger = useLogger();
|
|
9
|
+
usePaymentInstrumentEvents({ logger });
|
|
10
|
+
return (React.createElement(PaymentInstrumentSelect, { ref: paymentInstrumentSelectRef, beforeRedirect: returnUrl ? () => Promise.resolve(returnUrl) : undefined, hasError: false, section: Section.BOX_CHECKOUT }));
|
|
11
11
|
};
|
|
12
12
|
export { PaymentInstrument };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "9.9.0
|
|
1
|
+
export declare const VERSION = "9.9.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "9.9.0
|
|
1
|
+
export const VERSION = "9.9.0";
|
package/index.ts
CHANGED
|
@@ -44,14 +44,14 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
|
|
|
44
44
|
const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
|
|
45
45
|
const I18n = i18n({
|
|
46
46
|
fetchTranslation: fetchTranslations({ translations }),
|
|
47
|
-
|
|
47
|
+
domain: "CheckoutI18n",
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const firstAvailableCheckoutByCustomerId: FirstAvailableCheckoutByCustomerIdFunction = ({ customerId }) =>
|
|
51
51
|
queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId: customerId as string }));
|
|
52
52
|
|
|
53
53
|
return {
|
|
54
|
-
root: root({ Messaging, I18n, getAuthToken, sentry, kameleoon }),
|
|
54
|
+
root: root({ Messaging, I18n, queryBus, getAuthToken, sentry, kameleoon }),
|
|
55
55
|
firstAvailableCheckoutByCustomerId,
|
|
56
56
|
};
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "9.9.0
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@lookiero/sty-psp-ab-testing": "^0.3",
|
|
25
25
|
"@lookiero/sty-psp-expo-config": "^0.2",
|
|
26
26
|
"@lookiero/sty-psp-http": "^2.0",
|
|
27
|
-
"@lookiero/sty-psp-i18n": "^0.
|
|
27
|
+
"@lookiero/sty-psp-i18n": "^0.3",
|
|
28
28
|
"@lookiero/sty-psp-locale": "^0.4",
|
|
29
29
|
"@lookiero/sty-psp-logging": "^0.5",
|
|
30
|
-
"@lookiero/sty-psp-notifications": "^0.
|
|
30
|
+
"@lookiero/sty-psp-notifications": "^0.7",
|
|
31
31
|
"@lookiero/sty-psp-react-native": "^0.3",
|
|
32
32
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
33
33
|
"@lookiero/sty-psp-storage": "^0.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@cypress/webpack-preprocessor": "^6.0.2",
|
|
47
47
|
"@lookiero/eslint-config-sty-psp": "*",
|
|
48
48
|
"@lookiero/event": "^0.3",
|
|
49
|
-
"@lookiero/payments-front": "
|
|
49
|
+
"@lookiero/payments-front": "6.0.3",
|
|
50
50
|
"@lookiero/sty-psp-jest-config": "*",
|
|
51
51
|
"@lookiero/sty-psp-prettier-config": "*",
|
|
52
52
|
"@lookiero/sty-psp-scripts": "*",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@lookiero/aurora-fonts": ">=2",
|
|
75
75
|
"@lookiero/aurora-iconfont": ">=3",
|
|
76
76
|
"@lookiero/event": "^0.3",
|
|
77
|
-
"@lookiero/i18n": ">=
|
|
78
|
-
"@lookiero/i18n-react": ">=
|
|
79
|
-
"@lookiero/payments-front": "
|
|
77
|
+
"@lookiero/i18n": ">=1",
|
|
78
|
+
"@lookiero/i18n-react": ">=1",
|
|
79
|
+
"@lookiero/payments-front": "6.0.3",
|
|
80
80
|
"apollo-boost": "0.4.4",
|
|
81
81
|
"expo": ">=51",
|
|
82
82
|
"expo-font": ">=12",
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -32,11 +32,9 @@ const order: Order = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const customer: Customer = {
|
|
35
|
-
customerId: "
|
|
35
|
+
customerId: "d3c2354b-9811-46d4-b2ba-5fba012ed94d",
|
|
36
36
|
country: Country.ES,
|
|
37
37
|
segment: Segment.WOMEN,
|
|
38
|
-
email: "email@example.com",
|
|
39
|
-
name: "Adèle Léonce Émilie",
|
|
40
38
|
};
|
|
41
39
|
|
|
42
40
|
const sentryConfig: SentryEnvironment = {
|
|
@@ -53,7 +51,7 @@ const apiUrl =
|
|
|
53
51
|
? "/local-to-dev"
|
|
54
52
|
: "/checkout/api";
|
|
55
53
|
const authToken =
|
|
56
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
54
|
+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDg3OTAsImV4cCI6MTc0MjM2OTcyNywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjQtMTEtMDgiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiNzRjYjRmNzYtM2YxNC00OTgzLTgxYTYtMmVlMmE5YTI3NWQ0IiwiaWF0IjoxNzM5OTUwNTI3fQ.ajNczGc6YhM23--PsqlAoDrp_GN87TnHEBOYyg2hoWM";
|
|
57
55
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
58
56
|
|
|
59
57
|
const externalTranslationsUrl =
|
|
@@ -94,7 +92,6 @@ setPaymentsBridge({
|
|
|
94
92
|
useFeatureFlags: () => ({}),
|
|
95
93
|
locale: () => Promise.resolve("es-ES"),
|
|
96
94
|
scrollView: ScrollView,
|
|
97
|
-
hostUrl: "",
|
|
98
95
|
});
|
|
99
96
|
|
|
100
97
|
const kameleoonConfig: KameleoonEnvironment = {
|
|
@@ -102,17 +99,18 @@ const kameleoonConfig: KameleoonEnvironment = {
|
|
|
102
99
|
experiments: {},
|
|
103
100
|
};
|
|
104
101
|
|
|
105
|
-
const { Component: Messaging } =
|
|
102
|
+
const { Component: Messaging, queryBus } =
|
|
106
103
|
process.env.EXPO_PUBLIC_APP_VARIANT === "test"
|
|
107
104
|
? checkoutMockBootstrap()
|
|
108
105
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
109
106
|
const I18n = i18n({
|
|
110
107
|
fetchTranslation: fetchTranslations({ translations }),
|
|
111
|
-
|
|
108
|
+
domain: "CheckoutI18n",
|
|
112
109
|
});
|
|
113
110
|
const Root = root({
|
|
114
111
|
Messaging,
|
|
115
112
|
I18n,
|
|
113
|
+
queryBus,
|
|
116
114
|
getAuthToken,
|
|
117
115
|
development: false,
|
|
118
116
|
sentry: () => (process.env.EXPO_PUBLIC_APP_VARIANT === "test" ? ({} as SentryEnvironment) : sentryConfig),
|