@spare-technologies/spare-link 0.1.0-beta.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/README.md +119 -81
  2. package/lib/commonjs/core/models/payment-return-params.js +245 -20
  3. package/lib/commonjs/core/models/payment-return-params.js.map +1 -1
  4. package/lib/commonjs/core/models/pending-session-record.js +2 -0
  5. package/lib/commonjs/core/models/pending-session-record.js.map +1 -0
  6. package/lib/commonjs/core/services/hosted-flow-controller.js +333 -0
  7. package/lib/commonjs/core/services/hosted-flow-controller.js.map +1 -0
  8. package/lib/commonjs/core/services/hosted-flow-state.js +96 -0
  9. package/lib/commonjs/core/services/hosted-flow-state.js.map +1 -0
  10. package/lib/commonjs/index.js +42 -164
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/internal/hosted/bridge-message.js +107 -0
  13. package/lib/commonjs/internal/hosted/bridge-message.js.map +1 -0
  14. package/lib/commonjs/internal/hosted/hosted-url.js +41 -0
  15. package/lib/commonjs/internal/hosted/hosted-url.js.map +1 -0
  16. package/lib/commonjs/internal/index.js +0 -7
  17. package/lib/commonjs/internal/index.js.map +1 -1
  18. package/lib/commonjs/internal/redact-uri.js +59 -15
  19. package/lib/commonjs/internal/redact-uri.js.map +1 -1
  20. package/lib/commonjs/internal/secure-store-pending-session-store.js +20 -25
  21. package/lib/commonjs/internal/secure-store-pending-session-store.js.map +1 -1
  22. package/lib/commonjs/internal/url-parts.js +145 -0
  23. package/lib/commonjs/internal/url-parts.js.map +1 -0
  24. package/lib/commonjs/public/index.js +0 -37
  25. package/lib/commonjs/public/index.js.map +1 -1
  26. package/lib/commonjs/public/payment-result.js +16 -4
  27. package/lib/commonjs/public/payment-result.js.map +1 -1
  28. package/lib/commonjs/public/recovery-result.js +7 -18
  29. package/lib/commonjs/public/recovery-result.js.map +1 -1
  30. package/lib/commonjs/public/spare-link-config.js +41 -16
  31. package/lib/commonjs/public/spare-link-config.js.map +1 -1
  32. package/lib/commonjs/public/spare-link-event.js +27 -33
  33. package/lib/commonjs/public/spare-link-event.js.map +1 -1
  34. package/lib/commonjs/public/spare-link-instance.js +67 -77
  35. package/lib/commonjs/public/spare-link-instance.js.map +1 -1
  36. package/lib/commonjs/public/spare-link-session.js +2 -9
  37. package/lib/commonjs/public/spare-link-session.js.map +1 -1
  38. package/lib/commonjs/public/spare-link.js +0 -12
  39. package/lib/commonjs/public/spare-link.js.map +1 -1
  40. package/lib/commonjs/ui/hooks/{use-payment-flow-state.js → use-hosted-flow-state.js} +4 -4
  41. package/lib/commonjs/ui/hooks/use-hosted-flow-state.js.map +1 -0
  42. package/lib/commonjs/ui/hosted/hosted-payment-page.js +177 -0
  43. package/lib/commonjs/ui/hosted/hosted-payment-page.js.map +1 -0
  44. package/lib/commonjs/ui/hosted/hosted-payment-webview.js +168 -0
  45. package/lib/commonjs/ui/hosted/hosted-payment-webview.js.map +1 -0
  46. package/lib/commonjs/ui/screens/index.js +3 -17
  47. package/lib/commonjs/ui/screens/index.js.map +1 -1
  48. package/lib/commonjs/ui/screens/page-unavailable-screen.js +101 -0
  49. package/lib/commonjs/ui/screens/page-unavailable-screen.js.map +1 -0
  50. package/lib/commonjs/ui/spare-link-host.js +220 -234
  51. package/lib/commonjs/ui/spare-link-host.js.map +1 -1
  52. package/lib/commonjs/ui/widgets/index.js +3 -10
  53. package/lib/commonjs/ui/widgets/index.js.map +1 -1
  54. package/lib/commonjs/version.js +7 -5
  55. package/lib/commonjs/version.js.map +1 -1
  56. package/lib/module/core/models/payment-return-params.js +235 -20
  57. package/lib/module/core/models/payment-return-params.js.map +1 -1
  58. package/lib/module/core/models/pending-session-record.js +2 -0
  59. package/lib/module/core/models/pending-session-record.js.map +1 -0
  60. package/lib/module/core/services/hosted-flow-controller.js +328 -0
  61. package/lib/module/core/services/hosted-flow-controller.js.map +1 -0
  62. package/lib/module/core/services/hosted-flow-state.js +91 -0
  63. package/lib/module/core/services/hosted-flow-state.js.map +1 -0
  64. package/lib/module/index.js +8 -22
  65. package/lib/module/index.js.map +1 -1
  66. package/lib/module/internal/hosted/bridge-message.js +104 -0
  67. package/lib/module/internal/hosted/bridge-message.js.map +1 -0
  68. package/lib/module/internal/hosted/hosted-url.js +36 -0
  69. package/lib/module/internal/hosted/hosted-url.js.map +1 -0
  70. package/lib/module/internal/index.js +0 -1
  71. package/lib/module/internal/index.js.map +1 -1
  72. package/lib/module/internal/redact-uri.js +59 -15
  73. package/lib/module/internal/redact-uri.js.map +1 -1
  74. package/lib/module/internal/secure-store-pending-session-store.js +20 -25
  75. package/lib/module/internal/secure-store-pending-session-store.js.map +1 -1
  76. package/lib/module/internal/url-parts.js +139 -0
  77. package/lib/module/internal/url-parts.js.map +1 -0
  78. package/lib/module/public/index.js +2 -3
  79. package/lib/module/public/index.js.map +1 -1
  80. package/lib/module/public/payment-result.js +16 -4
  81. package/lib/module/public/payment-result.js.map +1 -1
  82. package/lib/module/public/recovery-result.js +7 -17
  83. package/lib/module/public/recovery-result.js.map +1 -1
  84. package/lib/module/public/spare-link-config.js +42 -15
  85. package/lib/module/public/spare-link-config.js.map +1 -1
  86. package/lib/module/public/spare-link-event.js +27 -33
  87. package/lib/module/public/spare-link-event.js.map +1 -1
  88. package/lib/module/public/spare-link-instance.js +68 -72
  89. package/lib/module/public/spare-link-instance.js.map +1 -1
  90. package/lib/module/public/spare-link-session.js +2 -9
  91. package/lib/module/public/spare-link-session.js.map +1 -1
  92. package/lib/module/public/spare-link.js +1 -1
  93. package/lib/module/public/spare-link.js.map +1 -1
  94. package/lib/module/ui/hooks/{use-payment-flow-state.js → use-hosted-flow-state.js} +3 -3
  95. package/lib/module/ui/hooks/use-hosted-flow-state.js.map +1 -0
  96. package/lib/module/ui/hosted/hosted-payment-page.js +175 -0
  97. package/lib/module/ui/hosted/hosted-payment-page.js.map +1 -0
  98. package/lib/module/ui/hosted/hosted-payment-webview.js +163 -0
  99. package/lib/module/ui/hosted/hosted-payment-webview.js.map +1 -0
  100. package/lib/module/ui/screens/index.js +1 -3
  101. package/lib/module/ui/screens/index.js.map +1 -1
  102. package/lib/module/ui/screens/page-unavailable-screen.js +97 -0
  103. package/lib/module/ui/screens/page-unavailable-screen.js.map +1 -0
  104. package/lib/module/ui/spare-link-host.js +221 -236
  105. package/lib/module/ui/spare-link-host.js.map +1 -1
  106. package/lib/module/ui/widgets/index.js +1 -2
  107. package/lib/module/ui/widgets/index.js.map +1 -1
  108. package/lib/module/version.js +7 -5
  109. package/lib/module/version.js.map +1 -1
  110. package/lib/typescript/commonjs/core/models/index.d.ts +1 -123
  111. package/lib/typescript/commonjs/core/models/index.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/core/models/payment-return-params.d.ts +91 -8
  113. package/lib/typescript/commonjs/core/models/payment-return-params.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/core/models/pending-session-record.d.ts +11 -0
  115. package/lib/typescript/commonjs/core/models/pending-session-record.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/core/services/hosted-flow-controller.d.ts +119 -0
  117. package/lib/typescript/commonjs/core/services/hosted-flow-controller.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/core/services/hosted-flow-state.d.ts +75 -0
  119. package/lib/typescript/commonjs/core/services/hosted-flow-state.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/index.d.ts +5 -14
  121. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/internal/hosted/bridge-message.d.ts +44 -0
  123. package/lib/typescript/commonjs/internal/hosted/bridge-message.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/internal/hosted/hosted-url.d.ts +30 -0
  125. package/lib/typescript/commonjs/internal/hosted/hosted-url.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/internal/index.d.ts +0 -1
  127. package/lib/typescript/commonjs/internal/index.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/internal/redact-uri.d.ts +21 -1
  129. package/lib/typescript/commonjs/internal/redact-uri.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts +3 -2
  131. package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/internal/url-parts.d.ts +46 -0
  133. package/lib/typescript/commonjs/internal/url-parts.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/public/index.d.ts +4 -6
  135. package/lib/typescript/commonjs/public/index.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/public/payment-result.d.ts +50 -12
  137. package/lib/typescript/commonjs/public/payment-result.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/public/recovery-result.d.ts +11 -20
  139. package/lib/typescript/commonjs/public/recovery-result.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/public/spare-link-config.d.ts +13 -31
  141. package/lib/typescript/commonjs/public/spare-link-config.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/public/spare-link-event.d.ts +29 -31
  143. package/lib/typescript/commonjs/public/spare-link-event.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/public/spare-link-host-api.d.ts +1 -12
  145. package/lib/typescript/commonjs/public/spare-link-host-api.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/public/spare-link-instance.d.ts +26 -20
  147. package/lib/typescript/commonjs/public/spare-link-instance.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/public/spare-link-session.d.ts +3 -8
  149. package/lib/typescript/commonjs/public/spare-link-session.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/public/spare-link.d.ts +1 -1
  151. package/lib/typescript/commonjs/public/spare-link.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/ui/hooks/use-hosted-flow-state.d.ts +9 -0
  153. package/lib/typescript/commonjs/ui/hooks/use-hosted-flow-state.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/ui/hosted/hosted-payment-page.d.ts +17 -0
  155. package/lib/typescript/commonjs/ui/hosted/hosted-payment-page.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/ui/hosted/hosted-payment-webview.d.ts +43 -0
  157. package/lib/typescript/commonjs/ui/hosted/hosted-payment-webview.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/ui/screens/index.d.ts +1 -3
  159. package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/ui/screens/page-unavailable-screen.d.ts +18 -0
  161. package/lib/typescript/commonjs/ui/screens/page-unavailable-screen.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/ui/spare-link-host.d.ts +4 -5
  163. package/lib/typescript/commonjs/ui/spare-link-host.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/ui/widgets/index.d.ts +1 -2
  165. package/lib/typescript/commonjs/ui/widgets/index.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/version.d.ts +7 -5
  167. package/lib/typescript/commonjs/version.d.ts.map +1 -1
  168. package/lib/typescript/module/core/models/index.d.ts +1 -123
  169. package/lib/typescript/module/core/models/index.d.ts.map +1 -1
  170. package/lib/typescript/module/core/models/payment-return-params.d.ts +91 -8
  171. package/lib/typescript/module/core/models/payment-return-params.d.ts.map +1 -1
  172. package/lib/typescript/module/core/models/pending-session-record.d.ts +11 -0
  173. package/lib/typescript/module/core/models/pending-session-record.d.ts.map +1 -0
  174. package/lib/typescript/module/core/services/hosted-flow-controller.d.ts +119 -0
  175. package/lib/typescript/module/core/services/hosted-flow-controller.d.ts.map +1 -0
  176. package/lib/typescript/module/core/services/hosted-flow-state.d.ts +75 -0
  177. package/lib/typescript/module/core/services/hosted-flow-state.d.ts.map +1 -0
  178. package/lib/typescript/module/index.d.ts +5 -14
  179. package/lib/typescript/module/index.d.ts.map +1 -1
  180. package/lib/typescript/module/internal/hosted/bridge-message.d.ts +44 -0
  181. package/lib/typescript/module/internal/hosted/bridge-message.d.ts.map +1 -0
  182. package/lib/typescript/module/internal/hosted/hosted-url.d.ts +30 -0
  183. package/lib/typescript/module/internal/hosted/hosted-url.d.ts.map +1 -0
  184. package/lib/typescript/module/internal/index.d.ts +0 -1
  185. package/lib/typescript/module/internal/index.d.ts.map +1 -1
  186. package/lib/typescript/module/internal/redact-uri.d.ts +21 -1
  187. package/lib/typescript/module/internal/redact-uri.d.ts.map +1 -1
  188. package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts +3 -2
  189. package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts.map +1 -1
  190. package/lib/typescript/module/internal/url-parts.d.ts +46 -0
  191. package/lib/typescript/module/internal/url-parts.d.ts.map +1 -0
  192. package/lib/typescript/module/public/index.d.ts +4 -6
  193. package/lib/typescript/module/public/index.d.ts.map +1 -1
  194. package/lib/typescript/module/public/payment-result.d.ts +50 -12
  195. package/lib/typescript/module/public/payment-result.d.ts.map +1 -1
  196. package/lib/typescript/module/public/recovery-result.d.ts +11 -20
  197. package/lib/typescript/module/public/recovery-result.d.ts.map +1 -1
  198. package/lib/typescript/module/public/spare-link-config.d.ts +13 -31
  199. package/lib/typescript/module/public/spare-link-config.d.ts.map +1 -1
  200. package/lib/typescript/module/public/spare-link-event.d.ts +29 -31
  201. package/lib/typescript/module/public/spare-link-event.d.ts.map +1 -1
  202. package/lib/typescript/module/public/spare-link-host-api.d.ts +1 -12
  203. package/lib/typescript/module/public/spare-link-host-api.d.ts.map +1 -1
  204. package/lib/typescript/module/public/spare-link-instance.d.ts +26 -20
  205. package/lib/typescript/module/public/spare-link-instance.d.ts.map +1 -1
  206. package/lib/typescript/module/public/spare-link-session.d.ts +3 -8
  207. package/lib/typescript/module/public/spare-link-session.d.ts.map +1 -1
  208. package/lib/typescript/module/public/spare-link.d.ts +1 -1
  209. package/lib/typescript/module/public/spare-link.d.ts.map +1 -1
  210. package/lib/typescript/module/ui/hooks/use-hosted-flow-state.d.ts +9 -0
  211. package/lib/typescript/module/ui/hooks/use-hosted-flow-state.d.ts.map +1 -0
  212. package/lib/typescript/module/ui/hosted/hosted-payment-page.d.ts +17 -0
  213. package/lib/typescript/module/ui/hosted/hosted-payment-page.d.ts.map +1 -0
  214. package/lib/typescript/module/ui/hosted/hosted-payment-webview.d.ts +43 -0
  215. package/lib/typescript/module/ui/hosted/hosted-payment-webview.d.ts.map +1 -0
  216. package/lib/typescript/module/ui/screens/index.d.ts +1 -3
  217. package/lib/typescript/module/ui/screens/index.d.ts.map +1 -1
  218. package/lib/typescript/module/ui/screens/page-unavailable-screen.d.ts +18 -0
  219. package/lib/typescript/module/ui/screens/page-unavailable-screen.d.ts.map +1 -0
  220. package/lib/typescript/module/ui/spare-link-host.d.ts +4 -5
  221. package/lib/typescript/module/ui/spare-link-host.d.ts.map +1 -1
  222. package/lib/typescript/module/ui/widgets/index.d.ts +1 -2
  223. package/lib/typescript/module/ui/widgets/index.d.ts.map +1 -1
  224. package/lib/typescript/module/version.d.ts +7 -5
  225. package/lib/typescript/module/version.d.ts.map +1 -1
  226. package/package.json +24 -23
  227. package/plugins/with-spare-link.js +6 -26
  228. package/src/core/models/index.ts +1 -139
  229. package/src/core/models/payment-return-params.ts +269 -21
  230. package/src/core/models/pending-session-record.ts +10 -0
  231. package/src/core/services/hosted-flow-controller.ts +374 -0
  232. package/src/core/services/hosted-flow-state.ts +123 -0
  233. package/src/index.ts +20 -89
  234. package/src/internal/hosted/bridge-message.ts +106 -0
  235. package/src/internal/hosted/hosted-url.ts +33 -0
  236. package/src/internal/index.ts +0 -1
  237. package/src/internal/redact-uri.ts +69 -15
  238. package/src/internal/secure-store-pending-session-store.ts +28 -49
  239. package/src/internal/url-parts.ts +134 -0
  240. package/src/public/index.ts +2 -24
  241. package/src/public/payment-result.ts +50 -12
  242. package/src/public/recovery-result.ts +16 -25
  243. package/src/public/spare-link-config.ts +56 -43
  244. package/src/public/spare-link-event.ts +33 -42
  245. package/src/public/spare-link-host-api.ts +1 -14
  246. package/src/public/spare-link-instance.ts +57 -65
  247. package/src/public/spare-link-session.ts +4 -16
  248. package/src/public/spare-link.ts +1 -1
  249. package/src/ui/hooks/use-hosted-flow-state.ts +16 -0
  250. package/src/ui/hosted/hosted-payment-page.tsx +178 -0
  251. package/src/ui/hosted/hosted-payment-webview.tsx +164 -0
  252. package/src/ui/screens/index.ts +4 -6
  253. package/src/ui/screens/page-unavailable-screen.tsx +94 -0
  254. package/src/ui/spare-link-host.tsx +227 -247
  255. package/src/ui/widgets/index.ts +1 -2
  256. package/src/version.ts +7 -5
  257. package/CHANGELOG.md +0 -66
  258. package/lib/commonjs/core/client/link-api-client.js +0 -297
  259. package/lib/commonjs/core/client/link-api-client.js.map +0 -1
  260. package/lib/commonjs/core/errors/payment-api-error.js +0 -35
  261. package/lib/commonjs/core/errors/payment-api-error.js.map +0 -1
  262. package/lib/commonjs/core/models/link-session-status.js +0 -14
  263. package/lib/commonjs/core/models/link-session-status.js.map +0 -1
  264. package/lib/commonjs/core/models/payment-type.js +0 -45
  265. package/lib/commonjs/core/models/payment-type.js.map +0 -1
  266. package/lib/commonjs/core/models/wire-mappers.js +0 -277
  267. package/lib/commonjs/core/models/wire-mappers.js.map +0 -1
  268. package/lib/commonjs/core/services/consent-presenter.js +0 -150
  269. package/lib/commonjs/core/services/consent-presenter.js.map +0 -1
  270. package/lib/commonjs/core/services/execute-resume-if-needed.js +0 -216
  271. package/lib/commonjs/core/services/execute-resume-if-needed.js.map +0 -1
  272. package/lib/commonjs/core/services/multi-payment-rules-presenter.js +0 -151
  273. package/lib/commonjs/core/services/multi-payment-rules-presenter.js.map +0 -1
  274. package/lib/commonjs/core/services/payment-flow-controller.js +0 -547
  275. package/lib/commonjs/core/services/payment-flow-controller.js.map +0 -1
  276. package/lib/commonjs/core/services/payment-flow-state.js +0 -110
  277. package/lib/commonjs/core/services/payment-flow-state.js.map +0 -1
  278. package/lib/commonjs/core/services/payment-result-mapper.js +0 -49
  279. package/lib/commonjs/core/services/payment-result-mapper.js.map +0 -1
  280. package/lib/commonjs/core/services/presentation-utils.js +0 -11
  281. package/lib/commonjs/core/services/presentation-utils.js.map +0 -1
  282. package/lib/commonjs/core/services/redirect-buffer.js +0 -40
  283. package/lib/commonjs/core/services/redirect-buffer.js.map +0 -1
  284. package/lib/commonjs/core/services/user-friendly-messages.js +0 -46
  285. package/lib/commonjs/core/services/user-friendly-messages.js.map +0 -1
  286. package/lib/commonjs/internal/telemetry-collector.js +0 -80
  287. package/lib/commonjs/internal/telemetry-collector.js.map +0 -1
  288. package/lib/commonjs/public/constants.js +0 -21
  289. package/lib/commonjs/public/constants.js.map +0 -1
  290. package/lib/commonjs/public/spare-link-callbacks.js +0 -6
  291. package/lib/commonjs/public/spare-link-callbacks.js.map +0 -1
  292. package/lib/commonjs/ui/consent/charge-bearer-display.js +0 -99
  293. package/lib/commonjs/ui/consent/charge-bearer-display.js.map +0 -1
  294. package/lib/commonjs/ui/consent/consent-accordion.js +0 -94
  295. package/lib/commonjs/ui/consent/consent-accordion.js.map +0 -1
  296. package/lib/commonjs/ui/consent/consent-summary-section.js +0 -27
  297. package/lib/commonjs/ui/consent/consent-summary-section.js.map +0 -1
  298. package/lib/commonjs/ui/consent/cop-information.js +0 -168
  299. package/lib/commonjs/ui/consent/cop-information.js.map +0 -1
  300. package/lib/commonjs/ui/consent/international-payment-summary.js +0 -98
  301. package/lib/commonjs/ui/consent/international-payment-summary.js.map +0 -1
  302. package/lib/commonjs/ui/consent/label-value-rows.js +0 -59
  303. package/lib/commonjs/ui/consent/label-value-rows.js.map +0 -1
  304. package/lib/commonjs/ui/consent/multi-payment-rules-list.js +0 -130
  305. package/lib/commonjs/ui/consent/multi-payment-rules-list.js.map +0 -1
  306. package/lib/commonjs/ui/consent/multi-payment-summary.js +0 -99
  307. package/lib/commonjs/ui/consent/multi-payment-summary.js.map +0 -1
  308. package/lib/commonjs/ui/consent/single-payment-summary.js +0 -158
  309. package/lib/commonjs/ui/consent/single-payment-summary.js.map +0 -1
  310. package/lib/commonjs/ui/consent/terms-link.js +0 -35
  311. package/lib/commonjs/ui/consent/terms-link.js.map +0 -1
  312. package/lib/commonjs/ui/hooks/use-payment-flow-state.js.map +0 -1
  313. package/lib/commonjs/ui/payment-flow-page.js +0 -235
  314. package/lib/commonjs/ui/payment-flow-page.js.map +0 -1
  315. package/lib/commonjs/ui/screens/bank-selection-screen.js +0 -215
  316. package/lib/commonjs/ui/screens/bank-selection-screen.js.map +0 -1
  317. package/lib/commonjs/ui/screens/consent-details-screen.js +0 -124
  318. package/lib/commonjs/ui/screens/consent-details-screen.js.map +0 -1
  319. package/lib/commonjs/ui/screens/mandate-setup-success-screen.js +0 -79
  320. package/lib/commonjs/ui/screens/mandate-setup-success-screen.js.map +0 -1
  321. package/lib/commonjs/ui/widgets/layout-w-header.js +0 -106
  322. package/lib/commonjs/ui/widgets/layout-w-header.js.map +0 -1
  323. package/lib/commonjs/ui/widgets/stepper.js +0 -124
  324. package/lib/commonjs/ui/widgets/stepper.js.map +0 -1
  325. package/lib/module/core/client/link-api-client.js +0 -292
  326. package/lib/module/core/client/link-api-client.js.map +0 -1
  327. package/lib/module/core/errors/payment-api-error.js +0 -29
  328. package/lib/module/core/errors/payment-api-error.js.map +0 -1
  329. package/lib/module/core/models/link-session-status.js +0 -10
  330. package/lib/module/core/models/link-session-status.js.map +0 -1
  331. package/lib/module/core/models/payment-type.js +0 -36
  332. package/lib/module/core/models/payment-type.js.map +0 -1
  333. package/lib/module/core/models/wire-mappers.js +0 -263
  334. package/lib/module/core/models/wire-mappers.js.map +0 -1
  335. package/lib/module/core/services/consent-presenter.js +0 -140
  336. package/lib/module/core/services/consent-presenter.js.map +0 -1
  337. package/lib/module/core/services/execute-resume-if-needed.js +0 -211
  338. package/lib/module/core/services/execute-resume-if-needed.js.map +0 -1
  339. package/lib/module/core/services/multi-payment-rules-presenter.js +0 -146
  340. package/lib/module/core/services/multi-payment-rules-presenter.js.map +0 -1
  341. package/lib/module/core/services/payment-flow-controller.js +0 -544
  342. package/lib/module/core/services/payment-flow-controller.js.map +0 -1
  343. package/lib/module/core/services/payment-flow-state.js +0 -106
  344. package/lib/module/core/services/payment-flow-state.js.map +0 -1
  345. package/lib/module/core/services/payment-result-mapper.js +0 -45
  346. package/lib/module/core/services/payment-result-mapper.js.map +0 -1
  347. package/lib/module/core/services/presentation-utils.js +0 -7
  348. package/lib/module/core/services/presentation-utils.js.map +0 -1
  349. package/lib/module/core/services/redirect-buffer.js +0 -33
  350. package/lib/module/core/services/redirect-buffer.js.map +0 -1
  351. package/lib/module/core/services/user-friendly-messages.js +0 -42
  352. package/lib/module/core/services/user-friendly-messages.js.map +0 -1
  353. package/lib/module/internal/telemetry-collector.js +0 -75
  354. package/lib/module/internal/telemetry-collector.js.map +0 -1
  355. package/lib/module/public/constants.js +0 -17
  356. package/lib/module/public/constants.js.map +0 -1
  357. package/lib/module/public/spare-link-callbacks.js +0 -4
  358. package/lib/module/public/spare-link-callbacks.js.map +0 -1
  359. package/lib/module/ui/consent/charge-bearer-display.js +0 -95
  360. package/lib/module/ui/consent/charge-bearer-display.js.map +0 -1
  361. package/lib/module/ui/consent/consent-accordion.js +0 -90
  362. package/lib/module/ui/consent/consent-accordion.js.map +0 -1
  363. package/lib/module/ui/consent/consent-summary-section.js +0 -23
  364. package/lib/module/ui/consent/consent-summary-section.js.map +0 -1
  365. package/lib/module/ui/consent/cop-information.js +0 -165
  366. package/lib/module/ui/consent/cop-information.js.map +0 -1
  367. package/lib/module/ui/consent/international-payment-summary.js +0 -94
  368. package/lib/module/ui/consent/international-payment-summary.js.map +0 -1
  369. package/lib/module/ui/consent/label-value-rows.js +0 -55
  370. package/lib/module/ui/consent/label-value-rows.js.map +0 -1
  371. package/lib/module/ui/consent/multi-payment-rules-list.js +0 -125
  372. package/lib/module/ui/consent/multi-payment-rules-list.js.map +0 -1
  373. package/lib/module/ui/consent/multi-payment-summary.js +0 -95
  374. package/lib/module/ui/consent/multi-payment-summary.js.map +0 -1
  375. package/lib/module/ui/consent/single-payment-summary.js +0 -154
  376. package/lib/module/ui/consent/single-payment-summary.js.map +0 -1
  377. package/lib/module/ui/consent/terms-link.js +0 -31
  378. package/lib/module/ui/consent/terms-link.js.map +0 -1
  379. package/lib/module/ui/hooks/use-payment-flow-state.js.map +0 -1
  380. package/lib/module/ui/payment-flow-page.js +0 -232
  381. package/lib/module/ui/payment-flow-page.js.map +0 -1
  382. package/lib/module/ui/screens/bank-selection-screen.js +0 -211
  383. package/lib/module/ui/screens/bank-selection-screen.js.map +0 -1
  384. package/lib/module/ui/screens/consent-details-screen.js +0 -120
  385. package/lib/module/ui/screens/consent-details-screen.js.map +0 -1
  386. package/lib/module/ui/screens/mandate-setup-success-screen.js +0 -75
  387. package/lib/module/ui/screens/mandate-setup-success-screen.js.map +0 -1
  388. package/lib/module/ui/widgets/layout-w-header.js +0 -102
  389. package/lib/module/ui/widgets/layout-w-header.js.map +0 -1
  390. package/lib/module/ui/widgets/stepper.js +0 -120
  391. package/lib/module/ui/widgets/stepper.js.map +0 -1
  392. package/lib/typescript/commonjs/core/client/link-api-client.d.ts +0 -70
  393. package/lib/typescript/commonjs/core/client/link-api-client.d.ts.map +0 -1
  394. package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts +0 -15
  395. package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts.map +0 -1
  396. package/lib/typescript/commonjs/core/models/link-session-status.d.ts +0 -6
  397. package/lib/typescript/commonjs/core/models/link-session-status.d.ts.map +0 -1
  398. package/lib/typescript/commonjs/core/models/payment-type.d.ts +0 -18
  399. package/lib/typescript/commonjs/core/models/payment-type.d.ts.map +0 -1
  400. package/lib/typescript/commonjs/core/models/wire-mappers.d.ts +0 -19
  401. package/lib/typescript/commonjs/core/models/wire-mappers.d.ts.map +0 -1
  402. package/lib/typescript/commonjs/core/services/consent-presenter.d.ts +0 -67
  403. package/lib/typescript/commonjs/core/services/consent-presenter.d.ts.map +0 -1
  404. package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts +0 -32
  405. package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts.map +0 -1
  406. package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts +0 -9
  407. package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts.map +0 -1
  408. package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts +0 -146
  409. package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts.map +0 -1
  410. package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts +0 -64
  411. package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts.map +0 -1
  412. package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts +0 -5
  413. package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts.map +0 -1
  414. package/lib/typescript/commonjs/core/services/presentation-utils.d.ts +0 -5
  415. package/lib/typescript/commonjs/core/services/presentation-utils.d.ts.map +0 -1
  416. package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts +0 -6
  417. package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts.map +0 -1
  418. package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts +0 -6
  419. package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts.map +0 -1
  420. package/lib/typescript/commonjs/internal/telemetry-collector.d.ts +0 -2
  421. package/lib/typescript/commonjs/internal/telemetry-collector.d.ts.map +0 -1
  422. package/lib/typescript/commonjs/public/constants.d.ts +0 -12
  423. package/lib/typescript/commonjs/public/constants.d.ts.map +0 -1
  424. package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts +0 -14
  425. package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts.map +0 -1
  426. package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts +0 -5
  427. package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts.map +0 -1
  428. package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts +0 -10
  429. package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts.map +0 -1
  430. package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts +0 -6
  431. package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts.map +0 -1
  432. package/lib/typescript/commonjs/ui/consent/cop-information.d.ts +0 -6
  433. package/lib/typescript/commonjs/ui/consent/cop-information.d.ts.map +0 -1
  434. package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts +0 -6
  435. package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts.map +0 -1
  436. package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts +0 -10
  437. package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts.map +0 -1
  438. package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts +0 -15
  439. package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts.map +0 -1
  440. package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts +0 -6
  441. package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts.map +0 -1
  442. package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts +0 -6
  443. package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts.map +0 -1
  444. package/lib/typescript/commonjs/ui/consent/terms-link.d.ts +0 -2
  445. package/lib/typescript/commonjs/ui/consent/terms-link.d.ts.map +0 -1
  446. package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts +0 -9
  447. package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts.map +0 -1
  448. package/lib/typescript/commonjs/ui/payment-flow-page.d.ts +0 -20
  449. package/lib/typescript/commonjs/ui/payment-flow-page.d.ts.map +0 -1
  450. package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts +0 -15
  451. package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts.map +0 -1
  452. package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts +0 -13
  453. package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts.map +0 -1
  454. package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts +0 -10
  455. package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts.map +0 -1
  456. package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts +0 -20
  457. package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts.map +0 -1
  458. package/lib/typescript/commonjs/ui/widgets/stepper.d.ts +0 -15
  459. package/lib/typescript/commonjs/ui/widgets/stepper.d.ts.map +0 -1
  460. package/lib/typescript/module/core/client/link-api-client.d.ts +0 -70
  461. package/lib/typescript/module/core/client/link-api-client.d.ts.map +0 -1
  462. package/lib/typescript/module/core/errors/payment-api-error.d.ts +0 -15
  463. package/lib/typescript/module/core/errors/payment-api-error.d.ts.map +0 -1
  464. package/lib/typescript/module/core/models/link-session-status.d.ts +0 -6
  465. package/lib/typescript/module/core/models/link-session-status.d.ts.map +0 -1
  466. package/lib/typescript/module/core/models/payment-type.d.ts +0 -18
  467. package/lib/typescript/module/core/models/payment-type.d.ts.map +0 -1
  468. package/lib/typescript/module/core/models/wire-mappers.d.ts +0 -19
  469. package/lib/typescript/module/core/models/wire-mappers.d.ts.map +0 -1
  470. package/lib/typescript/module/core/services/consent-presenter.d.ts +0 -67
  471. package/lib/typescript/module/core/services/consent-presenter.d.ts.map +0 -1
  472. package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts +0 -32
  473. package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts.map +0 -1
  474. package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts +0 -9
  475. package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts.map +0 -1
  476. package/lib/typescript/module/core/services/payment-flow-controller.d.ts +0 -146
  477. package/lib/typescript/module/core/services/payment-flow-controller.d.ts.map +0 -1
  478. package/lib/typescript/module/core/services/payment-flow-state.d.ts +0 -64
  479. package/lib/typescript/module/core/services/payment-flow-state.d.ts.map +0 -1
  480. package/lib/typescript/module/core/services/payment-result-mapper.d.ts +0 -5
  481. package/lib/typescript/module/core/services/payment-result-mapper.d.ts.map +0 -1
  482. package/lib/typescript/module/core/services/presentation-utils.d.ts +0 -5
  483. package/lib/typescript/module/core/services/presentation-utils.d.ts.map +0 -1
  484. package/lib/typescript/module/core/services/redirect-buffer.d.ts +0 -6
  485. package/lib/typescript/module/core/services/redirect-buffer.d.ts.map +0 -1
  486. package/lib/typescript/module/core/services/user-friendly-messages.d.ts +0 -6
  487. package/lib/typescript/module/core/services/user-friendly-messages.d.ts.map +0 -1
  488. package/lib/typescript/module/internal/telemetry-collector.d.ts +0 -2
  489. package/lib/typescript/module/internal/telemetry-collector.d.ts.map +0 -1
  490. package/lib/typescript/module/public/constants.d.ts +0 -12
  491. package/lib/typescript/module/public/constants.d.ts.map +0 -1
  492. package/lib/typescript/module/public/spare-link-callbacks.d.ts +0 -14
  493. package/lib/typescript/module/public/spare-link-callbacks.d.ts.map +0 -1
  494. package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts +0 -5
  495. package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts.map +0 -1
  496. package/lib/typescript/module/ui/consent/consent-accordion.d.ts +0 -10
  497. package/lib/typescript/module/ui/consent/consent-accordion.d.ts.map +0 -1
  498. package/lib/typescript/module/ui/consent/consent-summary-section.d.ts +0 -6
  499. package/lib/typescript/module/ui/consent/consent-summary-section.d.ts.map +0 -1
  500. package/lib/typescript/module/ui/consent/cop-information.d.ts +0 -6
  501. package/lib/typescript/module/ui/consent/cop-information.d.ts.map +0 -1
  502. package/lib/typescript/module/ui/consent/international-payment-summary.d.ts +0 -6
  503. package/lib/typescript/module/ui/consent/international-payment-summary.d.ts.map +0 -1
  504. package/lib/typescript/module/ui/consent/label-value-rows.d.ts +0 -10
  505. package/lib/typescript/module/ui/consent/label-value-rows.d.ts.map +0 -1
  506. package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts +0 -15
  507. package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts.map +0 -1
  508. package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts +0 -6
  509. package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts.map +0 -1
  510. package/lib/typescript/module/ui/consent/single-payment-summary.d.ts +0 -6
  511. package/lib/typescript/module/ui/consent/single-payment-summary.d.ts.map +0 -1
  512. package/lib/typescript/module/ui/consent/terms-link.d.ts +0 -2
  513. package/lib/typescript/module/ui/consent/terms-link.d.ts.map +0 -1
  514. package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts +0 -9
  515. package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts.map +0 -1
  516. package/lib/typescript/module/ui/payment-flow-page.d.ts +0 -20
  517. package/lib/typescript/module/ui/payment-flow-page.d.ts.map +0 -1
  518. package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts +0 -15
  519. package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts.map +0 -1
  520. package/lib/typescript/module/ui/screens/consent-details-screen.d.ts +0 -13
  521. package/lib/typescript/module/ui/screens/consent-details-screen.d.ts.map +0 -1
  522. package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts +0 -10
  523. package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts.map +0 -1
  524. package/lib/typescript/module/ui/widgets/layout-w-header.d.ts +0 -20
  525. package/lib/typescript/module/ui/widgets/layout-w-header.d.ts.map +0 -1
  526. package/lib/typescript/module/ui/widgets/stepper.d.ts +0 -15
  527. package/lib/typescript/module/ui/widgets/stepper.d.ts.map +0 -1
  528. package/src/core/client/link-api-client.ts +0 -414
  529. package/src/core/errors/payment-api-error.ts +0 -35
  530. package/src/core/models/link-session-status.ts +0 -7
  531. package/src/core/models/payment-type.ts +0 -54
  532. package/src/core/models/wire-mappers.ts +0 -315
  533. package/src/core/services/consent-presenter.ts +0 -213
  534. package/src/core/services/execute-resume-if-needed.ts +0 -243
  535. package/src/core/services/multi-payment-rules-presenter.ts +0 -158
  536. package/src/core/services/payment-flow-controller.ts +0 -607
  537. package/src/core/services/payment-flow-state.ts +0 -124
  538. package/src/core/services/payment-result-mapper.ts +0 -41
  539. package/src/core/services/presentation-utils.ts +0 -4
  540. package/src/core/services/redirect-buffer.ts +0 -34
  541. package/src/core/services/user-friendly-messages.ts +0 -39
  542. package/src/internal/telemetry-collector.ts +0 -90
  543. package/src/public/constants.ts +0 -14
  544. package/src/public/spare-link-callbacks.ts +0 -20
  545. package/src/ui/consent/charge-bearer-display.tsx +0 -68
  546. package/src/ui/consent/consent-accordion.tsx +0 -89
  547. package/src/ui/consent/consent-summary-section.tsx +0 -19
  548. package/src/ui/consent/cop-information.tsx +0 -121
  549. package/src/ui/consent/international-payment-summary.tsx +0 -83
  550. package/src/ui/consent/label-value-rows.tsx +0 -50
  551. package/src/ui/consent/multi-payment-rules-list.tsx +0 -138
  552. package/src/ui/consent/multi-payment-summary.tsx +0 -82
  553. package/src/ui/consent/single-payment-summary.tsx +0 -123
  554. package/src/ui/consent/terms-link.tsx +0 -27
  555. package/src/ui/hooks/use-payment-flow-state.ts +0 -16
  556. package/src/ui/payment-flow-page.tsx +0 -254
  557. package/src/ui/screens/bank-selection-screen.tsx +0 -209
  558. package/src/ui/screens/consent-details-screen.tsx +0 -106
  559. package/src/ui/screens/mandate-setup-success-screen.tsx +0 -72
  560. package/src/ui/widgets/layout-w-header.tsx +0 -89
  561. package/src/ui/widgets/stepper.tsx +0 -126
@@ -1,216 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MAX_RECOVERABLE_AGE_MS = void 0;
7
- exports.executeResumeIfNeeded = executeResumeIfNeeded;
8
- var _constants = require("../../public/constants.js");
9
- var _paymentResult = require("../../public/payment-result.js");
10
- var _spareLinkConfig = require("../../public/spare-link-config.js");
11
- var _linkApiClient = require("../client/link-api-client.js");
12
- var _paymentFlowController = require("./payment-flow-controller.js");
13
- var _paymentResultMapper = require("./payment-result-mapper.js");
14
- var _redirectBuffer = require("./redirect-buffer.js");
15
- const MAX_RECOVERABLE_AGE_MS = exports.MAX_RECOVERABLE_AGE_MS = 30 * 60 * 1000;
16
- function merchantRefFromUri(uri) {
17
- try {
18
- const value = new URL(uri).searchParams.get('merchantRef');
19
- return value && value.length > 0 ? value : undefined;
20
- } catch {
21
- return undefined;
22
- }
23
- }
24
-
25
- /**
26
- * Requires a positive `merchantRef` bind between the buffered URI and the
27
- * pending record — if either side lacks one we can't confirm the URI belongs
28
- * to this session, so it must not be applied (a stale/unbound URI could
29
- * otherwise attach to the wrong pending session).
30
- */
31
- function bufferedUriMatchesRecord(uri, record) {
32
- const uriMerchantRef = merchantRefFromUri(uri);
33
- if (!record.merchantRef || !uriMerchantRef) return false;
34
- return record.merchantRef === uriMerchantRef;
35
- }
36
- function createResumeApiClient(config) {
37
- return new _linkApiClient.LinkApiClient({
38
- baseUrl: config.baseUrl ?? (0, _spareLinkConfig.defaultBaseUrlFor)(config.environment),
39
- tenant: (0, _spareLinkConfig.tenantCountryCode)(config.tenant),
40
- ...(config.fetch ? {
41
- fetch: config.fetch
42
- } : {}),
43
- ...(config.requestTimeoutMs !== undefined ? {
44
- requestTimeoutMs: config.requestTimeoutMs
45
- } : {})
46
- });
47
- }
48
- function createRecoveryController(record, config, store, callbacks) {
49
- return new _paymentFlowController.PaymentFlowController({
50
- sessionToken: record.sessionId,
51
- environment: config.environment,
52
- apiClient: createResumeApiClient(config),
53
- pendingSessionStore: store,
54
- ...(callbacks?.onEvent ? {
55
- onEvent: callbacks.onEvent
56
- } : {})
57
- });
58
- }
59
- async function terminalFromBufferedUri(record, config, store, bufferedUri, callbacks) {
60
- const controller = createRecoveryController(record, config, store, callbacks);
61
- try {
62
- controller.handleCallback(bufferedUri);
63
- const result = (0, _paymentResultMapper.paymentResultFromFlowState)(controller.state, record.sessionId, record.selectedBankId);
64
- if (result && (controller.state.phase === 'succeeded' || controller.state.phase === 'failed' || controller.state.phase === 'cancelled')) {
65
- await store.clear();
66
- return result;
67
- }
68
- return null;
69
- } finally {
70
- controller.dispose();
71
- }
72
- }
73
-
74
- /**
75
- * Cold-start recovery orchestrator — mirrors Flutter `SpareLink.resumeIfNeeded`.
76
- * Returns a terminal {@link PaymentResult}, `null` when nothing to do / still
77
- * pending, and opens the recovery UI via `openRecoveryFlow` for non-terminal
78
- * sessions that need user-visible awaiting state.
79
- */
80
- async function executeResumeIfNeeded(args, deps) {
81
- const {
82
- pendingSessionStore: store
83
- } = deps;
84
- const now = deps.now ?? (() => Date.now());
85
- if (deps.isFlowActive()) return null;
86
- let record;
87
- try {
88
- record = await store.load();
89
- } catch {
90
- return null;
91
- }
92
- if (!record) return null;
93
- if (record.consentAt !== undefined && now() - record.consentAt > MAX_RECOVERABLE_AGE_MS) {
94
- await store.clear();
95
- return (0, _paymentResult.paymentFailed)({
96
- linkToken: record.sessionId,
97
- errorCode: 'session_expired',
98
- message: 'Pending session is older than the recovery window.',
99
- resolvedAtMs: now()
100
- });
101
- }
102
- if (record.recoveryAttempts >= _constants.kMaxRecoveryAttempts) {
103
- await store.clear();
104
- return (0, _paymentResult.paymentFailed)({
105
- linkToken: record.sessionId,
106
- errorCode: 'recovery_exhausted',
107
- message: 'Maximum recovery attempts reached.',
108
- resolvedAtMs: now()
109
- });
110
- }
111
-
112
- // Peek first — only consume the buffered URI once we've positively bound it
113
- // to this record. On mismatch, leave it alone so a genuinely-matching
114
- // session (checked on a later resume attempt) can still claim it.
115
- const bufferedUri = (0, _redirectBuffer.peekBufferedRedirect)();
116
- if (bufferedUri && bufferedUriMatchesRecord(bufferedUri, record)) {
117
- (0, _redirectBuffer.consumeBufferedRedirect)();
118
- return terminalFromBufferedUri(record, args.config, store, bufferedUri, args.callbacks);
119
- }
120
- const apiClient = createResumeApiClient(args.config);
121
- try {
122
- const status = await apiClient.getStatus(record.sessionId);
123
- await store.save({
124
- ...record,
125
- recoveryAttempts: record.recoveryAttempts + 1
126
- });
127
- switch (status.status) {
128
- case 'completed':
129
- await store.clear();
130
- return (0, _paymentResult.paymentSuccess)({
131
- linkToken: record.sessionId,
132
- bankId: record.selectedBankId,
133
- ...(status.linkSessionId ? {
134
- linkSessionId: status.linkSessionId
135
- } : {}),
136
- resolvedAtMs: now()
137
- });
138
- case 'failed':
139
- await store.clear();
140
- return (0, _paymentResult.paymentFailed)({
141
- linkToken: record.sessionId,
142
- errorCode: status.failureCode ?? 'session_failed',
143
- resolvedAtMs: now()
144
- });
145
- case 'cancelled':
146
- await store.clear();
147
- return (0, _paymentResult.paymentCancelled)({
148
- linkToken: record.sessionId,
149
- bankId: record.selectedBankId,
150
- resolvedAtMs: now()
151
- });
152
- case 'expired':
153
- await store.clear();
154
- return (0, _paymentResult.paymentFailed)({
155
- linkToken: record.sessionId,
156
- errorCode: 'session_expired',
157
- resolvedAtMs: now()
158
- });
159
- default:
160
- {
161
- const controller = createRecoveryController(record, args.config, store, args.callbacks);
162
- // Hydrate so `state.session` (payment type, mandate details) is
163
- // available to the recovery UI and threaded into the terminal
164
- // PaymentResult — without this, resume paths skip the mandate
165
- // setup-success screen and drop `paymentType` on success.
166
- await controller.hydrate().catch(() => {
167
- /* best-effort — recovery still proceeds without session details */
168
- });
169
- controller.setAwaitingCallbackState({
170
- providerName: record.selectedBankId
171
- });
172
- deps.openRecoveryFlow({
173
- controller,
174
- config: {
175
- ...args.config,
176
- linkToken: record.sessionId
177
- },
178
- ...(args.callbacks ? {
179
- callbacks: args.callbacks
180
- } : {})
181
- });
182
- return null;
183
- }
184
- }
185
- } catch {
186
- const controller = createRecoveryController(record, args.config, store, args.callbacks);
187
- await controller.hydrate().catch(() => {
188
- /* best-effort — recovery still proceeds without session details */
189
- });
190
- controller.setAwaitingCallbackState({
191
- providerName: record.selectedBankId
192
- });
193
- try {
194
- await store.save({
195
- ...record,
196
- recoveryAttempts: record.recoveryAttempts + 1
197
- });
198
- } catch {
199
- /* swallow */
200
- }
201
- deps.openRecoveryFlow({
202
- controller,
203
- config: {
204
- ...args.config,
205
- linkToken: record.sessionId
206
- },
207
- ...(args.callbacks ? {
208
- callbacks: args.callbacks
209
- } : {})
210
- });
211
- return null;
212
- } finally {
213
- apiClient.dispose();
214
- }
215
- }
216
- //# sourceMappingURL=execute-resume-if-needed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_constants","require","_paymentResult","_spareLinkConfig","_linkApiClient","_paymentFlowController","_paymentResultMapper","_redirectBuffer","MAX_RECOVERABLE_AGE_MS","exports","merchantRefFromUri","uri","value","URL","searchParams","get","length","undefined","bufferedUriMatchesRecord","record","uriMerchantRef","merchantRef","createResumeApiClient","config","LinkApiClient","baseUrl","defaultBaseUrlFor","environment","tenant","tenantCountryCode","fetch","requestTimeoutMs","createRecoveryController","store","callbacks","PaymentFlowController","sessionToken","sessionId","apiClient","pendingSessionStore","onEvent","terminalFromBufferedUri","bufferedUri","controller","handleCallback","result","paymentResultFromFlowState","state","selectedBankId","phase","clear","dispose","executeResumeIfNeeded","args","deps","now","Date","isFlowActive","load","consentAt","paymentFailed","linkToken","errorCode","message","resolvedAtMs","recoveryAttempts","kMaxRecoveryAttempts","peekBufferedRedirect","consumeBufferedRedirect","status","getStatus","save","paymentSuccess","bankId","linkSessionId","failureCode","paymentCancelled","hydrate","catch","setAwaitingCallbackState","providerName","openRecoveryFlow"],"sourceRoot":"../../../../src","sources":["core/services/execute-resume-if-needed.ts"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAEA,IAAAM,eAAA,GAAAN,OAAA;AAEO,MAAMO,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAoBpD,SAASE,kBAAkBA,CAACC,GAAW,EAAsB;EAC3D,IAAI;IACF,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAACF,GAAG,CAAC,CAACG,YAAY,CAACC,GAAG,CAAC,aAAa,CAAC;IAC1D,OAAOH,KAAK,IAAIA,KAAK,CAACI,MAAM,GAAG,CAAC,GAAGJ,KAAK,GAAGK,SAAS;EACtD,CAAC,CAAC,MAAM;IACN,OAAOA,S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,CAACa,OAAO,CAAC,CAAC;EACrB;AACF","ignoreList":[]}
@@ -1,151 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.buildMultiPaymentRules = buildMultiPaymentRules;
7
- exports.rulesSectionTitle = rulesSectionTitle;
8
- var _paymentType = require("../models/payment-type.js");
9
- var _presentationUtils = require("./presentation-utils.js");
10
- function present(value, fallback = '—') {
11
- const v = value?.trim();
12
- return v ? v : fallback;
13
- }
14
- function presentInt(value, fallback = '—') {
15
- if (value === undefined) return fallback;
16
- return String(value);
17
- }
18
- function formatDate(raw) {
19
- if (!raw?.trim()) return '—';
20
- const parsed = new Date(raw.trim());
21
- if (Number.isNaN(parsed.getTime())) return raw.trim();
22
- const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
23
- const day = String(parsed.getUTCDate()).padStart(2, '0');
24
- const month = months[parsed.getUTCMonth()];
25
- return `${day} ${month} ${parsed.getUTCFullYear()}`;
26
- }
27
- function definedSchedule(type, instructions) {
28
- const isFixed = type === _paymentType.PaymentType.fixedDefinedSchedule;
29
- const amountLabel = isFixed ? 'Amount' : 'Max Amount';
30
- const schedule = instructions.paymentSchedule ?? [];
31
- const rows = [];
32
- for (const entry of schedule) {
33
- const amountDto = isFixed ? entry.amount : entry.maxAmount;
34
- rows.push({
35
- label: amountLabel,
36
- value: (0, _presentationUtils.formatAmount)(amountDto)
37
- });
38
- rows.push({
39
- label: 'Date',
40
- value: formatDate(entry.paymentExecutionDate)
41
- });
42
- }
43
- return rows;
44
- }
45
- function periodicSchedule(type, instructions) {
46
- const isFixed = type === _paymentType.PaymentType.fixedPeriodicSchedule;
47
- const periodic = instructions.periodicSchedule;
48
- const amountDto = isFixed ? periodic?.amount : periodic?.maxAmount;
49
- const amountLabel = isFixed ? 'Amount' : 'Max per Payment';
50
- const rows = [{
51
- label: amountLabel,
52
- value: (0, _presentationUtils.formatAmount)(amountDto)
53
- }, {
54
- label: 'First Payment Date',
55
- value: formatDate(periodic?.startDate)
56
- }, {
57
- label: 'Payment repeats every',
58
- value: present(periodic?.frequency)
59
- }, {
60
- label: 'Stop payment on',
61
- value: formatDate(periodic?.endDate)
62
- }, {
63
- label: 'Total number of payments',
64
- value: presentInt(instructions.maxCumulativeNumberOfPayments)
65
- }];
66
- if (!isFixed) {
67
- rows.push({
68
- label: 'Total Value Allowed',
69
- value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
70
- });
71
- }
72
- return rows;
73
- }
74
- function fixedOnDemand(instructions) {
75
- const periodic = instructions.periodicSchedule;
76
- const frequency = periodic?.frequency;
77
- return [{
78
- label: 'Amount',
79
- value: (0, _presentationUtils.formatAmount)(periodic?.amount)
80
- }, {
81
- label: 'Total number of payments allowed',
82
- value: presentInt(instructions.maxCumulativeNumberOfPayments)
83
- }, {
84
- label: 'Total Value Allowed',
85
- value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
86
- }, {
87
- label: 'Limits Every',
88
- value: present(frequency)
89
- }, {
90
- label: `Max Value per ${present(frequency)}`,
91
- value: (0, _presentationUtils.formatAmount)(periodic?.controls?.maxCumulativeAmountPerPeriod)
92
- }, {
93
- label: `Max Payments per ${present(frequency)}`,
94
- value: presentInt(periodic?.controls?.maxCumulativeNumberOfPaymentsPerPeriod)
95
- }, {
96
- label: 'Expiry Date',
97
- value: formatDate(periodic?.endDate)
98
- }];
99
- }
100
- function variableOnDemand(instructions) {
101
- const periodic = instructions.periodicSchedule;
102
- const frequency = periodic?.frequency;
103
- return [{
104
- label: 'First Payment Date',
105
- value: formatDate(periodic?.startDate)
106
- }, {
107
- label: 'Expiry Date',
108
- value: formatDate(periodic?.endDate)
109
- }, {
110
- label: 'Max per Payment',
111
- value: (0, _presentationUtils.formatAmount)(periodic?.maxAmount)
112
- }, {
113
- label: 'Total number of payments allowed',
114
- value: presentInt(instructions.maxCumulativeNumberOfPayments)
115
- }, {
116
- label: 'Total Value Allowed',
117
- value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
118
- }, {
119
- label: 'Limits Every',
120
- value: present(frequency)
121
- }, {
122
- label: `Max Value per ${present(frequency)}`,
123
- value: (0, _presentationUtils.formatAmount)(periodic?.controls?.maxCumulativeAmountPerPeriod)
124
- }, {
125
- label: `Max Payments per ${present(frequency)}`,
126
- value: presentInt(periodic?.controls?.maxCumulativeNumberOfPaymentsPerPeriod)
127
- }];
128
- }
129
- function buildMultiPaymentRules(type, instructions) {
130
- switch (type) {
131
- case _paymentType.PaymentType.fixedDefinedSchedule:
132
- case _paymentType.PaymentType.variableDefinedSchedule:
133
- return definedSchedule(type, instructions);
134
- case _paymentType.PaymentType.fixedPeriodicSchedule:
135
- case _paymentType.PaymentType.variablePeriodicSchedule:
136
- return periodicSchedule(type, instructions);
137
- case _paymentType.PaymentType.fixedOnDemand:
138
- return fixedOnDemand(instructions);
139
- case _paymentType.PaymentType.variableOnDemand:
140
- return variableOnDemand(instructions);
141
- default:
142
- return [];
143
- }
144
- }
145
- function rulesSectionTitle(type) {
146
- if (type === _paymentType.PaymentType.fixedDefinedSchedule || type === _paymentType.PaymentType.variableDefinedSchedule) {
147
- return 'Payment schedule';
148
- }
149
- return 'Payment rules';
150
- }
151
- //# sourceMappingURL=multi-payment-rules-presenter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_paymentType","require","_presentationUtils","present","value","fallback","v","trim","presentInt","undefined","String","formatDate","raw","parsed","Date","Number","isNaN","getTime","months","day","getUTCDate","padStart","month","getUTCMonth","getUTCFullYear","definedSchedule","type","instructions","isFixed","PaymentType","fixedDefinedSchedule","amountLabel","schedule","paymentSchedule","rows","entry","amountDto","amount","maxAmount","push","label","formatAmount","paymentExecutionDate","periodicSchedule","fixedPeriodicSchedule","periodic","startDate","frequency","endDate","maxCumulativeNumberOfPayments","maxCumulativeAmount","fixedOnDemand","controls","maxCumulativeAmountPerPeriod","maxCumulativeNumberOfPaymentsPerPeriod","variableOnDemand","buildMultiPaymentRules","variableDefinedSchedule","variablePeriodicSchedule","rulesSectionTitle"],"sourceRoot":"../../../../src","sources":["core/services/multi-payment-rules-presenter.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAOA,SAASE,OAAOA,CAACC,KAAyB,EAAEC,QAAQ,GAAG,GAAG,EAAU;EAClE,MAAMC,CAAC,GAAGF,KAAK,EAAEG,IAAI,CAAC,CAAC;EACvB,OAAOD,CAAC,GAAGA,CAAC,GAAGD,QAAQ;AACzB;AAEA,SAASG,UAAUA,CAACJ,KAAyB,EAAEC,QAAQ,GAAG,GAAG,EAAU;EACrE,IAAID,KAAK,KAAKK,SAAS,EAAE,OAAOJ,QAAQ;EACxC,OAAOK,MAAM,CAACN,KAAK,CAAC;AACtB;AAEA,SAASO,UAAUA,CAACC,GAAuB,EAAU;EACnD,IAAI,CAACA,GAAG,EAAEL,IAAI,CAAC,CAAC,EAAE,OAAO,GAAG;EAC5B,MAAMM,MAAM,GAAG,IAAIC,IAAI,CAACF,GAAG,CAACL,IAAI,CAAC,CAAC,CAAC;EACnC,IAAIQ,MAAM,CAACC,KAAK,CAACH,MAAM,CAACI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAOL,GAAG,CAACL,IAAI,CAAC,CAAC;EACrD,MAAMW,MAAM,GAAG,CACb,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;EACD,MAAMC,GAAG,GAAGT,MAAM,CAACG,MAAM,CAACO,UAAU,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EACxD,MAAMC,KAAK,GAAGJ,MAAM,CAACL,MAAM,CAACU,WAAW,CAAC,CAAC,CAAC;EAC1C,OAAO,GAAGJ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