@lookiero/checkout 9.9.0-beta.2 → 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.
Files changed (149) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +6 -8
  2. package/dist/fake-dependencies/@lookiero/payments-front/index.js +4 -7
  3. package/dist/index.js +2 -2
  4. package/dist/src/ExpoRoot.js +12 -16
  5. package/dist/src/infrastructure/ui/Root.d.ts +2 -0
  6. package/dist/src/infrastructure/ui/Root.js +4 -2
  7. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -1
  8. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
  9. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
  10. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
  11. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
  12. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
  13. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +2 -3
  14. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +26 -17
  15. package/dist/src/infrastructure/ui/hooks/useQueryBus.d.ts +9 -0
  16. package/dist/src/infrastructure/ui/hooks/useQueryBus.js +10 -0
  17. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  18. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
  19. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +0 -1
  20. package/dist/src/infrastructure/ui/i18n/i18n.js +0 -1
  21. package/dist/src/infrastructure/ui/views/App.js +6 -5
  22. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +2 -5
  23. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
  24. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
  25. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +2 -2
  26. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  27. package/dist/src/projection/customer/customer.d.ts +0 -2
  28. package/dist/src/version.d.ts +1 -1
  29. package/dist/src/version.js +1 -1
  30. package/fake-dependencies/@lookiero/payments-front/index.tsx +9 -32
  31. package/index.ts +2 -2
  32. package/package.json +7 -7
  33. package/src/ExpoRoot.tsx +31 -36
  34. package/src/infrastructure/ui/Root.tsx +30 -17
  35. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
  36. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +1 -0
  37. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +0 -1
  38. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +1 -0
  39. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +60 -18
  40. package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +23 -0
  41. package/src/infrastructure/ui/hooks/useQueryBus.tsx +27 -0
  42. package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +58 -0
  43. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +77 -33
  44. package/src/infrastructure/ui/i18n/i18n.ts +0 -1
  45. package/src/infrastructure/ui/views/App.tsx +13 -5
  46. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +0 -3
  47. package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -12
  48. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +2 -2
  49. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  50. package/src/projection/customer/customer.ts +0 -2
  51. package/dist/pact.config.d.ts +0 -21
  52. package/dist/pact.config.js +0 -16
  53. package/dist/public/public/assets/adaptive-icon.png +0 -0
  54. package/dist/public/public/assets/favicon.png +0 -0
  55. package/dist/public/public/assets/icon.png +0 -0
  56. package/dist/public/public/assets/splash.png +0 -0
  57. package/dist/public/public/images/not-found.png +0 -0
  58. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  59. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
  60. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  61. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
  62. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  63. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
  64. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  65. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
  66. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  67. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
  68. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  69. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
  70. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
  71. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
  72. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  73. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
  74. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  75. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
  76. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  77. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
  78. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  79. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
  80. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  81. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
  82. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  83. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
  84. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
  85. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  86. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
  87. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
  88. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
  89. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
  90. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  91. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
  92. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
  93. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
  94. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  95. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
  96. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
  97. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
  98. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  99. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
  100. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
  101. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
  102. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
  103. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
  104. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
  105. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
  106. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
  107. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
  108. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  109. package/dist/src/infrastructure/ui/views/App.style.js +0 -8
  110. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  111. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
  112. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
  113. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
  114. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  115. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
  116. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  117. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
  118. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
  119. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
  120. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  121. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
  122. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
  123. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
  124. package/dist/src/projection/shared/country.d.ts +0 -14
  125. package/dist/src/projection/shared/country.js +0 -15
  126. package/dist/src/projection/shared/customer.d.ts +0 -9
  127. package/dist/src/projection/shared/customer.js +0 -1
  128. package/dist/src/projection/shared/locale.d.ts +0 -12
  129. package/dist/src/projection/shared/locale.js +0 -13
  130. package/dist/src/projection/shared/order.d.ts +0 -6
  131. package/dist/src/projection/shared/order.js +0 -1
  132. package/dist/src/projection/shared/price.d.ts +0 -11
  133. package/dist/src/projection/shared/price.js +0 -1
  134. package/dist/src/projection/shared/size.d.ts +0 -21
  135. package/dist/src/projection/shared/size.js +0 -4
  136. package/dist/src/projection/shared/subscription.d.ts +0 -2
  137. package/dist/src/projection/shared/subscription.js +0 -1
  138. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
  139. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
  140. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
  141. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
  142. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
  143. package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
  144. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
  145. package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
  146. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
  147. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
  148. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
  149. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
@@ -1,23 +1,21 @@
1
1
  import { FC, ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from "react";
2
- import { PaymentPayload } from "@lookiero/payments-front";
3
2
  declare const setPaymentsBridge: () => undefined;
4
3
  declare const PaymentsQueryProvider: FC<PropsWithChildren>;
5
4
  declare const PaymentInstrumentSelect: FC;
5
+ interface StartLegacyBoxCheckoutCallbackArgs {
6
+ readonly status: string;
7
+ readonly final: boolean;
8
+ }
6
9
  interface StartLegacyBoxCheckoutFunction {
7
- (paymentFlowPayload: unknown): void;
10
+ (paymentFlowPayload: unknown, callback: (params: StartLegacyBoxCheckoutCallbackArgs) => Promise<void>): void;
8
11
  }
9
12
  interface PaymentFlowRef {
10
13
  readonly startLegacyBoxCheckout: StartLegacyBoxCheckoutFunction;
11
14
  }
12
15
  declare const paymentFlowRef: PaymentFlowRef;
13
16
  declare const PaymentFlow: ForwardRefExoticComponent<RefAttributes<PaymentFlowRef>>;
14
- interface UsePaymentStatusManagerResult {
15
- isLoading: boolean;
16
- consumePayload: (callback: (payload: PaymentPayload) => void) => void;
17
- }
18
- declare const usePaymentStatusManager: (section: Section) => UsePaymentStatusManagerResult;
19
17
  declare enum Section {
20
18
  BOX_CHECKOUT = "box-checkout"
21
19
  }
22
20
  export type { PaymentFlowRef };
23
- export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef, usePaymentStatusManager, };
21
+ export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef };
@@ -4,20 +4,17 @@ const setPaymentsBridge = () => void 0;
4
4
  const PaymentsQueryProvider = ({ children }) => children;
5
5
  const PaymentInstrumentSelect = () => null;
6
6
  const paymentFlowRef = {
7
- startLegacyBoxCheckout: async () => { },
7
+ startLegacyBoxCheckout: async (_paymentFlowPayload, callback) => {
8
+ await callback({ status: "EXECUTED", final: true });
9
+ },
8
10
  };
9
11
  const PaymentFlow = forwardRef((_props, ref) => {
10
12
  useImperativeHandle(ref, () => paymentFlowRef, []);
11
13
  return null;
12
14
  });
13
15
  PaymentFlow.displayName = "PaymentFlow";
14
- const paymentStatusManagerResult = {
15
- isLoading: false,
16
- consumePayload: (callback) => callback({ success: true }),
17
- };
18
- const usePaymentStatusManager = () => paymentStatusManagerResult;
19
16
  var Section;
20
17
  (function (Section) {
21
18
  Section["BOX_CHECKOUT"] = "box-checkout";
22
19
  })(Section || (Section = {}));
23
- export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef, usePaymentStatusManager, };
20
+ export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef };
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
- contextId: "CheckoutI18n",
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
  };
@@ -1,4 +1,3 @@
1
- import { PortalProvider } from "@gorhom/portal";
2
1
  import { useFonts } from "expo-font";
3
2
  import "expo/build/Expo.fx";
4
3
  import React, { useCallback, useState } from "react";
@@ -28,8 +27,6 @@ const customer = {
28
27
  customerId: "d3c2354b-9811-46d4-b2ba-5fba012ed94d",
29
28
  country: Country.ES,
30
29
  segment: Segment.WOMEN,
31
- email: "email@example.com",
32
- name: "Adèle Léonce Émilie",
33
30
  };
34
31
  const sentryConfig = {
35
32
  publicKey: "66cadf9444db4ea5945670f12ec08ae7",
@@ -42,7 +39,7 @@ const apiUrl = Platform.OS !== "web"
42
39
  : __DEV__
43
40
  ? "/local-to-dev"
44
41
  : "/checkout/api";
45
- const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDk0NjYsImV4cCI6MTc0MjQ3MDI5OSwiZGlzcGxheU5hbWUiOiJNaWtlbCIsImNvdW50cnlfY29kZSI6IkVTIiwiYWNjZXNzVmlhIjoiZW1haWwiLCJzdWJzY3JpcHRpb25TdGFydGluZ0RhdGUiOiIyMDI0LTExLTExIiwiaW1wZXJzb25hdGVkIjpmYWxzZSwidXVpZCI6ImQzYzIzNTRiLTk4MTEtNDZkNC1iMmJhLTVmYmEwMTJlZDk0ZCIsImlhdCI6MTc0MDA1MTA5OX0.AkuUZTsn9mgplQwatg0dPKyv1Hsc6r267UMahxMH19g";
42
+ const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDg3OTAsImV4cCI6MTc0MjM2OTcyNywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjQtMTEtMDgiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiNzRjYjRmNzYtM2YxNC00OTgzLTgxYTYtMmVlMmE5YTI3NWQ0IiwiaWF0IjoxNzM5OTUwNTI3fQ.ajNczGc6YhM23--PsqlAoDrp_GN87TnHEBOYyg2hoWM";
46
43
  const getAuthToken = () => Promise.resolve(authToken);
47
44
  const externalTranslationsUrl = Platform.OS !== "web"
48
45
  ? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
@@ -77,22 +74,22 @@ setPaymentsBridge({
77
74
  useFeatureFlags: () => ({}),
78
75
  locale: () => Promise.resolve("es-ES"),
79
76
  scrollView: ScrollView,
80
- hostUrl: "",
81
77
  });
82
78
  const kameleoonConfig = {
83
79
  siteCode: "aplm4v3ckn",
84
80
  experiments: {},
85
81
  };
86
- const { Component: Messaging } = process.env.EXPO_PUBLIC_APP_VARIANT === "test"
82
+ const { Component: Messaging, queryBus } = process.env.EXPO_PUBLIC_APP_VARIANT === "test"
87
83
  ? checkoutMockBootstrap()
88
84
  : checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
89
85
  const I18n = i18n({
90
86
  fetchTranslation: fetchTranslations({ translations }),
91
- contextId: "CheckoutI18n",
87
+ domain: "CheckoutI18n",
92
88
  });
93
89
  const Root = root({
94
90
  Messaging,
95
91
  I18n,
92
+ queryBus,
96
93
  getAuthToken,
97
94
  development: false,
98
95
  sentry: () => (process.env.EXPO_PUBLIC_APP_VARIANT === "test" ? {} : sentryConfig),
@@ -107,14 +104,13 @@ const ExpoRoot = () => {
107
104
  });
108
105
  const [isAccessible, setIsAccessible] = useState();
109
106
  const onNotAccessible = useCallback(() => setIsAccessible(false), []);
110
- return fontsLoaded ? (React.createElement(PortalProvider, null,
111
- React.createElement(PaymentsQueryProvider, null,
112
- React.createElement(EventProvider, null,
113
- React.createElement(Aurora, null,
114
- isAccessible === false && React.createElement(Text, { heading: true }, "Checkout is not accessible!"),
115
- React.createElement(Router, null,
116
- React.createElement(Routes, null,
117
- React.createElement(Route, { path: "/checkout/*", element: React.createElement(Root, { basePath: "/checkout", customer: customer, layout: DummyLayout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, onNotAccessible: onNotAccessible }) }),
118
- React.createElement(Route, { element: React.createElement(Navigate, { to: "/checkout", replace: true }), path: "*" })))))))) : null;
107
+ return fontsLoaded ? (React.createElement(PaymentsQueryProvider, null,
108
+ React.createElement(EventProvider, null,
109
+ React.createElement(Aurora, null,
110
+ isAccessible === false && React.createElement(Text, { heading: true }, "Checkout is not accessible!"),
111
+ React.createElement(Router, null,
112
+ React.createElement(Routes, null,
113
+ React.createElement(Route, { path: "/checkout/*", element: React.createElement(Root, { basePath: "/checkout", customer: customer, layout: DummyLayout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, onNotAccessible: onNotAccessible }) }),
114
+ React.createElement(Route, { element: React.createElement(Navigate, { to: "/checkout", replace: true }), path: "*" }))))))) : null;
119
115
  };
120
116
  export { ExpoRoot };
@@ -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(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
+ 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
  } }));
@@ -1,7 +1,6 @@
1
1
  declare const style: {
2
2
  input: {
3
3
  paddingTop: number;
4
- height?: "auto" | undefined;
5
4
  };
6
5
  inputContainer: {
7
6
  alignItems?: "flex-start" | undefined;
@@ -8,7 +8,6 @@ const style = StyleSheet.create({
8
8
  ...Platform.select({
9
9
  android: {
10
10
  paddingTop: space2,
11
- height: "auto",
12
11
  },
13
12
  }),
14
13
  },
@@ -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
1
  declare const style: {
2
2
  input: {
3
3
  paddingTop: number;
4
- height?: "auto" | undefined;
5
4
  };
6
5
  inputContainer: {
7
6
  alignItems?: "flex-start" | undefined;
@@ -8,7 +8,6 @@ const style = StyleSheet.create({
8
8
  ...Platform.select({
9
9
  android: {
10
10
  paddingTop: space2,
11
- height: "auto",
12
11
  },
13
12
  }),
14
13
  },
@@ -1,7 +1,6 @@
1
- import { PaymentPayload } from "@lookiero/payments-front";
1
+ import { Logger } from "@lookiero/sty-psp-logging";
2
2
  interface UsePaymentInstrumentEventsFunctionArgs {
3
- readonly onSuccess: (payload: PaymentPayload) => void;
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 { Section, usePaymentStatusManager } from "@lookiero/payments-front";
3
- const usePaymentInstrumentEvents = ({ onSuccess, onError }) => {
4
- const refreshStatus = usePaymentStatusManager(Section.BOX_CHECKOUT);
5
- useEffect(() => {
6
- const { isLoading, consumePayload } = refreshStatus;
7
- if (isLoading) {
8
- return;
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
- consumePayload((payload) => {
11
- if (payload.success) {
12
- onSuccess(payload);
13
- }
14
- else {
15
- onError(payload);
16
- }
17
- });
18
- }, [onError, onSuccess, refreshStatus]);
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: () => void;
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 { usePaymentInstrumentEvents } from "./usePaymentInstrumentEvents";
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
- setStartLegacyBoxCheckoutStatus("loading");
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
- paymentFlowRef.current?.startLegacyBoxCheckout(paymentFlowPayload);
25
- }, [paymentFlowRef, blockCheckoutBooking]);
26
- const onPaymentSuccess = useCallback(async () => {
27
- setStartLegacyBoxCheckoutStatus("success");
28
- await submitCheckoutCommand();
29
- createNotification({
30
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_PAYMENT_SUCCESS,
31
- level: NotificationLevel.SUCCESS,
32
- });
33
- }, [createNotification, submitCheckoutCommand]);
34
- const onPaymentError = useCallback((payload) => {
35
- setStartLegacyBoxCheckoutStatus("error");
36
- createNotification({
37
- bodyI18nKey: payload.metadata?.toaster?.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
38
- level: NotificationLevel.ERROR,
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
- }, [createNotification]);
41
- usePaymentInstrumentEvents({ onSuccess: onPaymentSuccess, onError: onPaymentError });
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
- }, [blockCheckoutBookingStatus, startLegacyBoxCheckoutStatus, submitCheckoutCommandStatus, onSuccess, onError]);
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";
@@ -1,14 +1,15 @@
1
- import { PortalHost } from "@gorhom/portal";
1
+ import { PortalProvider } from "@gorhom/portal";
2
2
  import React from "react";
3
3
  import { StatusBar } from "react-native";
4
4
  import { SafeAreaProvider } from "react-native-safe-area-context";
5
+ import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
5
6
  import { Notifications } from "@lookiero/sty-psp-notifications";
6
7
  import { theme } from "@lookiero/sty-psp-ui";
7
8
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
8
9
  const { colorBgBase } = theme();
9
10
  const App = ({ children }) => (React.createElement(SafeAreaProvider, null,
10
- React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
11
- React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID, portalHostName: "Checkout" }),
12
- React.createElement(PortalHost, { name: "Checkout" }),
13
- children));
11
+ React.createElement(PortalProvider, { rootHostName: "Checkout" },
12
+ React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
13
+ React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID, portalHostName: "Checkout" }),
14
+ React.createElement(AuroraPortalProvider, null, children))));
14
15
  export { App };
@@ -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
- country !== Country.NL && (React.createElement(View, { style: style.paymentSelector },
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))),
@@ -24,9 +24,6 @@ declare const style: {
24
24
  paymentSelector: {
25
25
  marginTop: number;
26
26
  };
27
- paymentSelectorNL: {
28
- marginBottom: number;
29
- };
30
27
  princingWrapper: {
31
28
  padding: number;
32
29
  };
@@ -28,9 +28,6 @@ const style = StyleSheet.create({
28
28
  paymentSelector: {
29
29
  marginTop: space6,
30
30
  },
31
- paymentSelectorNL: {
32
- marginBottom: space6,
33
- },
34
31
  princingWrapper: {
35
32
  padding: space6,
36
33
  },
@@ -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, Section } from "@lookiero/payments-front";
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, section: Section.BOX_CHECKOUT, token: authToken });
88
+ return React.createElement(PaymentFlow, { ref: paymentFlowRef, token: authToken });
89
89
  };
90
90
  export { CheckoutPaymentModal };
@@ -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 { useStaticInfo } from "../../../../hooks/useStaticInfo";
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 { customer } = useStaticInfo();
7
- return (React.createElement(PaymentInstrumentSelect, { beforeRedirect: returnUrl ? () => Promise.resolve(returnUrl) : undefined, hasError: false, section: Section.BOX_CHECKOUT, userInformation: {
8
- email: customer.email,
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 };
@@ -4,7 +4,5 @@ interface Customer {
4
4
  readonly customerId: string;
5
5
  readonly country: Country;
6
6
  readonly segment: Segment;
7
- readonly name: string;
8
- readonly email: string;
9
7
  }
10
8
  export type { Customer };
@@ -1 +1 @@
1
- export declare const VERSION = "9.9.0-beta.2";
1
+ export declare const VERSION = "9.9.0";
@@ -1 +1 @@
1
- export const VERSION = "9.9.0-beta.2";
1
+ export const VERSION = "9.9.0";