@lookiero/checkout 9.9.0-beta.2 → 9.10.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 (177) 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 +13 -17
  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/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +3 -2
  8. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -1
  9. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
  10. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
  11. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
  12. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
  13. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
  14. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +2 -3
  15. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +26 -17
  16. package/dist/src/infrastructure/ui/hooks/useQueryBus.d.ts +9 -0
  17. package/dist/src/infrastructure/ui/hooks/useQueryBus.js +10 -0
  18. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  19. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
  20. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +0 -1
  21. package/dist/src/infrastructure/ui/i18n/i18n.js +0 -1
  22. package/dist/src/infrastructure/ui/views/App.js +6 -5
  23. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +2 -5
  24. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
  25. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
  26. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +2 -2
  27. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  28. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +1 -0
  29. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +2 -1
  30. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +1 -0
  31. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -1
  32. package/dist/src/projection/customer/customer.d.ts +0 -2
  33. package/dist/src/version.d.ts +1 -1
  34. package/dist/src/version.js +1 -1
  35. package/fake-dependencies/@lookiero/payments-front/index.tsx +9 -32
  36. package/index.ts +2 -2
  37. package/jest.config.js +2 -2
  38. package/package.json +7 -7
  39. package/src/ExpoRoot.tsx +32 -37
  40. package/src/infrastructure/ui/Root.tsx +30 -17
  41. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +3 -2
  42. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
  43. package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
  44. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
  45. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +1 -0
  46. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +0 -1
  47. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +1 -0
  48. package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
  49. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
  50. package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
  51. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +60 -18
  52. package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +23 -0
  53. package/src/infrastructure/ui/hooks/useQueryBus.tsx +27 -0
  54. package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +58 -0
  55. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +77 -33
  56. package/src/infrastructure/ui/i18n/i18n.ts +0 -1
  57. package/src/infrastructure/ui/views/App.tsx +13 -5
  58. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +0 -3
  59. package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -12
  60. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +2 -2
  61. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
  62. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  63. package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
  64. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +3 -3
  65. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +5 -5
  66. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +2 -1
  67. package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +10 -8
  68. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
  69. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
  70. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +2 -2
  71. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +105 -102
  72. package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
  73. package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
  74. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -1
  75. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
  76. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +4 -4
  77. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
  78. package/src/projection/customer/customer.ts +0 -2
  79. package/dist/pact.config.d.ts +0 -21
  80. package/dist/pact.config.js +0 -16
  81. package/dist/public/public/assets/adaptive-icon.png +0 -0
  82. package/dist/public/public/assets/favicon.png +0 -0
  83. package/dist/public/public/assets/icon.png +0 -0
  84. package/dist/public/public/assets/splash.png +0 -0
  85. package/dist/public/public/images/not-found.png +0 -0
  86. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  87. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
  88. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  89. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
  90. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  91. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
  92. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  93. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
  94. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  95. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
  96. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  97. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
  98. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
  99. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
  100. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  101. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
  102. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  103. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
  104. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  105. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
  106. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  107. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
  108. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  109. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
  110. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  111. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
  112. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
  113. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  114. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
  115. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
  116. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
  117. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
  118. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  119. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
  120. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
  121. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
  122. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  123. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
  124. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
  125. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
  126. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  127. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
  128. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
  129. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
  130. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
  131. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
  132. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
  133. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
  134. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
  135. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
  136. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  137. package/dist/src/infrastructure/ui/views/App.style.js +0 -8
  138. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  139. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
  140. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
  141. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
  142. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  143. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
  144. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  145. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
  146. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
  147. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
  148. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  149. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
  150. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
  151. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
  152. package/dist/src/projection/shared/country.d.ts +0 -14
  153. package/dist/src/projection/shared/country.js +0 -15
  154. package/dist/src/projection/shared/customer.d.ts +0 -9
  155. package/dist/src/projection/shared/customer.js +0 -1
  156. package/dist/src/projection/shared/locale.d.ts +0 -12
  157. package/dist/src/projection/shared/locale.js +0 -13
  158. package/dist/src/projection/shared/order.d.ts +0 -6
  159. package/dist/src/projection/shared/order.js +0 -1
  160. package/dist/src/projection/shared/price.d.ts +0 -11
  161. package/dist/src/projection/shared/price.js +0 -1
  162. package/dist/src/projection/shared/size.d.ts +0 -21
  163. package/dist/src/projection/shared/size.js +0 -4
  164. package/dist/src/projection/shared/subscription.d.ts +0 -2
  165. package/dist/src/projection/shared/subscription.js +0 -1
  166. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
  167. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
  168. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
  169. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
  170. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
  171. package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
  172. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
  173. package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
  174. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
  175. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
  176. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
  177. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
@@ -21,6 +21,7 @@ declare const style: {
21
21
  };
22
22
  info: {
23
23
  backgroundColor: string;
24
+ gap: number;
24
25
  paddingBottom: number;
25
26
  paddingHorizontal: number;
26
27
  paddingTop: number;
@@ -1,7 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
  import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.style";
4
- const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
4
+ const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space1, space4, space6, space8 } = theme();
5
5
  const style = StyleSheet.create({
6
6
  background: {
7
7
  backgroundColor: colorBgPrimaryLight,
@@ -25,6 +25,7 @@ const style = StyleSheet.create({
25
25
  },
26
26
  info: {
27
27
  backgroundColor: colorBgBase,
28
+ gap: space1,
28
29
  paddingBottom: space4,
29
30
  paddingHorizontal: space6,
30
31
  paddingTop: space8,
@@ -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.10.0";
@@ -1 +1 @@
1
- export const VERSION = "9.9.0-beta.2";
1
+ export const VERSION = "9.10.0";
@@ -7,57 +7,34 @@ import {
7
7
  RefAttributes,
8
8
  useImperativeHandle,
9
9
  } from "react";
10
- import { PaymentPayload } from "@lookiero/payments-front";
11
10
 
12
11
  const setPaymentsBridge = () => void 0;
13
12
  const PaymentsQueryProvider: FC<PropsWithChildren> = ({ children }) => children;
14
13
  const PaymentInstrumentSelect: FC = () => null;
15
-
14
+ interface StartLegacyBoxCheckoutCallbackArgs {
15
+ readonly status: string;
16
+ readonly final: boolean;
17
+ }
16
18
  interface StartLegacyBoxCheckoutFunction {
17
- (paymentFlowPayload: unknown): void;
19
+ (paymentFlowPayload: unknown, callback: (params: StartLegacyBoxCheckoutCallbackArgs) => Promise<void>): void;
18
20
  }
19
-
20
21
  interface PaymentFlowRef {
21
22
  readonly startLegacyBoxCheckout: StartLegacyBoxCheckoutFunction;
22
23
  }
23
-
24
24
  const paymentFlowRef: PaymentFlowRef = {
25
- startLegacyBoxCheckout: async () => {},
25
+ startLegacyBoxCheckout: async (_paymentFlowPayload, callback) => {
26
+ await callback({ status: "EXECUTED", final: true });
27
+ },
26
28
  };
27
-
28
29
  const PaymentFlow: ForwardRefExoticComponent<RefAttributes<PaymentFlowRef>> = forwardRef<PaymentFlowRef, unknown>(
29
30
  (_props, ref) => {
30
31
  useImperativeHandle(ref, () => paymentFlowRef, []);
31
32
  return null;
32
33
  },
33
34
  );
34
-
35
35
  PaymentFlow.displayName = "PaymentFlow";
36
-
37
- interface UsePaymentStatusManagerResult {
38
- isLoading: boolean;
39
- consumePayload: (callback: (payload: PaymentPayload) => void) => void;
40
- }
41
-
42
- const paymentStatusManagerResult: UsePaymentStatusManagerResult = {
43
- isLoading: false,
44
- consumePayload: (callback) => callback({ success: true } as PaymentPayload),
45
- };
46
-
47
- const usePaymentStatusManager: (section: Section) => UsePaymentStatusManagerResult = () => paymentStatusManagerResult;
48
-
49
36
  enum Section {
50
37
  BOX_CHECKOUT = "box-checkout",
51
38
  }
52
-
53
39
  export type { PaymentFlowRef };
54
-
55
- export {
56
- PaymentsQueryProvider,
57
- PaymentInstrumentSelect,
58
- PaymentFlow,
59
- Section,
60
- setPaymentsBridge,
61
- paymentFlowRef,
62
- usePaymentStatusManager,
63
- };
40
+ export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef };
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
- contextId: "CheckoutI18n",
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/jest.config.js CHANGED
@@ -1,9 +1,9 @@
1
- const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.react-native.js");
1
+ const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.expo.js");
2
2
 
3
3
  module.exports = {
4
4
  ...jestReactNativeConfig,
5
- setupFiles: ["../../node_modules/react-native-gesture-handler/jestSetup.js"],
6
5
  setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
6
+ setupFiles: ["../../node_modules/react-native-gesture-handler/jestSetup.js"],
7
7
  moduleNameMapper: {
8
8
  ...(jestReactNativeConfig.moduleNameMapper || {}),
9
9
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "9.9.0-beta.2",
3
+ "version": "9.10.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.2",
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.6",
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": "7.0.0-ideal-integration-2025.2.24.164234",
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": ">=0.9",
78
- "@lookiero/i18n-react": ">=0.9",
79
- "@lookiero/payments-front": "7.0.0-LK-37736-2025.2.12.160011",
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
@@ -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, { FC, useCallback, useState } from "react";
@@ -33,11 +32,9 @@ const order: Order = {
33
32
  };
34
33
 
35
34
  const customer: Customer = {
36
- customerId: "d3c2354b-9811-46d4-b2ba-5fba012ed94d",
35
+ customerId: "74cb4f76-3f14-4983-81a6-2ee2a9a275d4",
37
36
  country: Country.ES,
38
37
  segment: Segment.WOMEN,
39
- email: "email@example.com",
40
- name: "Adèle Léonce Émilie",
41
38
  };
42
39
 
43
40
  const sentryConfig: SentryEnvironment = {
@@ -54,7 +51,7 @@ const apiUrl =
54
51
  ? "/local-to-dev"
55
52
  : "/checkout/api";
56
53
  const authToken =
57
- "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDk0NjYsImV4cCI6MTc0MjQ3MDI5OSwiZGlzcGxheU5hbWUiOiJNaWtlbCIsImNvdW50cnlfY29kZSI6IkVTIiwiYWNjZXNzVmlhIjoiZW1haWwiLCJzdWJzY3JpcHRpb25TdGFydGluZ0RhdGUiOiIyMDI0LTExLTExIiwiaW1wZXJzb25hdGVkIjpmYWxzZSwidXVpZCI6ImQzYzIzNTRiLTk4MTEtNDZkNC1iMmJhLTVmYmEwMTJlZDk0ZCIsImlhdCI6MTc0MDA1MTA5OX0.AkuUZTsn9mgplQwatg0dPKyv1Hsc6r267UMahxMH19g";
54
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDg3OTAsImV4cCI6MTc0NDQ0MzcwMiwiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjQtMTEtMDgiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiNzRjYjRmNzYtM2YxNC00OTgzLTgxYTYtMmVlMmE5YTI3NWQ0IiwiaWF0IjoxNzQxNzY1MzAyfQ.VrfjWZlhuG8dhDSFTbyGyClRFGbhdx9SglkE8rEEJyE";
58
55
  const getAuthToken = () => Promise.resolve(authToken);
59
56
 
60
57
  const externalTranslationsUrl =
@@ -95,7 +92,6 @@ setPaymentsBridge({
95
92
  useFeatureFlags: () => ({}),
96
93
  locale: () => Promise.resolve("es-ES"),
97
94
  scrollView: ScrollView,
98
- hostUrl: "",
99
95
  });
100
96
 
101
97
  const kameleoonConfig: KameleoonEnvironment = {
@@ -103,17 +99,18 @@ const kameleoonConfig: KameleoonEnvironment = {
103
99
  experiments: {},
104
100
  };
105
101
 
106
- const { Component: Messaging } =
102
+ const { Component: Messaging, queryBus } =
107
103
  process.env.EXPO_PUBLIC_APP_VARIANT === "test"
108
104
  ? checkoutMockBootstrap()
109
105
  : checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
110
106
  const I18n = i18n({
111
107
  fetchTranslation: fetchTranslations({ translations }),
112
- contextId: "CheckoutI18n",
108
+ domain: "CheckoutI18n",
113
109
  });
114
110
  const Root = root({
115
111
  Messaging,
116
112
  I18n,
113
+ queryBus,
117
114
  getAuthToken,
118
115
  development: false,
119
116
  sentry: () => (process.env.EXPO_PUBLIC_APP_VARIANT === "test" ? ({} as SentryEnvironment) : sentryConfig),
@@ -132,37 +129,35 @@ const ExpoRoot: FC = () => {
132
129
  const onNotAccessible = useCallback(() => setIsAccessible(false), []);
133
130
 
134
131
  return fontsLoaded ? (
135
- <PortalProvider>
136
- <PaymentsQueryProvider>
137
- <EventProvider>
138
- <Aurora>
139
- {isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
132
+ <PaymentsQueryProvider>
133
+ <EventProvider>
134
+ <Aurora>
135
+ {isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
140
136
 
141
- <Router>
142
- <Routes>
143
- <Route
144
- path="/checkout/*"
145
- element={
146
- <Root
147
- basePath="/checkout"
148
- customer={customer}
149
- layout={DummyLayout}
150
- locale={locale}
151
- order={order}
152
- subscription={subscription}
153
- useRedirect={useRedirect}
154
- onNotAccessible={onNotAccessible}
155
- />
156
- }
157
- />
137
+ <Router>
138
+ <Routes>
139
+ <Route
140
+ path="/checkout/*"
141
+ element={
142
+ <Root
143
+ basePath="/checkout"
144
+ customer={customer}
145
+ layout={DummyLayout}
146
+ locale={locale}
147
+ order={order}
148
+ subscription={subscription}
149
+ useRedirect={useRedirect}
150
+ onNotAccessible={onNotAccessible}
151
+ />
152
+ }
153
+ />
158
154
 
159
- <Route element={<Navigate to="/checkout" replace />} path="*" />
160
- </Routes>
161
- </Router>
162
- </Aurora>
163
- </EventProvider>
164
- </PaymentsQueryProvider>
165
- </PortalProvider>
155
+ <Route element={<Navigate to="/checkout" replace />} path="*" />
156
+ </Routes>
157
+ </Router>
158
+ </Aurora>
159
+ </EventProvider>
160
+ </PaymentsQueryProvider>
166
161
  ) : null;
167
162
  };
168
163
 
@@ -3,6 +3,7 @@ import React, { ComponentType, useCallback } from "react";
3
3
  import { Platform } from "react-native";
4
4
  import { useRoutes as reactRouterUseRoutes } from "react-router-native";
5
5
  import { I18n } from "@lookiero/i18n-react";
6
+ import { QueryBus } from "@lookiero/messaging";
6
7
  import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
7
8
  import { Locale } from "@lookiero/sty-psp-locale";
8
9
  import { SentryEnvironment, SentryLoggerFunctionArgs, sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
@@ -11,11 +12,13 @@ import { Customer } from "../../projection/customer/customer";
11
12
  import { Order } from "../../projection/order/order";
12
13
  import { Subscription } from "../../projection/subscription/subscription";
13
14
  import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
15
+ import { QueryBusProvider } from "./hooks/useQueryBus";
14
16
  import { Routing } from "./routing/Routing";
15
17
 
16
18
  interface RootFunctionArgs {
17
19
  readonly Messaging: MessagingRoot;
18
20
  readonly I18n: I18n;
21
+ readonly queryBus: QueryBus;
19
22
  readonly development?: boolean;
20
23
  readonly sentry: () => SentryEnvironment;
21
24
  readonly getAuthToken: () => Promise<string>;
@@ -39,7 +42,15 @@ interface RootProps {
39
42
  readonly useRoutes?: typeof reactRouterUseRoutes;
40
43
  }
41
44
 
42
- const root: RootFunction = ({ Messaging, I18n, getAuthToken, development, sentry, kameleoon: kameleoonConfig }) => {
45
+ const root: RootFunction = ({
46
+ Messaging,
47
+ I18n,
48
+ queryBus,
49
+ getAuthToken,
50
+ development,
51
+ sentry,
52
+ kameleoon: kameleoonConfig,
53
+ }) => {
43
54
  const logger = sentryLogger(sentry);
44
55
  const kameleoon = kameleoonConfig();
45
56
 
@@ -60,22 +71,24 @@ const root: RootFunction = ({ Messaging, I18n, getAuthToken, development, sentry
60
71
 
61
72
  return (
62
73
  <Messaging includeReactQueryDevTools={Platform.OS === "web"}>
63
- <Routing
64
- I18n={I18n}
65
- basePath={basePath}
66
- customer={customer}
67
- getAuthToken={getAuthToken}
68
- kameleoon={kameleoon}
69
- layout={layout}
70
- locale={locale}
71
- order={order}
72
- subscription={subscription}
73
- useRedirect={useRedirect}
74
- useRoutes={useRoutes}
75
- onCheckoutSubmitted={onCheckoutSubmitted}
76
- onI18nError={development ? undefined : handleOnI18nError}
77
- onNotAccessible={onNotAccessible}
78
- />
74
+ <QueryBusProvider queryBus={queryBus}>
75
+ <Routing
76
+ I18n={I18n}
77
+ basePath={basePath}
78
+ customer={customer}
79
+ getAuthToken={getAuthToken}
80
+ kameleoon={kameleoon}
81
+ layout={layout}
82
+ locale={locale}
83
+ order={order}
84
+ subscription={subscription}
85
+ useRedirect={useRedirect}
86
+ useRoutes={useRoutes}
87
+ onCheckoutSubmitted={onCheckoutSubmitted}
88
+ onI18nError={development ? undefined : handleOnI18nError}
89
+ onNotAccessible={onNotAccessible}
90
+ />
91
+ </QueryBusProvider>
79
92
  </Messaging>
80
93
  );
81
94
  };
@@ -1,10 +1,11 @@
1
1
  import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
2
3
 
3
- // TODO: get the font family from Aurora
4
+ const { fontMap } = theme();
4
5
 
5
6
  const style = StyleSheet.create({
6
7
  textBold: {
7
- fontFamily: "AreaNormal-Extrabold",
8
+ fontFamily: fontMap.Action,
8
9
  },
9
10
  });
10
11
 
@@ -100,7 +100,7 @@ exports[`FiveItemsDiscountBanner component matches the snapshot 1`] = `
100
100
  "paddingBottom": 0,
101
101
  "paddingLeft": 0,
102
102
  "paddingRight": 0,
103
- "paddingTop": 5,
103
+ "paddingTop": 4,
104
104
  },
105
105
  ]
106
106
  }
@@ -51,7 +51,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
51
51
  "paddingBottom": 0,
52
52
  "paddingLeft": 0,
53
53
  "paddingRight": 0,
54
- "paddingTop": 4,
54
+ "paddingTop": 0,
55
55
  },
56
56
  ]
57
57
  }
@@ -81,7 +81,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
81
81
  "paddingBottom": 0,
82
82
  "paddingLeft": 0,
83
83
  "paddingRight": 0,
84
- "paddingTop": 4,
84
+ "paddingTop": 0,
85
85
  "textDecorationLine": "line-through",
86
86
  },
87
87
  ]
@@ -146,7 +146,7 @@ exports[`Price atom matches the snapshot for a non-discounted price: non-discoun
146
146
  "paddingBottom": 0,
147
147
  "paddingLeft": 0,
148
148
  "paddingRight": 0,
149
- "paddingTop": 4,
149
+ "paddingTop": 0,
150
150
  },
151
151
  ]
152
152
  }
@@ -11,7 +11,6 @@ const style = StyleSheet.create({
11
11
  ...Platform.select({
12
12
  android: {
13
13
  paddingTop: space2,
14
- height: "auto",
15
14
  },
16
15
  }),
17
16
  },
@@ -32,6 +32,7 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
32
32
  placeholder={placeholderText}
33
33
  style={style}
34
34
  testID={testID}
35
+ textAlignVertical="top"
35
36
  value={feedback}
36
37
  multiline
37
38
  onBlur={onBlur}
@@ -11,7 +11,6 @@ const style = StyleSheet.create({
11
11
  ...Platform.select({
12
12
  android: {
13
13
  paddingTop: space2,
14
- height: "auto",
15
14
  },
16
15
  }),
17
16
  },
@@ -37,6 +37,7 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
37
37
  placeholder={placeholderText}
38
38
  style={style}
39
39
  testID={testID}
40
+ textAlignVertical="top"
40
41
  value={feedback}
41
42
  multiline
42
43
  onBlur={onBlur}
@@ -183,7 +183,7 @@ exports[`CheckoutHeader template matches the snapshot 1`] = `
183
183
  "paddingBottom": 0,
184
184
  "paddingLeft": 0,
185
185
  "paddingRight": 0,
186
- "paddingTop": 2,
186
+ "paddingTop": 0,
187
187
  },
188
188
  ]
189
189
  }
@@ -72,7 +72,7 @@ exports[`ItemDetailHeader template matches the snapshot 1`] = `
72
72
  "paddingBottom": 0,
73
73
  "paddingLeft": 0,
74
74
  "paddingRight": 0,
75
- "paddingTop": 2,
75
+ "paddingTop": 0,
76
76
  },
77
77
  ]
78
78
  }
@@ -183,7 +183,7 @@ exports[`ItemHeader template matches the snapshot 1`] = `
183
183
  "paddingBottom": 0,
184
184
  "paddingLeft": 0,
185
185
  "paddingRight": 0,
186
- "paddingTop": 2,
186
+ "paddingTop": 0,
187
187
  },
188
188
  ]
189
189
  }
@@ -1,33 +1,75 @@
1
- import { useEffect } from "react";
2
- import { PaymentPayload, Section, usePaymentStatusManager } from "@lookiero/payments-front";
1
+ import { useCallback, useEffect } from "react";
2
+ import { useEvent } from "@lookiero/event";
3
+ import { Logger } from "@lookiero/sty-psp-logging";
4
+ import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
5
+ import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
+ import { I18nMessages } from "../i18n/i18n";
7
+
8
+ const PAYMENT_ERROR = "ERROR";
9
+ const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
10
+
11
+ interface Message {
12
+ readonly id: string;
13
+ }
14
+ interface OnSuccessFunctionArgs {
15
+ readonly message: Message;
16
+ }
17
+ interface OnSuccessFunction {
18
+ (args: OnSuccessFunctionArgs): void;
19
+ }
20
+
21
+ interface Toaster {
22
+ readonly id: string;
23
+ }
24
+ interface Error {
25
+ readonly toaster?: Toaster;
26
+ }
27
+ interface OnErrorFunctionArgs {
28
+ readonly error: Error;
29
+ }
30
+ interface OnErrorFunction {
31
+ (args: OnErrorFunctionArgs): void;
32
+ }
3
33
 
4
34
  interface UsePaymentInstrumentEventsFunctionArgs {
5
- readonly onSuccess: (payload: PaymentPayload) => void;
6
- readonly onError: (payload: PaymentPayload) => void;
35
+ readonly logger: Logger;
7
36
  }
8
37
 
9
38
  interface UsePaymentInstrumentEventsFunction {
10
39
  (args: UsePaymentInstrumentEventsFunctionArgs): void;
11
40
  }
12
41
 
13
- const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ onSuccess, onError }) => {
14
- const refreshStatus = usePaymentStatusManager(Section.BOX_CHECKOUT);
42
+ const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ logger }) => {
43
+ const { subscribe, unsubscribe } = useEvent();
15
44
 
16
- useEffect(() => {
17
- const { isLoading, consumePayload } = refreshStatus;
45
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
18
46
 
19
- if (isLoading) {
20
- return;
21
- }
47
+ const onSuccess: OnSuccessFunction = useCallback(
48
+ ({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }),
49
+ [createNotification],
50
+ );
22
51
 
23
- consumePayload((payload) => {
24
- if (payload.success) {
25
- onSuccess(payload);
26
- } else {
27
- onError(payload);
52
+ const onError: OnErrorFunction = useCallback(
53
+ ({ error }) => {
54
+ if (error.toaster) {
55
+ createNotification({
56
+ bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
57
+ level: NotificationLevel.ERROR,
58
+ });
28
59
  }
29
- });
30
- }, [onError, onSuccess, refreshStatus]);
60
+ },
61
+ [createNotification],
62
+ );
63
+
64
+ useEffect(() => {
65
+ subscribe({ event: PAYMENT_ERROR }, onError);
66
+ subscribe({ event: PAYMENT_SUCCESS }, onSuccess);
67
+
68
+ return () => {
69
+ unsubscribe({ event: PAYMENT_ERROR }, onError);
70
+ unsubscribe({ event: PAYMENT_SUCCESS }, onSuccess);
71
+ };
72
+ }, [subscribe, unsubscribe, createNotification, onError, onSuccess]);
31
73
  };
32
74
 
33
75
  export { usePaymentInstrumentEvents };
@@ -0,0 +1,23 @@
1
+ import { renderHook, waitFor } from "@testing-library/react-native";
2
+ import { mockFn } from "jest-mock-extended";
3
+ import React, { FC } from "react";
4
+ import { QueryBus } from "@lookiero/messaging";
5
+ import { QueryBusProvider, useQueryBus as sut } from "./useQueryBus";
6
+
7
+ const mockQueryBus = mockFn<QueryBus>();
8
+
9
+ interface WrapperProps {
10
+ readonly children: JSX.Element;
11
+ }
12
+
13
+ const Wrapper: FC<WrapperProps> = ({ children }) => (
14
+ <QueryBusProvider queryBus={mockQueryBus}>{children}</QueryBusProvider>
15
+ );
16
+
17
+ describe("useQueryBus hook", () => {
18
+ it("returns the QueryBusProvider provided queryBus", async () => {
19
+ const { result } = renderHook(() => sut(), { wrapper: Wrapper });
20
+
21
+ await waitFor(() => expect(result.current).toEqual(mockQueryBus));
22
+ });
23
+ });
@@ -0,0 +1,27 @@
1
+ import React, { createContext, FC, ReactNode, useContext } from "react";
2
+ import invariant from "tiny-invariant";
3
+ import { QueryBus } from "@lookiero/messaging";
4
+
5
+ const QueryBusContext = createContext<QueryBus>(null as unknown as QueryBus);
6
+
7
+ interface QueryBusProviderProps {
8
+ readonly children: ReactNode;
9
+ readonly queryBus: QueryBus;
10
+ }
11
+
12
+ const QueryBusProvider: FC<QueryBusProviderProps> = ({ children, queryBus }) => (
13
+ <QueryBusContext.Provider value={queryBus}>{children}</QueryBusContext.Provider>
14
+ );
15
+
16
+ const useQueryBus = () => {
17
+ const queryBus = useContext(QueryBusContext);
18
+
19
+ invariant(
20
+ queryBus,
21
+ "Your are trying to use the useQueryBus hook without wrapping your app with the <QueryBusProvider>.",
22
+ );
23
+
24
+ return queryBus;
25
+ };
26
+
27
+ export { useQueryBus, QueryBusProvider };