@lookiero/checkout 9.14.0 → 10.0.0-beta.1

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 (288) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +8 -6
  2. package/dist/fake-dependencies/@lookiero/payments-front/index.js +7 -4
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +1 -2
  5. package/dist/pact.config.d.ts +21 -0
  6. package/dist/pact.config.js +16 -0
  7. package/dist/public/public/assets/adaptive-icon.png +0 -0
  8. package/dist/public/public/assets/favicon.png +0 -0
  9. package/dist/public/public/assets/icon.png +0 -0
  10. package/dist/public/public/assets/splash.png +0 -0
  11. package/dist/public/public/images/not-found.png +0 -0
  12. package/dist/src/Expo.js +0 -2
  13. package/dist/src/ExpoRoot.js +19 -15
  14. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +1 -1
  15. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +2 -0
  16. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
  17. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
  18. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
  19. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
  20. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
  21. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
  22. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
  23. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
  24. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
  25. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
  26. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
  27. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
  28. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
  29. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
  30. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
  31. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
  32. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
  33. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
  34. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
  35. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
  36. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
  37. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
  38. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
  39. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
  40. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.d.ts +1 -1
  41. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +2 -1
  42. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
  43. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
  44. package/dist/src/infrastructure/tracking/tracking.d.ts +2 -2
  45. package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +10 -17
  46. package/dist/src/infrastructure/tracking/useTrackCheckout.js +27 -12
  47. package/dist/src/infrastructure/ui/Root.d.ts +6 -6
  48. package/dist/src/infrastructure/ui/Root.js +2 -3
  49. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +1 -2
  50. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +2 -3
  51. package/dist/src/infrastructure/ui/components/atoms/price/Price.js +0 -3
  52. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
  53. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
  54. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
  55. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
  56. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
  57. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
  58. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
  59. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
  60. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
  61. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
  62. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
  63. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
  64. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +3 -7
  65. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +2 -18
  66. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +2 -14
  67. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
  68. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
  69. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +3 -4
  70. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +1 -0
  71. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +1 -0
  72. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
  73. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -3
  74. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
  75. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -3
  76. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -3
  77. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
  78. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -5
  79. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
  80. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -4
  81. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +1 -0
  82. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +1 -0
  83. package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +3 -0
  84. package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +13 -0
  85. package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
  86. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
  87. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
  88. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
  89. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
  90. package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
  91. package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +4 -4
  92. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.d.ts +26 -0
  93. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +135 -0
  94. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
  95. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
  96. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +3 -2
  97. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +17 -26
  98. package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +2 -0
  99. package/dist/src/infrastructure/ui/hooks/useStaticInfo.js +2 -2
  100. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  101. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +22 -55
  102. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
  103. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
  104. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -2
  105. package/dist/src/infrastructure/ui/i18n/i18n.js +2 -2
  106. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
  107. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
  108. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
  109. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
  110. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -14
  111. package/dist/src/infrastructure/ui/routing/Routing.d.ts +5 -5
  112. package/dist/src/infrastructure/ui/routing/Routing.js +8 -18
  113. package/dist/src/infrastructure/ui/routing/routes.d.ts +0 -1
  114. package/dist/src/infrastructure/ui/routing/routes.js +0 -1
  115. package/dist/src/infrastructure/ui/test/render.js +3 -7
  116. package/dist/src/infrastructure/ui/views/App.js +5 -7
  117. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  118. package/dist/src/infrastructure/ui/views/App.style.js +8 -0
  119. package/dist/src/infrastructure/ui/views/checkout/Checkout.d.ts +7 -2
  120. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +24 -15
  121. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
  122. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
  123. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +16 -16
  124. package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
  125. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  126. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
  127. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
  128. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
  129. package/dist/src/infrastructure/ui/views/item/Item.js +1 -3
  130. package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
  131. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +5 -11
  132. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
  133. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
  134. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +0 -1
  135. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +1 -2
  136. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  137. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
  138. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
  139. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
  140. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
  141. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
  142. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
  143. package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
  144. package/dist/src/infrastructure/ui/views/return/components/price/Price.js +0 -3
  145. package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
  146. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +6 -6
  147. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -1
  148. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +1 -2
  149. package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
  150. package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -6
  151. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -3
  152. package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +6 -8
  153. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
  154. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
  155. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
  156. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
  157. package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +1 -3
  158. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
  159. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
  160. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
  161. package/dist/src/projection/customer/customer.d.ts +2 -0
  162. package/dist/src/projection/order/order.d.ts +1 -1
  163. package/dist/src/projection/shared/country.d.ts +14 -0
  164. package/dist/src/projection/shared/country.js +15 -0
  165. package/dist/src/projection/shared/customer.d.ts +9 -0
  166. package/dist/src/projection/shared/customer.js +1 -0
  167. package/dist/src/projection/shared/locale.d.ts +12 -0
  168. package/dist/src/projection/shared/locale.js +13 -0
  169. package/dist/src/projection/shared/order.d.ts +6 -0
  170. package/dist/src/projection/shared/order.js +1 -0
  171. package/dist/src/projection/shared/price.d.ts +11 -0
  172. package/dist/src/projection/shared/price.js +1 -0
  173. package/dist/src/projection/shared/size.d.ts +21 -0
  174. package/dist/src/projection/shared/size.js +4 -0
  175. package/dist/src/projection/shared/subscription.d.ts +2 -0
  176. package/dist/src/projection/shared/subscription.js +1 -0
  177. package/dist/src/projection/subscription/subscription.d.ts +1 -1
  178. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +15 -0
  179. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
  180. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
  181. package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
  182. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +14 -0
  183. package/dist/src/shared/ui/components/atoms/field/Field.js +29 -0
  184. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +16 -0
  185. package/dist/src/shared/ui/components/atoms/field/Field.style.js +19 -0
  186. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +24 -0
  187. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +28 -0
  188. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +29 -0
  189. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +37 -0
  190. package/dist/src/version.d.ts +1 -1
  191. package/dist/src/version.js +1 -1
  192. package/fake-dependencies/@lookiero/payments-front/index.tsx +32 -9
  193. package/index.ts +11 -5
  194. package/jest.config.js +2 -2
  195. package/package.json +9 -9
  196. package/src/Expo.tsx +0 -3
  197. package/src/ExpoRoot.tsx +44 -38
  198. package/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.ts +4 -1
  199. package/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.ts +3 -2
  200. package/src/infrastructure/tracking/tracking.ts +2 -2
  201. package/src/infrastructure/tracking/useTrackCheckout.ts +66 -56
  202. package/src/infrastructure/ui/Root.tsx +9 -9
  203. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +2 -3
  204. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +2 -3
  205. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
  206. package/src/infrastructure/ui/components/atoms/price/Price.tsx +0 -3
  207. package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
  208. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.ts +4 -25
  209. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +7 -13
  210. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +1 -2
  211. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +1 -2
  212. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +1 -0
  213. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +2 -4
  214. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
  215. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +2 -3
  216. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
  217. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -3
  218. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +2 -3
  219. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +1 -2
  220. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +5 -6
  221. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
  222. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +1 -0
  223. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +2 -4
  224. package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +15 -0
  225. package/src/infrastructure/ui/components/templates/footer/Footer.tsx +19 -0
  226. package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +1127 -0
  227. package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
  228. package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
  229. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
  230. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
  231. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +5 -4
  232. package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
  233. package/src/infrastructure/ui/hooks/{useSubmitCheckout.test.ts → useCheckoutFlow.test.ts} +1 -1
  234. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +212 -0
  235. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +18 -60
  236. package/src/infrastructure/ui/hooks/useStaticInfo.tsx +4 -2
  237. package/src/infrastructure/ui/i18n/i18n.ts +2 -3
  238. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +3 -3
  239. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +3 -17
  240. package/src/infrastructure/ui/routing/Routing.tsx +25 -39
  241. package/src/infrastructure/ui/routing/routes.ts +0 -1
  242. package/src/infrastructure/ui/test/render.tsx +4 -10
  243. package/src/infrastructure/ui/views/App.tsx +5 -14
  244. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +3 -0
  245. package/src/infrastructure/ui/views/checkout/Checkout.tsx +55 -18
  246. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +116 -121
  247. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
  248. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
  249. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  250. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
  251. package/src/infrastructure/ui/views/item/Item.tsx +1 -2
  252. package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
  253. package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
  254. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +5 -11
  255. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +88 -160
  256. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
  257. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +128 -244
  258. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +1 -2
  259. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
  260. package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +8 -10
  261. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
  262. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
  263. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
  264. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
  265. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +41 -75
  266. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +102 -105
  267. package/src/infrastructure/ui/views/return/components/price/Price.tsx +0 -3
  268. package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
  269. package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
  270. package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
  271. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +1 -2
  272. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +6 -6
  273. package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
  274. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
  275. package/src/infrastructure/ui/views/summary/Summary.tsx +5 -6
  276. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -3
  277. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +82 -154
  278. package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +6 -8
  279. package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +1 -2
  280. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
  281. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
  282. package/src/projection/customer/customer.ts +2 -0
  283. package/src/projection/order/order.ts +1 -1
  284. package/src/projection/subscription/subscription.ts +1 -1
  285. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +0 -169
  286. package/src/infrastructure/ui/routing/useBasePath.test.tsx +0 -19
  287. package/src/infrastructure/ui/routing/useBasePath.tsx +0 -24
  288. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +0 -125
@@ -1,14 +1,10 @@
1
1
  import { render, RenderAPI } from "@testing-library/react-native";
2
2
  import { mock } from "jest-mock-extended";
3
3
  import React, { FC, Fragment, ReactElement } from "react";
4
+ import { IntlProvider } from "react-intl";
4
5
  import { Aurora } from "@lookiero/aurora";
5
- import { createI18nProvider } from "@lookiero/i18n-react";
6
6
  import { TranslationMessages } from "@lookiero/i18n/domain/translation/model/translationMessages";
7
7
  import { Logger, LoggerProvider } from "@lookiero/sty-psp-logging";
8
- import { DOMAIN } from "../i18n/i18n";
9
- import { BasePathProvider } from "../routing/useBasePath";
10
-
11
- const I18nProvider = createI18nProvider({ domain: DOMAIN });
12
8
 
13
9
  interface RenderArgs {
14
10
  readonly locale?: string;
@@ -27,13 +23,11 @@ const renderWrapper: RenderWrapperFunction =
27
23
  // eslint-disable-next-line react/display-name, react/prop-types
28
24
  ({ children }) => (
29
25
  <Aurora>
30
- <I18nProvider locale={locale as string} messages={messages} onError={() => void 0}>
26
+ <IntlProvider locale={locale as string} messages={messages} onError={() => void 0}>
31
27
  <LoggerProvider logger={logger}>
32
- <BasePathProvider basePath="">
33
- <Wrapper>{children}</Wrapper>
34
- </BasePathProvider>
28
+ <Wrapper>{children}</Wrapper>
35
29
  </LoggerProvider>
36
- </I18nProvider>
30
+ </IntlProvider>
37
31
  </Aurora>
38
32
  );
39
33
 
@@ -1,12 +1,10 @@
1
- import { PortalProvider } from "@gorhom/portal";
1
+ import { PortalHost } from "@gorhom/portal";
2
2
  import React, { FC } 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";
6
5
  import { Notifications } from "@lookiero/sty-psp-notifications";
7
6
  import { theme } from "@lookiero/sty-psp-ui";
8
7
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
9
- import { DOMAIN } from "../i18n/i18n";
10
8
 
11
9
  const { colorBgBase } = theme();
12
10
 
@@ -16,17 +14,10 @@ interface AppProps {
16
14
 
17
15
  const App: FC<AppProps> = ({ children }) => (
18
16
  <SafeAreaProvider>
19
- <PortalProvider rootHostName="Checkout">
20
- <StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
21
- <Notifications contextId={MESSAGING_CONTEXT_ID} domain={DOMAIN} portalHostName="Checkout" />
22
- {/*
23
- We are using the Aurora's PortalProvider at this level for notifications to work properly.
24
-
25
- PaymentInstrumentSelect uses Aurora's Portal, and if we rely on UAF's Portal (injected by <Aurora>)
26
- notifications would be displayed in a layer below Portal's one (not visible).
27
- */}
28
- <AuroraPortalProvider>{children}</AuroraPortalProvider>
29
- </PortalProvider>
17
+ <StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
18
+ <Notifications contextId={MESSAGING_CONTEXT_ID} portalHostName="Checkout" />
19
+ <PortalHost name="Checkout" />
20
+ {children}
30
21
  </SafeAreaProvider>
31
22
  );
32
23
 
@@ -30,6 +30,9 @@ const style = StyleSheet.create({
30
30
  paymentSelector: {
31
31
  marginTop: space6,
32
32
  },
33
+ paymentSelectorNL: {
34
+ marginBottom: space6,
35
+ },
33
36
  princingWrapper: {
34
37
  padding: space6,
35
38
  },
@@ -1,11 +1,14 @@
1
- import React, { FC, ReactNode, useCallback, useMemo, useState } from "react";
1
+ import React, { FC, useCallback, useMemo, useState } from "react";
2
2
  import { LayoutRectangle, Platform, ScrollView, View } from "react-native";
3
3
  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";
7
8
  import { Layout as UiLayout, Sticky } from "@lookiero/sty-psp-ui";
8
9
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
10
+ import { OrderProjection } from "../../../../projection/order/order";
11
+ import { SubscriptionProjection } from "../../../../projection/subscription/subscription";
9
12
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
10
13
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
11
14
  import { TrackingPage } from "../../../tracking/tracking";
@@ -14,10 +17,10 @@ import { useTrackPressBack } from "../../../tracking/useTrackPressBack";
14
17
  import { useTrackPressContinue } from "../../../tracking/useTrackPressContinue";
15
18
  import { Body } from "../../components/layouts/body/Body";
16
19
  import { CheckoutHeader } from "../../components/templates/header/checkoutHeader/CheckoutHeader";
20
+ import { useCheckoutFlow } from "../../hooks/useCheckoutFlow";
17
21
  import { useStaticInfo } from "../../hooks/useStaticInfo";
18
- import { DOMAIN, I18nMessages } from "../../i18n/i18n";
22
+ import { I18nMessages } from "../../i18n/i18n";
19
23
  import { Routes } from "../../routing/routes";
20
- import { useBasePath } from "../../routing/useBasePath";
21
24
  import { ProductVariant } from "../shared/components/productVariant/ProductVariant";
22
25
  import { Pricing } from "../summary/components/pricing/Pricing";
23
26
  import { style } from "./Checkout.style";
@@ -25,17 +28,28 @@ import { DeliveryBanner } from "./components/deliveryBanner/DeliveryBanner";
25
28
  import { PaymentInstrument } from "./components/paymentInstrument/PaymentInstrument";
26
29
 
27
30
  interface CheckoutProps {
28
- readonly children?: ReactNode;
29
31
  readonly layout: UiLayout;
32
+ readonly order: OrderProjection;
33
+ readonly subscription: SubscriptionProjection;
34
+ readonly getAuthToken: () => Promise<string>;
35
+ readonly onCheckoutFlowSuccess: () => void;
30
36
  readonly useRedirect: () => Record<string, string>;
31
37
  }
32
38
 
33
- const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect }) => {
39
+ const Checkout: FC<CheckoutProps> = ({
40
+ layout: Layout,
41
+ order,
42
+ subscription,
43
+ getAuthToken,
44
+ useRedirect,
45
+ onCheckoutFlowSuccess,
46
+ }) => {
34
47
  const {
35
48
  customer: { customerId, country, segment },
49
+ basePath,
36
50
  } = useStaticInfo();
37
- const titleText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_TITLE });
38
- const submitButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_PAY_BUTTON });
51
+ const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
52
+ const submitButtonText = useI18nMessage({ id: I18nMessages.CHECKOUT_PAY_BUTTON });
39
53
  const { screen } = useDevice();
40
54
  const [pricingHeight, setPricingHeight] = useState(0);
41
55
  const handleOnPricingLayout = useCallback(({ height }: LayoutRectangle) => setPricingHeight(height), []);
@@ -43,6 +57,14 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
43
57
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
44
58
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id as string });
45
59
 
60
+ const [checkoutFlow, checkoutFlowStatus, paymentFlowComponent] = useCheckoutFlow({
61
+ checkout,
62
+ order,
63
+ subscription,
64
+ getAuthToken,
65
+ onSuccess: onCheckoutFlowSuccess,
66
+ });
67
+
46
68
  useTrackPageView({
47
69
  page: TrackingPage.CHECKOUT,
48
70
  country,
@@ -51,18 +73,16 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
51
73
  });
52
74
 
53
75
  const navigate = useNavigate();
54
- const basePath = useBasePath();
55
-
56
76
  const trackPressContinue = useTrackPressContinue({
57
77
  page: TrackingPage.CHECKOUT,
58
78
  country,
59
79
  segment,
60
80
  checkoutId: checkout?.id,
61
81
  });
62
- const handleOnSubmit = useCallback(() => {
82
+ const handleOnSubmit = useCallback(async () => {
63
83
  trackPressContinue();
64
- navigate(`${basePath}/${Routes.CHECKOUT}/${Routes.CHECKOUT_PAYMENT}`, { replace: true });
65
- }, [basePath, navigate, trackPressContinue]);
84
+ await checkoutFlow();
85
+ }, [checkoutFlow, trackPressContinue]);
66
86
 
67
87
  const checkoutItemsKept = useMemo(
68
88
  () =>
@@ -116,6 +136,12 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
116
136
  >
117
137
  <Box size={{ L: "2/3" }} style={screen.L && style.desktopListSpacing}>
118
138
  <View style={[style.contentWrapper, screen.L && style.desktopContentWrapper]}>
139
+ {country === Country.NL && (
140
+ <View style={style.paymentSelectorNL}>
141
+ <PaymentInstrument useRedirect={useRedirect} />
142
+ </View>
143
+ )}
144
+
119
145
  <Text level={3} style={style.title} heading>
120
146
  {titleText}
121
147
  </Text>
@@ -139,9 +165,11 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
139
165
  </View>
140
166
  ))}
141
167
 
142
- <View style={style.paymentSelector}>
143
- <PaymentInstrument useRedirect={useRedirect} />
144
- </View>
168
+ {country !== Country.NL && (
169
+ <View style={style.paymentSelector}>
170
+ <PaymentInstrument useRedirect={useRedirect} />
171
+ </View>
172
+ )}
145
173
  </View>
146
174
  </Box>
147
175
 
@@ -151,7 +179,11 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
151
179
  <Pricing pricing={pricing} totalCheckoutItemsKept={checkoutItemsKept?.length || 0} />
152
180
 
153
181
  {screen.L ? (
154
- <Button testID="confirm-checkout-button" onPress={handleOnSubmit}>
182
+ <Button
183
+ busy={checkoutFlowStatus === "loading"}
184
+ testID="confirm-checkout-button"
185
+ onPress={handleOnSubmit}
186
+ >
155
187
  {submitButtonText}
156
188
  </Button>
157
189
  ) : null}
@@ -164,14 +196,19 @@ const Checkout: FC<CheckoutProps> = ({ children, layout: Layout, useRedirect })
164
196
  {pricing && !screen.L ? (
165
197
  <Sticky style={style.sticky} onLayout={Platform.OS !== "web" ? handleOnPricingLayout : undefined}>
166
198
  <Body>
167
- <Button testID="confirm-checkout-button" small onPress={handleOnSubmit}>
199
+ <Button
200
+ busy={checkoutFlowStatus === "loading"}
201
+ testID="confirm-checkout-button"
202
+ small
203
+ onPress={handleOnSubmit}
204
+ >
168
205
  {submitButtonText}
169
206
  </Button>
170
207
  </Body>
171
208
  </Sticky>
172
209
  ) : null}
173
210
 
174
- {children}
211
+ {paymentFlowComponent}
175
212
  </Layout>
176
213
  );
177
214
  };
@@ -1,131 +1,126 @@
1
- import { waitFor } from "@testing-library/react-native";
2
- import React from "react";
3
- import { QueryStatus } from "@lookiero/messaging-react";
4
- import { Country } from "@lookiero/sty-psp-locale";
5
- import { Segment } from "@lookiero/sty-psp-segment";
6
- import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
7
- import { checkout } from "../../../../../projection/checkout/checkout.mock";
8
- import { useViewFirstAvailableCheckoutByCustomerId } from "../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
9
- import { useViewIsSizeChangeEnabledByCheckoutId } from "../../../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId";
10
- import { paymentFlowPayload as mockPaymentFlowPayload } from "../../../../../projection/payment/paymentFlowPayload.mock";
11
- import { useViewPaymentFlowPayloadByCheckoutId } from "../../../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId";
12
- import { pricing } from "../../../../../projection/pricing/pricing.mock";
13
- import { useViewPricingByCheckoutId } from "../../../../../projection/pricing/react/useViewPricingByCheckoutId";
14
- import { useSubmitCheckout } from "../../../../hooks/useSubmitCheckout";
15
- import { Routes } from "../../../../routing/routes";
16
- import { render } from "../../../../test/render";
17
- import { CheckoutPaymentModal } from "./CheckoutPaymentModal";
1
+ // import { waitFor } from "@testing-library/react-native";
2
+ // import React from "react";
3
+ // import { QueryStatus } from "@lookiero/messaging-react";
4
+ // import { Country } from "@lookiero/sty-psp-locale";
5
+ // import { Segment } from "@lookiero/sty-psp-segment";
6
+ // import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
7
+ // import { checkout } from "../../../../../projection/checkout/checkout.mock";
8
+ // import { useViewFirstAvailableCheckoutByCustomerId } from "../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
9
+ // import { useViewIsSizeChangeEnabledByCheckoutId } from "../../../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId";
10
+ // import { paymentFlowPayload as mockPaymentFlowPayload } from "../../../../../projection/payment/paymentFlowPayload.mock";
11
+ // import { useViewPaymentFlowPayloadByCheckoutId } from "../../../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId";
12
+ // import { pricing } from "../../../../../projection/pricing/pricing.mock";
13
+ // import { useViewPricingByCheckoutId } from "../../../../../projection/pricing/react/useViewPricingByCheckoutId";
14
+ // import { useCheckoutFlow } from "../../../../hooks/useCheckoutFlow";
15
+ // import { Routes } from "../../../../routing/routes";
16
+ // import { render } from "../../../../test/render";
18
17
 
19
- const customerId = "a8fff6d7-708c-41a7-b42a-58c5706d33df";
20
- const country = Country.ES;
21
- const segment = Segment.WOMEN;
22
- const orderNumber = 3691625;
23
- const isFirstOrder = false;
24
- const getAuthToken = () => Promise.resolve("token");
25
- const mockCheckout = checkout({
26
- items: [
27
- { status: CheckoutItemStatus.RETURNED },
28
- { status: CheckoutItemStatus.KEPT },
29
- { status: CheckoutItemStatus.KEPT },
30
- { status: CheckoutItemStatus.KEPT },
31
- { status: CheckoutItemStatus.REPLACED },
32
- ],
33
- });
34
- const mockPricing = pricing();
18
+ // const customerId = "a8fff6d7-708c-41a7-b42a-58c5706d33df";
19
+ // const country = Country.ES;
20
+ // const segment = Segment.WOMEN;
21
+ // const orderNumber = 3691625;
22
+ // const isFirstOrder = false;
23
+ // const getAuthToken = () => Promise.resolve("token");
24
+ // const mockCheckout = checkout({
25
+ // items: [
26
+ // { status: CheckoutItemStatus.RETURNED },
27
+ // { status: CheckoutItemStatus.KEPT },
28
+ // { status: CheckoutItemStatus.KEPT },
29
+ // { status: CheckoutItemStatus.KEPT },
30
+ // { status: CheckoutItemStatus.REPLACED },
31
+ // ],
32
+ // });
33
+ // const mockPricing = pricing();
35
34
 
36
- jest.mock("../../../../hooks/useStaticInfo", () => ({
37
- useStaticInfo: () => ({ customer: { customerId, country, segment } }),
38
- }));
35
+ // jest.mock("../../../../hooks/useStaticInfo", () => ({
36
+ // useStaticInfo: () => ({ customer: { customerId, country, segment } }),
37
+ // }));
39
38
 
40
- jest.mock("../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId");
41
- jest.mock("../../../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId");
42
- jest.mock("../../../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId");
43
- jest.mock("../../../../../projection/pricing/react/useViewPricingByCheckoutId");
44
- jest.mock("../../../../hooks/useSubmitCheckout");
45
- jest.mock("../../../../../tracking/useTrackCheckout");
39
+ // jest.mock("../../../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId");
40
+ // jest.mock("../../../../../projection/payment/react/useViewPaymentFlowPayloadByCheckoutId");
41
+ // jest.mock("../../../../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId");
42
+ // jest.mock("../../../../../projection/pricing/react/useViewPricingByCheckoutId");
43
+ // jest.mock("../../../../hooks/useSubmitCheckout");
44
+ // jest.mock("../../../../../tracking/useTrackCheckout");
46
45
 
47
- const mockStartLegacyBoxCheckout = jest.fn();
48
- jest.mock("@lookiero/payments-front", () => {
49
- // eslint-disable-next-line @typescript-eslint/no-var-requires
50
- const { useImperativeHandle, forwardRef } = require("react");
46
+ // const mockStartLegacyBoxCheckout = jest.fn();
47
+ // jest.mock("@lookiero/payments-front", () => {
48
+ // // eslint-disable-next-line @typescript-eslint/no-var-requires
49
+ // const { useImperativeHandle, forwardRef } = require("react");
51
50
 
52
- return {
53
- CheckoutStatus: {
54
- REJECTED: "REJECTED",
55
- ERROR: "ERROR",
56
- FULFILLED: "FULFILLED",
57
- },
58
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
59
- // @ts-ignore
60
- // eslint-disable-next-line @typescript-eslint/naming-convention, react/display-name
61
- PaymentFlow: forwardRef((params, ref) => {
62
- useImperativeHandle(ref, () => ({
63
- startLegacyBoxCheckout: mockStartLegacyBoxCheckout,
64
- }));
51
+ // return {
52
+ // CheckoutStatus: {
53
+ // REJECTED: "REJECTED",
54
+ // ERROR: "ERROR",
55
+ // FULFILLED: "FULFILLED",
56
+ // },
57
+ // // eslint-disable-next-line @typescript-eslint/ban-ts-comment
58
+ // // @ts-ignore
59
+ // // eslint-disable-next-line @typescript-eslint/naming-convention, react/display-name
60
+ // PaymentFlow: forwardRef((params, ref) => {
61
+ // useImperativeHandle(ref, () => ({
62
+ // startLegacyBoxCheckout: mockStartLegacyBoxCheckout,
63
+ // }));
65
64
 
66
- return null;
67
- }),
68
- PaymentMethod: {
69
- ["GOOGLE_PAY"]: "google_pay",
70
- },
71
- Section: {
72
- ["BOX_CHECKOUT"]: "box-checkout",
73
- },
74
- PaymentInstrumentSelect: jest.fn(() => <></>),
75
- };
76
- });
65
+ // return null;
66
+ // }),
67
+ // PaymentMethod: {
68
+ // ["GOOGLE_PAY"]: "google_pay",
69
+ // },
70
+ // Section: {
71
+ // ["BOX_CHECKOUT"]: "box-checkout",
72
+ // },
73
+ // PaymentInstrumentSelect: jest.fn(() => <></>),
74
+ // };
75
+ // });
77
76
 
78
- const mockUseNavigate = jest.fn();
79
- jest.mock("react-router-native", () => ({
80
- ...jest.requireActual("react-router-native"),
81
- useNavigate: () => mockUseNavigate,
82
- }));
77
+ // const mockUseNavigate = jest.fn();
78
+ // jest.mock("react-router-native", () => ({
79
+ // ...jest.requireActual("react-router-native"),
80
+ // useNavigate: () => mockUseNavigate,
81
+ // }));
83
82
 
84
83
  describe("CheckoutPaymentModal component", () => {
85
- it("renders correctly", async () => {
86
- const mockSubmitCheckout = jest.fn();
87
- (useViewFirstAvailableCheckoutByCustomerId as jest.Mock).mockReturnValue([mockCheckout, QueryStatus.SUCCESS]);
88
- (useViewPaymentFlowPayloadByCheckoutId as jest.Mock).mockReturnValue([mockPaymentFlowPayload, QueryStatus.SUCCESS]);
89
- (useViewIsSizeChangeEnabledByCheckoutId as jest.Mock).mockReturnValue([true, QueryStatus.SUCCESS]);
90
- (useViewPricingByCheckoutId as jest.Mock).mockReturnValue([mockPricing, QueryStatus.SUCCESS]);
91
- (useSubmitCheckout as jest.Mock).mockReturnValue([mockSubmitCheckout, "success"]);
92
-
93
- await waitFor(() => {
94
- render(
95
- <CheckoutPaymentModal
96
- coupon={null}
97
- getAuthToken={getAuthToken}
98
- isFirstOrder={isFirstOrder}
99
- orderNumber={orderNumber}
100
- subscription="b"
101
- />,
102
- );
103
- expect(mockSubmitCheckout).toHaveBeenCalled();
104
- });
105
- });
106
-
107
- it("navigates back to /checkout when checkout-flow fails", async () => {
108
- (useViewFirstAvailableCheckoutByCustomerId as jest.Mock).mockReturnValue([mockCheckout, QueryStatus.SUCCESS]);
109
- (useViewPaymentFlowPayloadByCheckoutId as jest.Mock).mockReturnValue([mockPaymentFlowPayload, QueryStatus.SUCCESS]);
110
- (useViewIsSizeChangeEnabledByCheckoutId as jest.Mock).mockReturnValue([true, QueryStatus.SUCCESS]);
111
- (useViewPricingByCheckoutId as jest.Mock).mockReturnValue([mockPricing, QueryStatus.SUCCESS]);
112
- (useSubmitCheckout as jest.Mock).mockImplementation(({ onError }) => {
113
- const submitCheckout = () => onError();
114
-
115
- return [submitCheckout, "error"];
116
- });
117
-
118
- await waitFor(() => {
119
- render(
120
- <CheckoutPaymentModal
121
- coupon={null}
122
- getAuthToken={getAuthToken}
123
- isFirstOrder={isFirstOrder}
124
- orderNumber={orderNumber}
125
- subscription="b"
126
- />,
127
- );
128
- expect(mockUseNavigate).toHaveBeenCalledWith(`/${Routes.CHECKOUT}`, { replace: true });
129
- });
130
- });
84
+ // it("renders correctly", async () => {
85
+ // const mockSubmitCheckout = jest.fn();
86
+ // (useViewFirstAvailableCheckoutByCustomerId as jest.Mock).mockReturnValue([mockCheckout, QueryStatus.SUCCESS]);
87
+ // (useViewPaymentFlowPayloadByCheckoutId as jest.Mock).mockReturnValue([mockPaymentFlowPayload, QueryStatus.SUCCESS]);
88
+ // (useViewIsSizeChangeEnabledByCheckoutId as jest.Mock).mockReturnValue([true, QueryStatus.SUCCESS]);
89
+ // (useViewPricingByCheckoutId as jest.Mock).mockReturnValue([mockPricing, QueryStatus.SUCCESS]);
90
+ // (useSubmitCheckout as jest.Mock).mockReturnValue([mockSubmitCheckout, "success"]);
91
+ // await waitFor(() => {
92
+ // render(
93
+ // <CheckoutPaymentModal
94
+ // coupon={null}
95
+ // getAuthToken={getAuthToken}
96
+ // isFirstOrder={isFirstOrder}
97
+ // orderNumber={orderNumber}
98
+ // subscription="b"
99
+ // />,
100
+ // );
101
+ // expect(mockSubmitCheckout).toHaveBeenCalled();
102
+ // });
103
+ // });
104
+ // it("navigates back to /checkout when checkout-flow fails", async () => {
105
+ // (useViewFirstAvailableCheckoutByCustomerId as jest.Mock).mockReturnValue([mockCheckout, QueryStatus.SUCCESS]);
106
+ // (useViewPaymentFlowPayloadByCheckoutId as jest.Mock).mockReturnValue([mockPaymentFlowPayload, QueryStatus.SUCCESS]);
107
+ // (useViewIsSizeChangeEnabledByCheckoutId as jest.Mock).mockReturnValue([true, QueryStatus.SUCCESS]);
108
+ // (useViewPricingByCheckoutId as jest.Mock).mockReturnValue([mockPricing, QueryStatus.SUCCESS]);
109
+ // (useSubmitCheckout as jest.Mock).mockImplementation(({ onError }) => {
110
+ // const submitCheckout = () => onError();
111
+ // return [submitCheckout, "error"];
112
+ // });
113
+ // await waitFor(() => {
114
+ // render(
115
+ // <CheckoutPaymentModal
116
+ // coupon={null}
117
+ // getAuthToken={getAuthToken}
118
+ // isFirstOrder={isFirstOrder}
119
+ // orderNumber={orderNumber}
120
+ // subscription="b"
121
+ // />,
122
+ // );
123
+ // expect(mockUseNavigate).toHaveBeenCalledWith(`/${Routes.CHECKOUT}`, { replace: true });
124
+ // });
125
+ // });
131
126
  });
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ALIGN, InfoBox, INFOBOX_TYPE, useDevice } from "@lookiero/aurora";
3
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
- import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
4
+ import { I18nMessages } from "../../../../i18n/i18n";
5
5
 
6
6
  const DeliveryBanner = () => {
7
7
  const { screen } = useDevice();
@@ -10,7 +10,7 @@ const DeliveryBanner = () => {
10
10
  <InfoBox
11
11
  contentAlign={screen.L ? ALIGN.CENTER : undefined}
12
12
  testID="delivery-banner"
13
- text={useI18nMessage({ domain: DOMAIN, id: I18nMessages.CHECKOUT_DELIVERY_BANNER })}
13
+ text={useI18nMessage({ id: I18nMessages.CHECKOUT_DELIVERY_BANNER })}
14
14
  type={INFOBOX_TYPE.SQUARED}
15
15
  />
16
16
  );
@@ -78,7 +78,7 @@ exports[`DeliveryBanner component matches the snapshot 1`] = `
78
78
  "paddingBottom": 0,
79
79
  "paddingLeft": 0,
80
80
  "paddingRight": 0,
81
- "paddingTop": 4,
81
+ "paddingTop": 5,
82
82
  },
83
83
  ]
84
84
  }
@@ -1,24 +1,24 @@
1
- import React, { FC, useRef } from "react";
1
+ import React, { FC } from "react";
2
2
  import { PaymentInstrumentSelect, Section } from "@lookiero/payments-front";
3
- import { useLogger } from "@lookiero/sty-psp-logging";
4
- import { usePaymentInstrumentEvents } from "../../../../hooks/usePaymentInstrumentEvents";
3
+ import { useStaticInfo } from "../../../../hooks/useStaticInfo";
5
4
 
6
5
  interface PaymentInstrumentProps {
7
6
  readonly useRedirect: () => Record<string, string>;
8
7
  }
9
8
  const PaymentInstrument: FC<PaymentInstrumentProps> = ({ useRedirect }) => {
10
- const paymentInstrumentSelectRef = useRef(null);
11
9
  const { returnUrl } = useRedirect();
12
- const logger = useLogger();
13
-
14
- usePaymentInstrumentEvents({ logger });
10
+ const { customer } = useStaticInfo();
15
11
 
16
12
  return (
17
13
  <PaymentInstrumentSelect
18
- ref={paymentInstrumentSelectRef}
19
14
  beforeRedirect={returnUrl ? () => Promise.resolve(returnUrl) : undefined}
20
15
  hasError={false}
21
16
  section={Section.BOX_CHECKOUT}
17
+ userInformation={{
18
+ email: customer.email,
19
+ name: customer.name,
20
+ }}
21
+ showSingleUsePaymentMethods
22
22
  />
23
23
  );
24
24
  };
@@ -18,7 +18,7 @@ import { HostDefaultCheckoutQuestionItem } from "../../../../components/organism
18
18
  import { HostSelectCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem";
19
19
  import { IconCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem";
20
20
  import { TextareaCheckoutQuestionItem } from "../../../../components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem";
21
- import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
21
+ import { I18nMessages } from "../../../../i18n/i18n";
22
22
 
23
23
  const checkoutQuestionItems: CheckoutQuestionItems = {
24
24
  [CheckoutQuestionType.HOST_DEFAULT]: HostDefaultCheckoutQuestionItem,
@@ -39,7 +39,7 @@ const CheckoutQuestionsForm: FC<CheckoutQuestionsFormProps> = ({
39
39
  submitButtonDisabled,
40
40
  onSubmit,
41
41
  }) => {
42
- const buttonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_BUTTON });
42
+ const buttonText = useI18nMessage({ id: I18nMessages.FEEDBACK_BUTTON });
43
43
 
44
44
  const feedback = useCheckoutQuestionFeedback();
45
45
  const handlePress = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
@@ -28,7 +28,6 @@ import { ItemDetailHeader } from "../../components/templates/header/itemDetailHe
28
28
  import { ItemHeader } from "../../components/templates/header/itemHeader/ItemHeader";
29
29
  import { useStaticInfo } from "../../hooks/useStaticInfo";
30
30
  import { Routes } from "../../routing/routes";
31
- import { useBasePath } from "../../routing/useBasePath";
32
31
  import { style } from "./Item.style";
33
32
  import {
34
33
  CheckoutItemWithCustomerDecission,
@@ -62,9 +61,9 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
62
61
  const logger = useLogger();
63
62
  const screenSize = useScreenSize();
64
63
  const navigate = useNavigate();
65
- const basePath = useBasePath();
66
64
  const {
67
65
  customer: { customerId, country, segment },
66
+ basePath,
68
67
  } = useStaticInfo();
69
68
  const isDesktopScreen = screenSize !== "S";
70
69
 
@@ -4,7 +4,7 @@ import { InfoBox, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import { useScreenSize } from "@lookiero/sty-psp-ui";
6
6
  import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
7
- import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
7
+ import { I18nMessages } from "../../../../i18n/i18n";
8
8
  import { style } from "./CustomerDecissionBanner.style";
9
9
 
10
10
  type CustomerDecissionBannerStatus = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL>;
@@ -20,8 +20,8 @@ interface CustomerDecissionBannerProps {
20
20
  readonly onPress: () => void;
21
21
  }
22
22
  const CustomerDecissionBanner: FC<CustomerDecissionBannerProps> = ({ checkoutItemStatus, onPress }) => {
23
- const decissionText = useI18nMessage({ domain: DOMAIN, id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
24
- const bannerButtonText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.ITEM_BANNER_BUTTON });
23
+ const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
24
+ const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
25
25
  const screenSize = useScreenSize();
26
26
  const isSmallScreen = screenSize === "S";
27
27
 
@@ -89,7 +89,7 @@ exports[`CustomerDecissionBanner component matches the snapshot for a KEPT check
89
89
  "paddingBottom": 0,
90
90
  "paddingLeft": 0,
91
91
  "paddingRight": 0,
92
- "paddingTop": 4,
92
+ "paddingTop": 5,
93
93
  },
94
94
  ]
95
95
  }
@@ -258,7 +258,7 @@ exports[`CustomerDecissionBanner component matches the snapshot for a REPLACED c
258
258
  "paddingBottom": 0,
259
259
  "paddingLeft": 0,
260
260
  "paddingRight": 0,
261
- "paddingTop": 4,
261
+ "paddingTop": 5,
262
262
  },
263
263
  ]
264
264
  }
@@ -427,7 +427,7 @@ exports[`CustomerDecissionBanner component matches the snapshot for a RETURNED c
427
427
  "paddingBottom": 0,
428
428
  "paddingLeft": 0,
429
429
  "paddingRight": 0,
430
- "paddingTop": 4,
430
+ "paddingTop": 5,
431
431
  },
432
432
  ]
433
433
  }