@vtex/faststore 0.0.10 → 0.0.11

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 (506) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +0 -1
  3. package/dist/actions.json +6 -1
  4. package/dist/catalog.json +789 -1701
  5. package/dist/cli/index.d.ts +66 -28
  6. package/dist/cli/index.js +7371 -512
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/server-runtime.js +41 -60
  9. package/dist/cli/server-runtime.js.map +1 -1
  10. package/dist/client.d.ts +3 -3
  11. package/dist/client.js +2 -2
  12. package/dist/components.d.ts +63 -57
  13. package/dist/components.js +60 -54
  14. package/dist/content-types.json +5785 -754
  15. package/dist/core/dist/define-component.d.ts +1 -1
  16. package/dist/core/dist/define-content-type.d.ts +50 -2
  17. package/dist/core/dist/define-content-type.js +107 -3
  18. package/dist/core/dist/define-content-type.js.map +1 -1
  19. package/dist/core/dist/index.d.ts +2 -2
  20. package/dist/docs/access-code-field.md +1 -1
  21. package/dist/docs/access-code-sign-in.md +126 -77
  22. package/dist/docs/account-address-book.md +210 -95
  23. package/dist/docs/account-menu.md +14 -15
  24. package/dist/docs/account-saved-cards.md +44 -39
  25. package/dist/docs/alert-dialog.md +3 -1
  26. package/dist/docs/avatar.md +4 -2
  27. package/dist/docs/billing-address.md +99 -30
  28. package/dist/docs/binding-switcher.md +5 -2
  29. package/dist/docs/buy-button.md +7 -8
  30. package/dist/docs/card-entry.md +39 -26
  31. package/dist/docs/card-summary.md +18 -8
  32. package/dist/docs/cardholder-document.md +5 -3
  33. package/dist/docs/carousel.md +5 -4
  34. package/dist/docs/cart-destination.md +39 -26
  35. package/dist/docs/cart-item.md +29 -14
  36. package/dist/docs/cart-totalizer.md +7 -5
  37. package/dist/docs/cart.md +135 -41
  38. package/dist/docs/challenge-return.md +135 -0
  39. package/dist/docs/client-preferences-fieldset.md +10 -5
  40. package/dist/docs/client-preferences.md +31 -8
  41. package/dist/docs/client-profile-fieldset.md +20 -6
  42. package/dist/docs/client-profile.md +12 -3
  43. package/dist/docs/copy-text.md +9 -7
  44. package/dist/docs/document-field.md +1 -1
  45. package/dist/docs/email-field.md +2 -1
  46. package/dist/docs/email-identification.md +12 -2
  47. package/dist/docs/footer-copyright.md +4 -2
  48. package/dist/docs/form.md +54 -18
  49. package/dist/docs/free-shipping-progress.md +6 -5
  50. package/dist/docs/identity-edit.md +8 -2
  51. package/dist/docs/identity-summary.md +18 -5
  52. package/dist/docs/installments.md +46 -32
  53. package/dist/docs/my-account-profile.md +16 -11
  54. package/dist/docs/navigation-link.md +5 -3
  55. package/dist/docs/order-cancel.md +3 -1
  56. package/dist/docs/order-delivery-address.md +7 -5
  57. package/dist/docs/order-delivery-group.md +1 -3
  58. package/dist/docs/order-details-back.md +1 -1
  59. package/dist/docs/order-details-header.md +1 -4
  60. package/dist/docs/order-invoice-download.md +60 -0
  61. package/dist/docs/order-list-row.md +1 -1
  62. package/dist/docs/order-list-search.md +13 -20
  63. package/dist/docs/order-list-views.md +11 -17
  64. package/dist/docs/order-list.md +12 -5
  65. package/dist/docs/order-payment.md +9 -7
  66. package/dist/docs/order-placed-date.md +1 -1
  67. package/dist/docs/order-placed-payment-summary.md +28 -15
  68. package/dist/docs/order-placed.md +49 -14
  69. package/dist/docs/order-progress.md +1 -1
  70. package/dist/docs/order-status-badge.md +20 -9
  71. package/dist/docs/order-summary.md +2 -2
  72. package/dist/docs/order-tracking-link.md +58 -0
  73. package/dist/docs/payment-method-badges.md +30 -4
  74. package/dist/docs/payment-methods.md +1 -1
  75. package/dist/docs/payment.md +36 -17
  76. package/dist/docs/phone-field.md +4 -4
  77. package/dist/docs/place-order.md +84 -36
  78. package/dist/docs/postal-code-field.md +3 -1
  79. package/dist/docs/pricing.md +21 -23
  80. package/dist/docs/product-gallery.md +19 -20
  81. package/dist/docs/product-information.md +13 -9
  82. package/dist/docs/product-list.md +7 -6
  83. package/dist/docs/product-shelf.md +0 -1
  84. package/dist/docs/promotion.md +4 -2
  85. package/dist/docs/region.md +23 -15
  86. package/dist/docs/save-card.md +7 -6
  87. package/dist/docs/saved-cards.md +65 -36
  88. package/dist/docs/shipping-address.md +57 -21
  89. package/dist/docs/shipping-simulator.md +53 -15
  90. package/dist/docs/sign-in-disclosure.md +176 -0
  91. package/dist/docs/sign-in-form.md +78 -47
  92. package/dist/docs/sign-in-redirect.md +4 -2
  93. package/dist/docs/sign-in.md +173 -0
  94. package/dist/docs/toast.md +15 -4
  95. package/dist/docs/variant-selector.md +15 -11
  96. package/dist/graphql/types.d.ts +4 -14
  97. package/dist/index.d.ts +2 -2
  98. package/dist/internal/client.d.ts +1 -3
  99. package/dist/internal/client.js +1 -1
  100. package/dist/internal/server.d.ts +7 -4
  101. package/dist/internal/server.js +7 -4
  102. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  103. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  104. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  105. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  106. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  107. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  108. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  109. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  110. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  111. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  112. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  113. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  114. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  115. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  116. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  117. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  118. package/dist/matter/account-address-book/account-address-book.js +74 -33
  119. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  120. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  121. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  122. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  123. package/dist/matter/account-address-book/account-address-country.js +83 -49
  124. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  126. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  127. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  128. package/dist/matter/account-address-book/account-address-form.js +518 -155
  129. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  131. package/dist/matter/account-address-book/account-address-record.js +32 -17
  132. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  133. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  134. package/dist/matter/account-menu/account-menu.js +46 -54
  135. package/dist/matter/account-menu/account-menu.js.map +1 -1
  136. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  137. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
  138. package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
  139. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
  140. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  141. package/dist/matter/billing-address/billing-address.js +227 -156
  142. package/dist/matter/billing-address/billing-address.js.map +1 -1
  143. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  144. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  145. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  146. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  147. package/dist/matter/buy-button/buy-button.js +10 -19
  148. package/dist/matter/buy-button/buy-button.js.map +1 -1
  149. package/dist/matter/card-entry/card-capture.js +12 -4
  150. package/dist/matter/card-entry/card-capture.js.map +1 -1
  151. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  152. package/dist/matter/card-entry/card-entry.js +348 -221
  153. package/dist/matter/card-entry/card-entry.js.map +1 -1
  154. package/dist/matter/cart/cart-namespace.d.ts +7 -1
  155. package/dist/matter/cart/cart-namespace.js +7 -1
  156. package/dist/matter/cart/cart-namespace.js.map +1 -1
  157. package/dist/matter/cart/cart.d.ts +402 -61
  158. package/dist/matter/cart/cart.js +624 -153
  159. package/dist/matter/cart/cart.js.map +1 -1
  160. package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
  161. package/dist/matter/cart-destination/cart-destination.js +160 -70
  162. package/dist/matter/cart-destination/cart-destination.js.map +1 -1
  163. package/dist/matter/cart-item/cart-item.d.ts +144 -17
  164. package/dist/matter/cart-item/cart-item.js +166 -49
  165. package/dist/matter/cart-item/cart-item.js.map +1 -1
  166. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  167. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  168. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  169. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  170. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  171. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  172. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  173. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  174. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  175. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  176. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  177. package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
  178. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  179. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  180. package/dist/matter/challenge-return/challenge-return.js +241 -0
  181. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  182. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  183. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  184. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  185. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  186. package/dist/matter/client-preferences/client-preferences.js +84 -15
  187. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  188. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  189. package/dist/matter/client-profile/client-profile.js +64 -24
  190. package/dist/matter/client-profile/client-profile.js.map +1 -1
  191. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  192. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  193. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  194. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  195. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  196. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  197. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  198. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  199. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  200. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  201. package/dist/matter/delivery-options/delivery-options.js +75 -12
  202. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  203. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  204. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  205. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  206. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  207. package/dist/matter/email-identification/email-identification.js +49 -12
  208. package/dist/matter/email-identification/email-identification.js.map +1 -1
  209. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
  210. package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
  211. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  212. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  213. package/dist/matter/identity-edit/identity-edit.js +47 -19
  214. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  215. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  216. package/dist/matter/identity-summary/identity-summary.js +95 -45
  217. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  218. package/dist/matter/installments/installments-select.d.ts +98 -16
  219. package/dist/matter/installments/installments-select.js +156 -48
  220. package/dist/matter/installments/installments-select.js.map +1 -1
  221. package/dist/matter/installments/installments.d.ts +96 -16
  222. package/dist/matter/installments/installments.js +115 -40
  223. package/dist/matter/installments/installments.js.map +1 -1
  224. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  225. package/dist/matter/installments/use-installments-selection.js +8 -3
  226. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  227. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  228. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  229. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  230. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  231. package/dist/matter/order-cancel/order-cancel.js +118 -51
  232. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  233. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  234. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  235. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  236. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  237. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  238. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  239. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  240. package/dist/matter/order-details-header/order-details-header.js +66 -58
  241. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  242. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  243. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  244. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  245. package/dist/matter/order-list/order-list.d.ts +164 -19
  246. package/dist/matter/order-list/order-list.js +229 -87
  247. package/dist/matter/order-list/order-list.js.map +1 -1
  248. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  249. package/dist/matter/order-list-row/order-list-row.js +3 -2
  250. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  251. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  252. package/dist/matter/order-list-search/order-list-search.js +30 -69
  253. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  254. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  255. package/dist/matter/order-list-views/order-list-views.js +22 -68
  256. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  257. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  258. package/dist/matter/order-payment/order-payment.js +44 -39
  259. package/dist/matter/order-payment/order-payment.js.map +1 -1
  260. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  261. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  262. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  263. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  264. package/dist/matter/order-placed/order-placed.js +230 -139
  265. package/dist/matter/order-placed/order-placed.js.map +1 -1
  266. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  267. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  268. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  269. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  270. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  271. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  272. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  273. package/dist/matter/order-progress/order-progress.js +37 -45
  274. package/dist/matter/order-progress/order-progress.js.map +1 -1
  275. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  276. package/dist/matter/order-summary/order-summary.js +38 -44
  277. package/dist/matter/order-summary/order-summary.js.map +1 -1
  278. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  279. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  280. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  281. package/dist/matter/payment/payment-card-capture.js +17 -10
  282. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  283. package/dist/matter/payment/payment-controller.d.ts +4 -2
  284. package/dist/matter/payment/payment-controller.js +30 -9
  285. package/dist/matter/payment/payment-controller.js.map +1 -1
  286. package/dist/matter/payment/payment-method-badges.js +1 -1
  287. package/dist/matter/payment/payment.d.ts +69 -19
  288. package/dist/matter/payment/payment.js +101 -35
  289. package/dist/matter/payment/payment.js.map +1 -1
  290. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  291. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  292. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  293. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  294. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  295. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  296. package/dist/matter/place-order/place-order.d.ts +171 -57
  297. package/dist/matter/place-order/place-order.js +376 -185
  298. package/dist/matter/place-order/place-order.js.map +1 -1
  299. package/dist/matter/pricing/pricing.d.ts +152 -13
  300. package/dist/matter/pricing/pricing.js +153 -52
  301. package/dist/matter/pricing/pricing.js.map +1 -1
  302. package/dist/matter/product-information/product-information.d.ts +27 -4
  303. package/dist/matter/product-information/product-information.js +32 -15
  304. package/dist/matter/product-information/product-information.js.map +1 -1
  305. package/dist/matter/product-list/product-list.d.ts +24 -6
  306. package/dist/matter/product-list/product-list.js +32 -26
  307. package/dist/matter/product-list/product-list.js.map +1 -1
  308. package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
  309. package/dist/matter/product-shelf/product-shelf.js +2 -15
  310. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  311. package/dist/matter/region/region.d.ts +33 -16
  312. package/dist/matter/region/region.js +59 -52
  313. package/dist/matter/region/region.js.map +1 -1
  314. package/dist/matter/save-card/save-card.d.ts +43 -8
  315. package/dist/matter/save-card/save-card.js +61 -23
  316. package/dist/matter/save-card/save-card.js.map +1 -1
  317. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  318. package/dist/matter/saved-cards/saved-cards.js +349 -77
  319. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  320. package/dist/matter/shipping-address/address-payload.js +25 -0
  321. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  322. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  323. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  324. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  325. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  326. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  327. package/dist/matter/shipping-address/shipping-address.js +443 -188
  328. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  329. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
  330. package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
  331. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  332. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  333. package/dist/matter/sign-in/sign-in.js +285 -0
  334. package/dist/matter/sign-in/sign-in.js.map +1 -0
  335. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  336. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  337. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  338. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  339. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  340. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  341. package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
  342. package/dist/particles/binding-switcher/binding-switcher.js +37 -26
  343. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
  344. package/dist/particles/card-summary/card-summary.d.ts +38 -8
  345. package/dist/particles/card-summary/card-summary.js +55 -22
  346. package/dist/particles/card-summary/card-summary.js.map +1 -1
  347. package/dist/particles/carousel/carousel.d.ts +99 -11
  348. package/dist/particles/carousel/carousel.js +103 -35
  349. package/dist/particles/carousel/carousel.js.map +1 -1
  350. package/dist/particles/copy-text/copy-text.js +5 -15
  351. package/dist/particles/copy-text/copy-text.js.map +1 -1
  352. package/dist/particles/dialog/dialog.d.ts +14 -6
  353. package/dist/particles/dialog/dialog.js +6 -3
  354. package/dist/particles/dialog/dialog.js.map +1 -1
  355. package/dist/particles/drawer/drawer.js +1 -1
  356. package/dist/particles/drawer/drawer.js.map +1 -1
  357. package/dist/particles/email-field/email-field.d.ts +2 -1
  358. package/dist/particles/email-field/email-field.js +2 -1
  359. package/dist/particles/email-field/email-field.js.map +1 -1
  360. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  361. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  362. package/dist/particles/form/form.d.ts +85 -13
  363. package/dist/particles/form/form.js +91 -42
  364. package/dist/particles/form/form.js.map +1 -1
  365. package/dist/particles/gallery/gallery.d.ts +129 -12
  366. package/dist/particles/gallery/gallery.js +121 -34
  367. package/dist/particles/gallery/gallery.js.map +1 -1
  368. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  369. package/dist/particles/order-details-back/order-details-back.js +8 -10
  370. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  371. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  372. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  373. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  374. package/dist/particles/password-field/password-field.d.ts +1 -1
  375. package/dist/particles/password-field/password-field.js +2 -4
  376. package/dist/particles/password-field/password-field.js.map +1 -1
  377. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  378. package/dist/particles/phone-field/phone-field.js +8 -11
  379. package/dist/particles/phone-field/phone-field.js.map +1 -1
  380. package/dist/particles/spinner/spinner.d.ts +24 -4
  381. package/dist/particles/spinner/spinner.js +25 -9
  382. package/dist/particles/spinner/spinner.js.map +1 -1
  383. package/dist/particles/switch/switch.d.ts +4 -1
  384. package/dist/particles/switch/switch.js +3 -1
  385. package/dist/particles/switch/switch.js.map +1 -1
  386. package/dist/particles/toast/toast.d.ts +29 -3
  387. package/dist/particles/toast/toast.js +34 -10
  388. package/dist/particles/toast/toast.js.map +1 -1
  389. package/dist/schema.graphql +164 -56
  390. package/dist/sdk/address/address-fields.js +4 -4
  391. package/dist/sdk/address/address-fields.js.map +1 -1
  392. package/dist/sdk/address/constants.js +1 -6
  393. package/dist/sdk/address/constants.js.map +1 -1
  394. package/dist/sdk/address/messages.js +44 -44
  395. package/dist/sdk/address/messages.js.map +1 -1
  396. package/dist/sdk/address/postal-code.js +15 -2
  397. package/dist/sdk/address/postal-code.js.map +1 -1
  398. package/dist/sdk/address/types.d.ts +5 -3
  399. package/dist/sdk/address/validate-address.js +3 -3
  400. package/dist/sdk/address/validate-address.js.map +1 -1
  401. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  402. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  403. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  404. package/dist/sdk/data/index.js +2 -2
  405. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  406. package/dist/sdk/generated/gql.js +1 -1
  407. package/dist/sdk/generated/gql.js.map +1 -1
  408. package/dist/sdk/generated/graphql.d.ts +20 -5
  409. package/dist/sdk/generated/graphql.js +6 -0
  410. package/dist/sdk/generated/graphql.js.map +1 -1
  411. package/dist/sdk/i18n/format-error-code.js +23 -0
  412. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  413. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  414. package/dist/sdk/i18n/message-formatter.js +140 -0
  415. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  416. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  417. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  418. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  419. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  420. package/dist/sdk/navigation/redirect.d.ts +2 -0
  421. package/dist/sdk/navigation/redirect.js +19 -1
  422. package/dist/sdk/navigation/redirect.js.map +1 -1
  423. package/dist/sdk/navigation/types.d.ts +13 -0
  424. package/dist/sdk/payment/bin-format.js +20 -0
  425. package/dist/sdk/payment/bin-format.js.map +1 -0
  426. package/dist/sdk/payment/challenge-return.js +37 -0
  427. package/dist/sdk/payment/challenge-return.js.map +1 -0
  428. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  429. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  430. package/dist/sdk/payment/gateway.d.ts +1 -1
  431. package/dist/sdk/payment/gateway.js +8 -2
  432. package/dist/sdk/payment/gateway.js.map +1 -1
  433. package/dist/sdk/payment/operations.d.ts +1 -0
  434. package/dist/sdk/payment/operations.js +28 -6
  435. package/dist/sdk/payment/operations.js.map +1 -1
  436. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  437. package/dist/sdk/payment/resumed-purchase.js +119 -0
  438. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  439. package/dist/sdk/payment/security-code-mask.js +16 -23
  440. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  441. package/dist/sdk/payment/submission-registry.js +6 -2
  442. package/dist/sdk/payment/submission-registry.js.map +1 -1
  443. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  444. package/dist/sdk/payment/use-payment-actions.js +23 -3
  445. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  446. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  447. package/dist/sdk/payment/use-place-order.js +138 -76
  448. package/dist/sdk/payment/use-place-order.js.map +1 -1
  449. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  450. package/dist/sdk/provider/storefront-provider.js +4 -11
  451. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  452. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  453. package/dist/sdk/seo/entity-landing.js +30 -0
  454. package/dist/sdk/seo/entity-landing.js.map +1 -0
  455. package/dist/sdk/seo/page-alternates.d.ts +3 -2
  456. package/dist/sdk/seo/page-alternates.js +4 -2
  457. package/dist/sdk/seo/page-alternates.js.map +1 -1
  458. package/dist/sdk/seo/search-landing.d.ts +42 -0
  459. package/dist/sdk/seo/search-landing.js +85 -0
  460. package/dist/sdk/seo/search-landing.js.map +1 -0
  461. package/dist/sdk/session/mock-session.d.ts +9 -0
  462. package/dist/sdk/session/mock-session.js +31 -0
  463. package/dist/sdk/session/mock-session.js.map +1 -0
  464. package/dist/sdk/session/read-server-session.d.ts +3 -0
  465. package/dist/sdk/session/read-server-session.js +5 -0
  466. package/dist/sdk/session/read-server-session.js.map +1 -1
  467. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  468. package/dist/sdk/session/return-path-segment.js +15 -0
  469. package/dist/sdk/session/return-path-segment.js.map +1 -0
  470. package/dist/sdk/session/use-session-actions.js.map +1 -1
  471. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  472. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  473. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  474. package/dist/utils/safe-href.d.ts +2 -0
  475. package/package.json +4 -3
  476. package/skills/storefront-asset/SKILL.md +2 -2
  477. package/skills/storefront-asset/references/api-side.md +27 -14
  478. package/skills/storefront-asset/references/findings.md +5 -2
  479. package/src/styles/tailwind.css +8 -0
  480. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  481. package/dist/message-locales.json +0 -7
  482. package/dist/sdk/i18n/client.d.ts +0 -4
  483. package/dist/sdk/i18n/client.js +0 -4
  484. package/dist/sdk/i18n/locales.d.ts +0 -8
  485. package/dist/sdk/i18n/locales.js +0 -57
  486. package/dist/sdk/i18n/locales.js.map +0 -1
  487. package/dist/sdk/i18n/messages/en-US.js +0 -183
  488. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  489. package/dist/sdk/i18n/messages/en-US.json +0 -178
  490. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
  491. package/dist/sdk/i18n/messages/es-ES.js +0 -183
  492. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  493. package/dist/sdk/i18n/messages/es-ES.json +0 -178
  494. package/dist/sdk/i18n/messages/pt-BR.js +0 -183
  495. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  496. package/dist/sdk/i18n/messages/pt-BR.json +0 -178
  497. package/dist/sdk/i18n/provider.d.ts +0 -1
  498. package/dist/sdk/i18n/provider.js +0 -30
  499. package/dist/sdk/i18n/provider.js.map +0 -1
  500. package/dist/sdk/i18n/server.d.ts +0 -28
  501. package/dist/sdk/i18n/server.js +0 -59
  502. package/dist/sdk/i18n/server.js.map +0 -1
  503. package/dist/utils/resolve-authored-copy.js +0 -18
  504. package/dist/utils/resolve-authored-copy.js.map +0 -1
  505. package/dist/utils/substitute-template.js +0 -33
  506. package/dist/utils/substitute-template.js.map +0 -1
@@ -1,35 +1,12 @@
1
1
  "use client";
2
+ import { resolveNavigableHref } from "../../utils/safe-href.js";
2
3
  import { loggableErrorName } from "../../utils/loggable-error-name.js";
3
4
  import { usePaymentSubmission } from "./submission-registry.js";
4
5
  import { PAYMENT_NETWORK_ERROR_CODE } from "./operations.js";
6
+ import { claimPurchase, emitPurchaseForOrder } from "./resumed-purchase.js";
5
7
  import { isTrustedGatewayOrigin } from "./gateway-origin.js";
6
8
  import { useCallback, useMemo, useRef, useState } from "react";
7
9
  //#region src/sdk/payment/use-place-order.ts
8
- /**
9
- * The place-order orchestration (specs/use-place-order.md, T13; docs/features/credit-card/rfc.md
10
- * § D9) — the PCI-critical core of the credit-card feature, and the only module that knows placing an
11
- * order is three calls rather than one mutation.
12
- *
13
- * **This hook never holds card data.** It resolves an opaque continuation from the submission channel
14
- * by the shopper's entry path and invokes it between the two backend legs; the card stays in the
15
- * holder's closure (T7 for a new card, T12 for a saved one), which calls
16
- * `$actions.payment.sendPayments` itself. So the actions this hook needs are `startTransaction`,
17
- * `gatewayCallback`, and `analytics.track` — never the gateway façade. Two tests assert the boundary
18
- * against this file's own source text: no card field is named in code, and the single import from
19
- * `./gateway.js` is the transaction descriptor's type.
20
- *
21
- * The order of the pre-flight is load-bearing, not stylistic. The path, the continuation, and the
22
- * selected method are all resolved *before* `startTransaction` runs, because a transaction that is
23
- * opened and then cannot be completed is dangling state on the shopper's order form.
24
- *
25
- * v1 is the direct-API mode: the gateway leg resolves inline and the shopper stays on the page. The
26
- * redirect mode — an external navigation with a resume-on-callback route, and with it 3D Secure — is
27
- * phase 2, which is why no `callbackUrl` reaches the descriptor.
28
- *
29
- * Every failure resolves as `userErrors`; nothing here throws for an expected outcome, so the CTA
30
- * (T14) renders one error path. Its one per-code branch is PLACE_ORDER_UNCONFIRMED, a pending outcome
31
- * it shows as a status rather than an error (T176).
32
- */
33
10
  /** No entry path chosen, or no holder registered for the one that was. */
34
11
  const PAYMENT_MISSING_SUBMISSION_CODE = "MISSING_PAYMENT_SUBMISSION";
35
12
  /**
@@ -70,7 +47,7 @@ const PLACE_ORDER_IN_FLIGHT_ERROR = {
70
47
  };
71
48
  /**
72
49
  * Worded as a pending state, never a failure: it must not tell the shopper to try again (FR-1).
73
- * `PlaceOrder`'s `unconfirmedMessage` schema default repeats this text verbatim.
50
+ * `PlaceOrder`'s `unconfirmedMessage` source copy repeats this text verbatim.
74
51
  */
75
52
  const PLACE_ORDER_UNCONFIRMED_ERROR = {
76
53
  code: PLACE_ORDER_UNCONFIRMED_CODE,
@@ -112,6 +89,7 @@ function settleTransaction(payload) {
112
89
  transactionId,
113
90
  merchantName,
114
91
  orderGroup,
92
+ orderNodeId: payload.orderNodeId ?? null,
115
93
  userProfileId,
116
94
  value,
117
95
  valueInCents,
@@ -140,7 +118,8 @@ function toMinorUnits(amount) {
140
118
  * a boolean is read as `true`: only a literal `false` may free the attempt, so a holder that omits the
141
119
  * signal locks it rather than inviting a second payment. An empty `userErrors` is a success whatever the
142
120
  * flag says. Each field is read once, into a local, and the result handed back is a fresh object — a
143
- * getter that answers differently across reads has no second read to answer differently on.
121
+ * getter that answers differently across reads has no second read to answer differently on. T39: the one
122
+ * field kept beyond those two is `completesWithoutGateway`, and only as the literal `true` on a success.
144
123
  */
145
124
  async function invokeSubmission(submit, transaction) {
146
125
  try {
@@ -152,7 +131,7 @@ async function invokeSubmission(submit, transaction) {
152
131
  userErrors: [NETWORK_ERROR]
153
132
  };
154
133
  }
155
- const { reachedGateway, userErrors } = result;
134
+ const { reachedGateway, userErrors, completesWithoutGateway } = result;
156
135
  if (!Array.isArray(userErrors)) {
157
136
  console.error("[payment.placeOrder] the registered submission resolved a result with no userErrors list");
158
137
  return {
@@ -160,7 +139,11 @@ async function invokeSubmission(submit, transaction) {
160
139
  userErrors: [NETWORK_ERROR]
161
140
  };
162
141
  }
163
- if (userErrors.length === 0) return {
142
+ if (userErrors.length === 0) return completesWithoutGateway === true ? {
143
+ reachedGateway: true,
144
+ userErrors: [],
145
+ completesWithoutGateway: true
146
+ } : {
164
147
  reachedGateway: true,
165
148
  userErrors: []
166
149
  };
@@ -249,13 +232,14 @@ function runMissingMethodExplainer(explain) {
249
232
  */
250
233
  async function invokeStartTransaction(startTransaction) {
251
234
  try {
252
- const { transactionId, merchantName, gatewayUrl, orderGroup, userProfileId, value, valueInCents, referenceValueInCents, userErrors } = await startTransaction();
235
+ const { transactionId, merchantName, gatewayUrl, orderGroup, orderNodeId, userProfileId, value, valueInCents, referenceValueInCents, userErrors } = await startTransaction();
253
236
  if (userErrors == null) console.error("[payment.placeOrder] startTransaction resolved with no userErrors", orderGroup);
254
237
  return {
255
238
  transactionId,
256
239
  merchantName,
257
240
  gatewayUrl,
258
241
  orderGroup,
242
+ orderNodeId,
259
243
  userProfileId,
260
244
  value,
261
245
  valueInCents,
@@ -269,6 +253,7 @@ async function invokeStartTransaction(startTransaction) {
269
253
  merchantName: null,
270
254
  gatewayUrl: null,
271
255
  orderGroup: null,
256
+ orderNodeId: null,
272
257
  userProfileId: null,
273
258
  value: null,
274
259
  valueInCents: null,
@@ -316,6 +301,7 @@ async function invokeGatewayCallback(gatewayCallback, orderGroup, attemptId) {
316
301
  console.error("[payment.placeOrder] gatewayCallback threw", orderGroup, attemptId, loggableErrorName(error));
317
302
  return {
318
303
  orderId: null,
304
+ orderNodeId: null,
319
305
  userErrors: [NETWORK_ERROR]
320
306
  };
321
307
  }
@@ -323,23 +309,28 @@ async function invokeGatewayCallback(gatewayCallback, orderGroup, attemptId) {
323
309
  console.error("[payment.placeOrder] gatewayCallback resolved with no result", orderGroup, attemptId);
324
310
  return {
325
311
  orderId: null,
312
+ orderNodeId: null,
326
313
  userErrors: [NETWORK_ERROR]
327
314
  };
328
315
  }
329
316
  if (result.userErrors == null) console.error("[payment.placeOrder] gatewayCallback resolved with no userErrors", orderGroup, attemptId);
330
317
  return {
331
318
  orderId: result.orderId ?? null,
319
+ orderNodeId: result.orderNodeId ?? null,
320
+ redirectUrl: result.redirectUrl ?? null,
332
321
  userErrors: result.userErrors ?? [NETWORK_ERROR]
333
322
  };
334
323
  }
335
324
  /**
336
- * The two codes the server sends today on `gatewayCallback`. Neither is a verdict on the order, so
337
- * `callbackFreesAttempt` never frees an attempt that carries either (T110, Decision 3):
338
- * `REDIRECT_REQUIRED` is a bank challenge, and `MISSING_TRANSACTION_COOKIES` means the card POST was
339
- * already accepted while the callback never reached VTEX, so a second POST could authorize the card twice.
325
+ * The codes the server sends on `gatewayCallback` that are not a verdict on the order, so
326
+ * `callbackFreesAttempt` never frees an attempt that carries one (T110, Decision 3):
327
+ * `REDIRECT_REQUIRED` is a bank challenge, and `MISSING_TRANSACTION_COOKIES` and `ORDER_GROUP_MISMATCH`
328
+ * mean the card POST was already accepted while the callback never reached VTEX, so a second POST could
329
+ * authorize the card twice.
340
330
  */
341
331
  const REDIRECT_REQUIRED_CODE = "REDIRECT_REQUIRED";
342
332
  const MISSING_TRANSACTION_COOKIES_CODE = "MISSING_TRANSACTION_COOKIES";
333
+ const ORDER_GROUP_MISMATCH_CODE = "ORDER_GROUP_MISMATCH";
343
334
  /** The entry's `code`, or `undefined` when it cannot be read (a `null` entry, a getter that throws). */
344
335
  function readCode(userError) {
345
336
  try {
@@ -356,15 +347,15 @@ function carriesServerCode(userError) {
356
347
  /**
357
348
  * T110: whether a `gatewayCallback` that reported `userErrors` frees the attempt for a fresh run. It does
358
349
  * when the server sent a string `code`, none of the entries is a locked code (`REDIRECT_REQUIRED`,
359
- * `MISSING_TRANSACTION_COOKIES`), and the result carries no `orderId`: an order the callback confirmed is
360
- * never freed. Everything else keeps the attempt resume-only, because a payment that may have gone through
350
+ * `MISSING_TRANSACTION_COOKIES`, `ORDER_GROUP_MISMATCH`), and the result carries no `orderId`: an order the
351
+ * callback confirmed is never freed. Everything else keeps the attempt resume-only, because a payment that may have gone through
361
352
  * must never be paid twice. Total, and never throws: a non-array, an empty list or an entry nobody can read
362
353
  * frees nothing.
363
354
  *
364
- * Dormant today: the server sends only the two locked codes, so no real callback frees an attempt yet.
365
- * The rule fires for a server-coded error the server does not send yet (task T225 will). It fails open on
366
- * a code it does not know (spec AC-5: no per-code table); a future allowlist of the codes that really are
367
- * declines belongs to T225, not to this hook.
355
+ * Live since T203: the server answers a refused callback with `PAYMENT_DECLINED`, which frees the attempt,
356
+ * while the locked codes it also sends stay resume-only. The rule fails open on a code it does not
357
+ * know (spec AC-5: no per-code table); an allowlist of the codes that really are declines is not this
358
+ * hook's job.
368
359
  */
369
360
  function callbackFreesAttempt(callback) {
370
361
  const { orderId, userErrors } = callback;
@@ -372,10 +363,28 @@ function callbackFreesAttempt(callback) {
372
363
  if (!Array.isArray(userErrors)) return false;
373
364
  return userErrors.some((userError) => carriesServerCode(userError)) && !userErrors.some((userError) => {
374
365
  const code = readCode(userError);
375
- return code === REDIRECT_REQUIRED_CODE || code === MISSING_TRANSACTION_COOKIES_CODE;
366
+ return code === REDIRECT_REQUIRED_CODE || code === MISSING_TRANSACTION_COOKIES_CODE || code === ORDER_GROUP_MISMATCH_CODE;
376
367
  });
377
368
  }
378
369
  /**
370
+ * T208 (Decision 3): the bank's challenge page, when this callback answer may be followed. Only when a return
371
+ * URL was sent (the bank could not send the shopper back otherwise), the answer asks for a challenge and
372
+ * places no order, and the URL is absolute `http(s)`. A site-relative URL is refused too: the only
373
+ * navigation off the store's own pages is the one to the bank. Total, and never throws.
374
+ */
375
+ function readChallengeRedirect(callback, returnUrlSent) {
376
+ if (!returnUrlSent || callback.orderId != null) return null;
377
+ const { userErrors, redirectUrl } = callback;
378
+ if (!Array.isArray(userErrors) || typeof redirectUrl !== "string") return null;
379
+ if (!userErrors.some((userError) => readCode(userError) === REDIRECT_REQUIRED_CODE)) return null;
380
+ const destination = resolveNavigableHref(redirectUrl);
381
+ return destination.safe && destination.href === redirectUrl && !destination.href.startsWith("/") ? redirectUrl : null;
382
+ }
383
+ /** The result field a redirect adds: absent, never an explicit `undefined`, when there is nothing to follow. */
384
+ function redirectField(redirectUrl) {
385
+ return redirectUrl === null ? {} : { redirectUrl };
386
+ }
387
+ /**
379
388
  * T176 (FR-2, FR-3): what the caller reads from a `gatewayCallback` that reported `userErrors`, on both
380
389
  * paths that issue it. The gateway already accepted the card POST by then, so a result made only of this
381
390
  * package's own collapse — `PAYMENT_NETWORK_ERROR_CODE`, which `usePaymentActions` and
@@ -446,7 +455,8 @@ function resumedRecord(current, callback, failed, freed) {
446
455
  return {
447
456
  ...current,
448
457
  phase: "settled",
449
- orderId: callback.orderId
458
+ orderId: callback.orderId,
459
+ orderNodeId: callback.orderNodeId ?? null
450
460
  };
451
461
  }
452
462
  /**
@@ -565,7 +575,7 @@ async function openTransaction(startTransaction, setAttempt, attemptId) {
565
575
  };
566
576
  }
567
577
  /** The descriptor `run()` hands to the registered submission. Nothing in it is sensitive. */
568
- function buildTransaction({ settled, method, selectedInstallment, billingAddressDifferent }) {
578
+ function buildTransaction({ settled, method, selectedInstallment, billingAddressDifferent, callbackUrl }) {
569
579
  return {
570
580
  gatewayUrl: settled.gatewayUrl,
571
581
  transactionId: settled.transactionId,
@@ -580,9 +590,15 @@ function buildTransaction({ settled, method, selectedInstallment, billingAddress
580
590
  installments: selectedInstallment?.count ?? 1,
581
591
  installmentsValueInCents: selectedInstallment && selectedInstallment.count !== 1 ? toMinorUnits(selectedInstallment.value.amount) : settled.valueInCents,
582
592
  interestRate: selectedInstallment?.interestRate ?? 0,
583
- ...billingAddressDifferent == null ? {} : { billingAddressDifferent }
593
+ ...billingAddressDifferent == null ? {} : { billingAddressDifferent },
594
+ ...callbackUrl === null ? {} : { callbackUrl }
584
595
  };
585
596
  }
597
+ /** The return URL for a group, or `null` when none was authored or the builder gave none. */
598
+ function returnUrlFor(challengeReturn, orderGroup) {
599
+ const url = challengeReturn?.(orderGroup);
600
+ return typeof url === "string" && url !== "" ? url : null;
601
+ }
586
602
  /**
587
603
  * T29 (Decision 3, FR-3): the only path back into a `sent`/`unresolved` attempt — `gatewayCallback` is
588
604
  * the sole call it ever issues. Module scope, not a `useCallback` inside the hook (fix pass, Low
@@ -596,8 +612,12 @@ function buildTransaction({ settled, method, selectedInstallment, billingAddress
596
612
  *
597
613
  * T110: a callback the retry rule frees records `refused`, as `run()` does, so the next click is a fresh
598
614
  * full run. This function still issues nothing but `gatewayCallback`.
615
+ *
616
+ * T208: a callback that answers a challenge redirects here too, when `returnUrlSent` says the original request
617
+ * carried a return URL (the attempt record does not carry that fact). A resume that finishes the order reports
618
+ * its purchase, reading value and currency from the settled order: the record may hold neither.
599
619
  */
600
- async function resume(gatewayCallback, setAttempt, setPlacing, current) {
620
+ async function resume(gatewayCallback, setAttempt, setPlacing, current, { returnUrlSent, track, readSettledOrder }) {
601
621
  if (!gatewayCallback || current.orderGroup === null) {
602
622
  console.error("[payment.placeOrder] cannot resume an attempt with no order group");
603
623
  return {
@@ -613,15 +633,23 @@ async function resume(gatewayCallback, setAttempt, setPlacing, current) {
613
633
  setPlacing(true);
614
634
  const callback = await invokeGatewayCallback(gatewayCallback, current.orderGroup, current.attemptId);
615
635
  const failed = callback.userErrors.length > 0;
636
+ const redirectUrl = failed ? readChallengeRedirect(callback, returnUrlSent) : null;
616
637
  const result = failed ? {
617
638
  orderId: null,
618
639
  userErrors: reconcileCallbackUserErrors(callback.userErrors),
619
- reachedGateway: true
640
+ reachedGateway: true,
641
+ ...redirectField(redirectUrl)
620
642
  } : {
621
643
  orderId: callback.orderId,
644
+ orderNodeId: callback.orderNodeId ?? null,
622
645
  userErrors: [],
623
646
  reachedGateway: true
624
647
  };
648
+ if (!failed && callback.orderNodeId != null) await emitPurchaseForOrder({
649
+ track,
650
+ readOrder: readSettledOrder,
651
+ orderNodeId: callback.orderNodeId
652
+ });
625
653
  const freed = failed && callbackFreesAttempt(callback);
626
654
  try {
627
655
  writeAttemptIfCurrent(setAttempt, current.attemptId, resumedRecord(current, callback, failed, freed));
@@ -630,12 +658,14 @@ async function resume(gatewayCallback, setAttempt, setPlacing, current) {
630
658
  }
631
659
  return result;
632
660
  }
633
- function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDifferent, submitGate }) {
661
+ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDifferent, submitGate, challengeReturn, readSettledOrder }) {
634
662
  const { path, resolve, resolvePreflight, resolveMissingMethodExplainer } = usePaymentSubmission();
635
663
  const [placing, setPlacing] = useState(false);
636
664
  const [userErrors, setUserErrors] = useState([]);
637
665
  const [orderId, setOrderId] = useState(null);
666
+ const [orderNodeId, setOrderNodeId] = useState(null);
638
667
  const [reachedGateway, setReachedGateway] = useState(null);
668
+ const [redirectUrl, setRedirectUrl] = useState(null);
639
669
  const inFlight = useRef(null);
640
670
  const startTransaction = $actions?.payment?.startTransaction;
641
671
  const gatewayCallback = $actions?.payment?.gatewayCallback;
@@ -688,11 +718,13 @@ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDif
688
718
  orderGroup: settled.orderGroup,
689
719
  orderId: null
690
720
  });
721
+ const callbackUrl = returnUrlFor(challengeReturn, settled.orderGroup);
691
722
  const transaction = buildTransaction({
692
723
  settled,
693
724
  method,
694
725
  selectedInstallment,
695
- billingAddressDifferent
726
+ billingAddressDifferent,
727
+ callbackUrl
696
728
  });
697
729
  handedOver = true;
698
730
  const submissionErrors = await invokeSubmission(submit, transaction);
@@ -707,37 +739,47 @@ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDif
707
739
  writeAttemptIfCurrent(setAttempt, attemptId, recoveryRecord(attemptId, null, handedOver, settled.orderGroup));
708
740
  return outcome;
709
741
  }
710
- writeAttemptIfCurrent(setAttempt, attemptId, {
711
- attemptId,
712
- phase: "finalizing",
713
- orderGroup: settled.orderGroup,
714
- orderId: null
715
- });
716
- const callback = await invokeGatewayCallback(gatewayCallback, settled.orderGroup, attemptId);
717
- if (callback.userErrors.length > 0) {
718
- outcome = {
719
- orderId: null,
720
- userErrors: reconcileCallbackUserErrors(callback.userErrors),
721
- reachedGateway: true
722
- };
723
- handedOver = !callbackFreesAttempt(callback);
724
- writeAttemptIfCurrent(setAttempt, attemptId, recoveryRecord(attemptId, null, handedOver, settled.orderGroup));
725
- return outcome;
742
+ const completesWithoutGateway = submissionErrors.completesWithoutGateway === true;
743
+ let placedOrderId = settled.orderGroup;
744
+ let placedOrderNodeId = settled.orderNodeId;
745
+ if (!completesWithoutGateway) {
746
+ writeAttemptIfCurrent(setAttempt, attemptId, {
747
+ attemptId,
748
+ phase: "finalizing",
749
+ orderGroup: settled.orderGroup,
750
+ orderId: null
751
+ });
752
+ const callback = await invokeGatewayCallback(gatewayCallback, settled.orderGroup, attemptId);
753
+ if (callback.userErrors.length > 0) {
754
+ outcome = {
755
+ orderId: null,
756
+ userErrors: reconcileCallbackUserErrors(callback.userErrors),
757
+ reachedGateway: true,
758
+ ...redirectField(readChallengeRedirect(callback, callbackUrl !== null))
759
+ };
760
+ handedOver = !callbackFreesAttempt(callback);
761
+ writeAttemptIfCurrent(setAttempt, attemptId, recoveryRecord(attemptId, null, handedOver, settled.orderGroup));
762
+ return outcome;
763
+ }
764
+ placedOrderId = callback.orderId;
765
+ placedOrderNodeId = callback.orderNodeId ?? settled.orderNodeId;
726
766
  }
727
767
  placedAttempt = {
728
768
  attemptId,
729
769
  phase: "settled",
730
770
  orderGroup: settled.orderGroup,
731
- orderId: callback.orderId
771
+ orderId: placedOrderId,
772
+ orderNodeId: placedOrderNodeId
732
773
  };
733
774
  outcome = {
734
- orderId: callback.orderId,
775
+ orderId: placedOrderId,
776
+ orderNodeId: placedOrderNodeId,
735
777
  userErrors: [],
736
778
  reachedGateway: true
737
779
  };
738
- track?.({
780
+ if (track && claimPurchase(settled.orderGroup)) track({
739
781
  name: "purchase",
740
- transactionId: callback.orderId ?? settled.transactionId,
782
+ transactionId: placedOrderId ?? settled.transactionId,
741
783
  value: {
742
784
  amount: Number(settled.value.amount),
743
785
  currencyCode: settled.value.currencyCode
@@ -766,20 +808,28 @@ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDif
766
808
  selectedInstallment,
767
809
  billingAddressDifferent,
768
810
  submitGate,
769
- setAttempt
811
+ setAttempt,
812
+ challengeReturn
770
813
  ]);
771
814
  const placeOrder = useCallback(() => {
772
815
  if (inFlight.current !== null) return inFlight.current;
773
816
  const settleSequence = (sequence) => {
774
817
  setUserErrors([]);
775
818
  setOrderId(null);
819
+ setOrderNodeId(null);
776
820
  setReachedGateway(null);
821
+ setRedirectUrl(null);
777
822
  const settle = (result) => {
778
- inFlight.current = null;
779
- setPlacing(false);
780
- setUserErrors(result.userErrors);
823
+ const redirecting = typeof result.redirectUrl === "string";
824
+ if (!redirecting) {
825
+ inFlight.current = null;
826
+ setPlacing(false);
827
+ }
828
+ setUserErrors(redirecting ? [] : result.userErrors);
781
829
  setOrderId(result.orderId);
830
+ setOrderNodeId(result.orderNodeId ?? null);
782
831
  setReachedGateway(result.reachedGateway);
832
+ setRedirectUrl(redirecting ? result.redirectUrl ?? null : null);
783
833
  return result;
784
834
  };
785
835
  const outcome = sequence.then(settle, () => settle({
@@ -793,6 +843,7 @@ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDif
793
843
  if (attempt) {
794
844
  if (attempt.phase === "settled") return settleSequence(Promise.resolve({
795
845
  orderId: attempt.orderId,
846
+ orderNodeId: attempt.orderNodeId ?? null,
796
847
  userErrors: [],
797
848
  reachedGateway: true
798
849
  }));
@@ -801,27 +852,38 @@ function usePlaceOrder({ $data, $actions, attempt, setAttempt, billingAddressDif
801
852
  userErrors: [PLACE_ORDER_IN_FLIGHT_ERROR],
802
853
  reachedGateway: true
803
854
  }));
804
- if (attempt.phase === "sent" || attempt.phase === "unresolved") return settleSequence(resume(gatewayCallback, setAttempt, setPlacing, attempt));
855
+ if (attempt.phase === "sent" || attempt.phase === "unresolved") return settleSequence(resume(gatewayCallback, setAttempt, setPlacing, attempt, {
856
+ returnUrlSent: attempt.orderGroup !== null && returnUrlFor(challengeReturn, attempt.orderGroup) !== null,
857
+ track,
858
+ readSettledOrder
859
+ }));
805
860
  }
806
861
  return settleSequence(run());
807
862
  }, [
808
863
  run,
809
864
  attempt,
810
865
  gatewayCallback,
811
- setAttempt
866
+ setAttempt,
867
+ challengeReturn,
868
+ track,
869
+ readSettledOrder
812
870
  ]);
813
871
  return useMemo(() => ({
814
872
  placeOrder,
815
873
  placing,
816
874
  userErrors,
817
875
  orderId,
818
- reachedGateway
876
+ orderNodeId,
877
+ reachedGateway,
878
+ redirectUrl
819
879
  }), [
820
880
  placeOrder,
821
881
  placing,
822
882
  userErrors,
823
883
  orderId,
824
- reachedGateway
884
+ orderNodeId,
885
+ reachedGateway,
886
+ redirectUrl
825
887
  ]);
826
888
  }
827
889
  //#endregion