@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.
- package/README.md +119 -81
- package/lib/commonjs/core/models/payment-return-params.js +245 -20
- package/lib/commonjs/core/models/payment-return-params.js.map +1 -1
- package/lib/commonjs/core/models/pending-session-record.js +2 -0
- package/lib/commonjs/core/models/pending-session-record.js.map +1 -0
- package/lib/commonjs/core/services/hosted-flow-controller.js +333 -0
- package/lib/commonjs/core/services/hosted-flow-controller.js.map +1 -0
- package/lib/commonjs/core/services/hosted-flow-state.js +96 -0
- package/lib/commonjs/core/services/hosted-flow-state.js.map +1 -0
- package/lib/commonjs/index.js +42 -164
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/hosted/bridge-message.js +107 -0
- package/lib/commonjs/internal/hosted/bridge-message.js.map +1 -0
- package/lib/commonjs/internal/hosted/hosted-url.js +41 -0
- package/lib/commonjs/internal/hosted/hosted-url.js.map +1 -0
- package/lib/commonjs/internal/index.js +0 -7
- package/lib/commonjs/internal/index.js.map +1 -1
- package/lib/commonjs/internal/redact-uri.js +59 -15
- package/lib/commonjs/internal/redact-uri.js.map +1 -1
- package/lib/commonjs/internal/secure-store-pending-session-store.js +20 -25
- package/lib/commonjs/internal/secure-store-pending-session-store.js.map +1 -1
- package/lib/commonjs/internal/url-parts.js +145 -0
- package/lib/commonjs/internal/url-parts.js.map +1 -0
- package/lib/commonjs/public/index.js +0 -37
- package/lib/commonjs/public/index.js.map +1 -1
- package/lib/commonjs/public/payment-result.js +16 -4
- package/lib/commonjs/public/payment-result.js.map +1 -1
- package/lib/commonjs/public/recovery-result.js +7 -18
- package/lib/commonjs/public/recovery-result.js.map +1 -1
- package/lib/commonjs/public/spare-link-config.js +41 -16
- package/lib/commonjs/public/spare-link-config.js.map +1 -1
- package/lib/commonjs/public/spare-link-event.js +27 -33
- package/lib/commonjs/public/spare-link-event.js.map +1 -1
- package/lib/commonjs/public/spare-link-instance.js +67 -77
- package/lib/commonjs/public/spare-link-instance.js.map +1 -1
- package/lib/commonjs/public/spare-link-session.js +2 -9
- package/lib/commonjs/public/spare-link-session.js.map +1 -1
- package/lib/commonjs/public/spare-link.js +0 -12
- package/lib/commonjs/public/spare-link.js.map +1 -1
- package/lib/commonjs/ui/hooks/{use-payment-flow-state.js → use-hosted-flow-state.js} +4 -4
- package/lib/commonjs/ui/hooks/use-hosted-flow-state.js.map +1 -0
- package/lib/commonjs/ui/hosted/hosted-payment-page.js +177 -0
- package/lib/commonjs/ui/hosted/hosted-payment-page.js.map +1 -0
- package/lib/commonjs/ui/hosted/hosted-payment-webview.js +168 -0
- package/lib/commonjs/ui/hosted/hosted-payment-webview.js.map +1 -0
- package/lib/commonjs/ui/screens/index.js +3 -17
- package/lib/commonjs/ui/screens/index.js.map +1 -1
- package/lib/commonjs/ui/screens/page-unavailable-screen.js +101 -0
- package/lib/commonjs/ui/screens/page-unavailable-screen.js.map +1 -0
- package/lib/commonjs/ui/spare-link-host.js +220 -234
- package/lib/commonjs/ui/spare-link-host.js.map +1 -1
- package/lib/commonjs/ui/widgets/index.js +3 -10
- package/lib/commonjs/ui/widgets/index.js.map +1 -1
- package/lib/commonjs/version.js +7 -5
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/core/models/payment-return-params.js +235 -20
- package/lib/module/core/models/payment-return-params.js.map +1 -1
- package/lib/module/core/models/pending-session-record.js +2 -0
- package/lib/module/core/models/pending-session-record.js.map +1 -0
- package/lib/module/core/services/hosted-flow-controller.js +328 -0
- package/lib/module/core/services/hosted-flow-controller.js.map +1 -0
- package/lib/module/core/services/hosted-flow-state.js +91 -0
- package/lib/module/core/services/hosted-flow-state.js.map +1 -0
- package/lib/module/index.js +8 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/hosted/bridge-message.js +104 -0
- package/lib/module/internal/hosted/bridge-message.js.map +1 -0
- package/lib/module/internal/hosted/hosted-url.js +36 -0
- package/lib/module/internal/hosted/hosted-url.js.map +1 -0
- package/lib/module/internal/index.js +0 -1
- package/lib/module/internal/index.js.map +1 -1
- package/lib/module/internal/redact-uri.js +59 -15
- package/lib/module/internal/redact-uri.js.map +1 -1
- package/lib/module/internal/secure-store-pending-session-store.js +20 -25
- package/lib/module/internal/secure-store-pending-session-store.js.map +1 -1
- package/lib/module/internal/url-parts.js +139 -0
- package/lib/module/internal/url-parts.js.map +1 -0
- package/lib/module/public/index.js +2 -3
- package/lib/module/public/index.js.map +1 -1
- package/lib/module/public/payment-result.js +16 -4
- package/lib/module/public/payment-result.js.map +1 -1
- package/lib/module/public/recovery-result.js +7 -17
- package/lib/module/public/recovery-result.js.map +1 -1
- package/lib/module/public/spare-link-config.js +42 -15
- package/lib/module/public/spare-link-config.js.map +1 -1
- package/lib/module/public/spare-link-event.js +27 -33
- package/lib/module/public/spare-link-event.js.map +1 -1
- package/lib/module/public/spare-link-instance.js +68 -72
- package/lib/module/public/spare-link-instance.js.map +1 -1
- package/lib/module/public/spare-link-session.js +2 -9
- package/lib/module/public/spare-link-session.js.map +1 -1
- package/lib/module/public/spare-link.js +1 -1
- package/lib/module/public/spare-link.js.map +1 -1
- package/lib/module/ui/hooks/{use-payment-flow-state.js → use-hosted-flow-state.js} +3 -3
- package/lib/module/ui/hooks/use-hosted-flow-state.js.map +1 -0
- package/lib/module/ui/hosted/hosted-payment-page.js +175 -0
- package/lib/module/ui/hosted/hosted-payment-page.js.map +1 -0
- package/lib/module/ui/hosted/hosted-payment-webview.js +163 -0
- package/lib/module/ui/hosted/hosted-payment-webview.js.map +1 -0
- package/lib/module/ui/screens/index.js +1 -3
- package/lib/module/ui/screens/index.js.map +1 -1
- package/lib/module/ui/screens/page-unavailable-screen.js +97 -0
- package/lib/module/ui/screens/page-unavailable-screen.js.map +1 -0
- package/lib/module/ui/spare-link-host.js +221 -236
- package/lib/module/ui/spare-link-host.js.map +1 -1
- package/lib/module/ui/widgets/index.js +1 -2
- package/lib/module/ui/widgets/index.js.map +1 -1
- package/lib/module/version.js +7 -5
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/commonjs/core/models/index.d.ts +1 -123
- package/lib/typescript/commonjs/core/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts +91 -8
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/core/models/pending-session-record.d.ts +11 -0
- package/lib/typescript/commonjs/core/models/pending-session-record.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/hosted-flow-controller.d.ts +119 -0
- package/lib/typescript/commonjs/core/services/hosted-flow-controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/hosted-flow-state.d.ts +75 -0
- package/lib/typescript/commonjs/core/services/hosted-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +5 -14
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/hosted/bridge-message.d.ts +44 -0
- package/lib/typescript/commonjs/internal/hosted/bridge-message.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/hosted/hosted-url.d.ts +30 -0
- package/lib/typescript/commonjs/internal/hosted/hosted-url.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/index.d.ts +0 -1
- package/lib/typescript/commonjs/internal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/redact-uri.d.ts +21 -1
- package/lib/typescript/commonjs/internal/redact-uri.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts +3 -2
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/url-parts.d.ts +46 -0
- package/lib/typescript/commonjs/internal/url-parts.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/index.d.ts +4 -6
- package/lib/typescript/commonjs/public/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/payment-result.d.ts +50 -12
- package/lib/typescript/commonjs/public/payment-result.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/recovery-result.d.ts +11 -20
- package/lib/typescript/commonjs/public/recovery-result.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link-config.d.ts +13 -31
- package/lib/typescript/commonjs/public/spare-link-config.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link-event.d.ts +29 -31
- package/lib/typescript/commonjs/public/spare-link-event.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts +1 -12
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts +26 -20
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link-session.d.ts +3 -8
- package/lib/typescript/commonjs/public/spare-link-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/public/spare-link.d.ts +1 -1
- package/lib/typescript/commonjs/public/spare-link.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/use-hosted-flow-state.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/use-hosted-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hosted/hosted-payment-page.d.ts +17 -0
- package/lib/typescript/commonjs/ui/hosted/hosted-payment-page.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hosted/hosted-payment-webview.d.ts +43 -0
- package/lib/typescript/commonjs/ui/hosted/hosted-payment-webview.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts +1 -3
- package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/page-unavailable-screen.d.ts +18 -0
- package/lib/typescript/commonjs/ui/screens/page-unavailable-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts +4 -5
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/widgets/index.d.ts +1 -2
- package/lib/typescript/commonjs/ui/widgets/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/version.d.ts +7 -5
- package/lib/typescript/commonjs/version.d.ts.map +1 -1
- package/lib/typescript/module/core/models/index.d.ts +1 -123
- package/lib/typescript/module/core/models/index.d.ts.map +1 -1
- package/lib/typescript/module/core/models/payment-return-params.d.ts +91 -8
- package/lib/typescript/module/core/models/payment-return-params.d.ts.map +1 -1
- package/lib/typescript/module/core/models/pending-session-record.d.ts +11 -0
- package/lib/typescript/module/core/models/pending-session-record.d.ts.map +1 -0
- package/lib/typescript/module/core/services/hosted-flow-controller.d.ts +119 -0
- package/lib/typescript/module/core/services/hosted-flow-controller.d.ts.map +1 -0
- package/lib/typescript/module/core/services/hosted-flow-state.d.ts +75 -0
- package/lib/typescript/module/core/services/hosted-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +5 -14
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/internal/hosted/bridge-message.d.ts +44 -0
- package/lib/typescript/module/internal/hosted/bridge-message.d.ts.map +1 -0
- package/lib/typescript/module/internal/hosted/hosted-url.d.ts +30 -0
- package/lib/typescript/module/internal/hosted/hosted-url.d.ts.map +1 -0
- package/lib/typescript/module/internal/index.d.ts +0 -1
- package/lib/typescript/module/internal/index.d.ts.map +1 -1
- package/lib/typescript/module/internal/redact-uri.d.ts +21 -1
- package/lib/typescript/module/internal/redact-uri.d.ts.map +1 -1
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts +3 -2
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts.map +1 -1
- package/lib/typescript/module/internal/url-parts.d.ts +46 -0
- package/lib/typescript/module/internal/url-parts.d.ts.map +1 -0
- package/lib/typescript/module/public/index.d.ts +4 -6
- package/lib/typescript/module/public/index.d.ts.map +1 -1
- package/lib/typescript/module/public/payment-result.d.ts +50 -12
- package/lib/typescript/module/public/payment-result.d.ts.map +1 -1
- package/lib/typescript/module/public/recovery-result.d.ts +11 -20
- package/lib/typescript/module/public/recovery-result.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link-config.d.ts +13 -31
- package/lib/typescript/module/public/spare-link-config.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link-event.d.ts +29 -31
- package/lib/typescript/module/public/spare-link-event.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link-host-api.d.ts +1 -12
- package/lib/typescript/module/public/spare-link-host-api.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link-instance.d.ts +26 -20
- package/lib/typescript/module/public/spare-link-instance.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link-session.d.ts +3 -8
- package/lib/typescript/module/public/spare-link-session.d.ts.map +1 -1
- package/lib/typescript/module/public/spare-link.d.ts +1 -1
- package/lib/typescript/module/public/spare-link.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/use-hosted-flow-state.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/use-hosted-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/ui/hosted/hosted-payment-page.d.ts +17 -0
- package/lib/typescript/module/ui/hosted/hosted-payment-page.d.ts.map +1 -0
- package/lib/typescript/module/ui/hosted/hosted-payment-webview.d.ts +43 -0
- package/lib/typescript/module/ui/hosted/hosted-payment-webview.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/index.d.ts +1 -3
- package/lib/typescript/module/ui/screens/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/page-unavailable-screen.d.ts +18 -0
- package/lib/typescript/module/ui/screens/page-unavailable-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/spare-link-host.d.ts +4 -5
- package/lib/typescript/module/ui/spare-link-host.d.ts.map +1 -1
- package/lib/typescript/module/ui/widgets/index.d.ts +1 -2
- package/lib/typescript/module/ui/widgets/index.d.ts.map +1 -1
- package/lib/typescript/module/version.d.ts +7 -5
- package/lib/typescript/module/version.d.ts.map +1 -1
- package/package.json +24 -23
- package/plugins/with-spare-link.js +6 -26
- package/src/core/models/index.ts +1 -139
- package/src/core/models/payment-return-params.ts +269 -21
- package/src/core/models/pending-session-record.ts +10 -0
- package/src/core/services/hosted-flow-controller.ts +374 -0
- package/src/core/services/hosted-flow-state.ts +123 -0
- package/src/index.ts +20 -89
- package/src/internal/hosted/bridge-message.ts +106 -0
- package/src/internal/hosted/hosted-url.ts +33 -0
- package/src/internal/index.ts +0 -1
- package/src/internal/redact-uri.ts +69 -15
- package/src/internal/secure-store-pending-session-store.ts +28 -49
- package/src/internal/url-parts.ts +134 -0
- package/src/public/index.ts +2 -24
- package/src/public/payment-result.ts +50 -12
- package/src/public/recovery-result.ts +16 -25
- package/src/public/spare-link-config.ts +56 -43
- package/src/public/spare-link-event.ts +33 -42
- package/src/public/spare-link-host-api.ts +1 -14
- package/src/public/spare-link-instance.ts +57 -65
- package/src/public/spare-link-session.ts +4 -16
- package/src/public/spare-link.ts +1 -1
- package/src/ui/hooks/use-hosted-flow-state.ts +16 -0
- package/src/ui/hosted/hosted-payment-page.tsx +178 -0
- package/src/ui/hosted/hosted-payment-webview.tsx +164 -0
- package/src/ui/screens/index.ts +4 -6
- package/src/ui/screens/page-unavailable-screen.tsx +94 -0
- package/src/ui/spare-link-host.tsx +227 -247
- package/src/ui/widgets/index.ts +1 -2
- package/src/version.ts +7 -5
- package/CHANGELOG.md +0 -66
- package/lib/commonjs/core/client/link-api-client.js +0 -297
- package/lib/commonjs/core/client/link-api-client.js.map +0 -1
- package/lib/commonjs/core/errors/payment-api-error.js +0 -35
- package/lib/commonjs/core/errors/payment-api-error.js.map +0 -1
- package/lib/commonjs/core/models/link-session-status.js +0 -14
- package/lib/commonjs/core/models/link-session-status.js.map +0 -1
- package/lib/commonjs/core/models/payment-type.js +0 -45
- package/lib/commonjs/core/models/payment-type.js.map +0 -1
- package/lib/commonjs/core/models/wire-mappers.js +0 -277
- package/lib/commonjs/core/models/wire-mappers.js.map +0 -1
- package/lib/commonjs/core/services/consent-presenter.js +0 -150
- package/lib/commonjs/core/services/consent-presenter.js.map +0 -1
- package/lib/commonjs/core/services/execute-resume-if-needed.js +0 -216
- package/lib/commonjs/core/services/execute-resume-if-needed.js.map +0 -1
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js +0 -151
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js.map +0 -1
- package/lib/commonjs/core/services/payment-flow-controller.js +0 -547
- package/lib/commonjs/core/services/payment-flow-controller.js.map +0 -1
- package/lib/commonjs/core/services/payment-flow-state.js +0 -110
- package/lib/commonjs/core/services/payment-flow-state.js.map +0 -1
- package/lib/commonjs/core/services/payment-result-mapper.js +0 -49
- package/lib/commonjs/core/services/payment-result-mapper.js.map +0 -1
- package/lib/commonjs/core/services/presentation-utils.js +0 -11
- package/lib/commonjs/core/services/presentation-utils.js.map +0 -1
- package/lib/commonjs/core/services/redirect-buffer.js +0 -40
- package/lib/commonjs/core/services/redirect-buffer.js.map +0 -1
- package/lib/commonjs/core/services/user-friendly-messages.js +0 -46
- package/lib/commonjs/core/services/user-friendly-messages.js.map +0 -1
- package/lib/commonjs/internal/telemetry-collector.js +0 -80
- package/lib/commonjs/internal/telemetry-collector.js.map +0 -1
- package/lib/commonjs/public/constants.js +0 -21
- package/lib/commonjs/public/constants.js.map +0 -1
- package/lib/commonjs/public/spare-link-callbacks.js +0 -6
- package/lib/commonjs/public/spare-link-callbacks.js.map +0 -1
- package/lib/commonjs/ui/consent/charge-bearer-display.js +0 -99
- package/lib/commonjs/ui/consent/charge-bearer-display.js.map +0 -1
- package/lib/commonjs/ui/consent/consent-accordion.js +0 -94
- package/lib/commonjs/ui/consent/consent-accordion.js.map +0 -1
- package/lib/commonjs/ui/consent/consent-summary-section.js +0 -27
- package/lib/commonjs/ui/consent/consent-summary-section.js.map +0 -1
- package/lib/commonjs/ui/consent/cop-information.js +0 -168
- package/lib/commonjs/ui/consent/cop-information.js.map +0 -1
- package/lib/commonjs/ui/consent/international-payment-summary.js +0 -98
- package/lib/commonjs/ui/consent/international-payment-summary.js.map +0 -1
- package/lib/commonjs/ui/consent/label-value-rows.js +0 -59
- package/lib/commonjs/ui/consent/label-value-rows.js.map +0 -1
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js +0 -130
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js.map +0 -1
- package/lib/commonjs/ui/consent/multi-payment-summary.js +0 -99
- package/lib/commonjs/ui/consent/multi-payment-summary.js.map +0 -1
- package/lib/commonjs/ui/consent/single-payment-summary.js +0 -158
- package/lib/commonjs/ui/consent/single-payment-summary.js.map +0 -1
- package/lib/commonjs/ui/consent/terms-link.js +0 -35
- package/lib/commonjs/ui/consent/terms-link.js.map +0 -1
- package/lib/commonjs/ui/hooks/use-payment-flow-state.js.map +0 -1
- package/lib/commonjs/ui/payment-flow-page.js +0 -235
- package/lib/commonjs/ui/payment-flow-page.js.map +0 -1
- package/lib/commonjs/ui/screens/bank-selection-screen.js +0 -215
- package/lib/commonjs/ui/screens/bank-selection-screen.js.map +0 -1
- package/lib/commonjs/ui/screens/consent-details-screen.js +0 -124
- package/lib/commonjs/ui/screens/consent-details-screen.js.map +0 -1
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js +0 -79
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js.map +0 -1
- package/lib/commonjs/ui/widgets/layout-w-header.js +0 -106
- package/lib/commonjs/ui/widgets/layout-w-header.js.map +0 -1
- package/lib/commonjs/ui/widgets/stepper.js +0 -124
- package/lib/commonjs/ui/widgets/stepper.js.map +0 -1
- package/lib/module/core/client/link-api-client.js +0 -292
- package/lib/module/core/client/link-api-client.js.map +0 -1
- package/lib/module/core/errors/payment-api-error.js +0 -29
- package/lib/module/core/errors/payment-api-error.js.map +0 -1
- package/lib/module/core/models/link-session-status.js +0 -10
- package/lib/module/core/models/link-session-status.js.map +0 -1
- package/lib/module/core/models/payment-type.js +0 -36
- package/lib/module/core/models/payment-type.js.map +0 -1
- package/lib/module/core/models/wire-mappers.js +0 -263
- package/lib/module/core/models/wire-mappers.js.map +0 -1
- package/lib/module/core/services/consent-presenter.js +0 -140
- package/lib/module/core/services/consent-presenter.js.map +0 -1
- package/lib/module/core/services/execute-resume-if-needed.js +0 -211
- package/lib/module/core/services/execute-resume-if-needed.js.map +0 -1
- package/lib/module/core/services/multi-payment-rules-presenter.js +0 -146
- package/lib/module/core/services/multi-payment-rules-presenter.js.map +0 -1
- package/lib/module/core/services/payment-flow-controller.js +0 -544
- package/lib/module/core/services/payment-flow-controller.js.map +0 -1
- package/lib/module/core/services/payment-flow-state.js +0 -106
- package/lib/module/core/services/payment-flow-state.js.map +0 -1
- package/lib/module/core/services/payment-result-mapper.js +0 -45
- package/lib/module/core/services/payment-result-mapper.js.map +0 -1
- package/lib/module/core/services/presentation-utils.js +0 -7
- package/lib/module/core/services/presentation-utils.js.map +0 -1
- package/lib/module/core/services/redirect-buffer.js +0 -33
- package/lib/module/core/services/redirect-buffer.js.map +0 -1
- package/lib/module/core/services/user-friendly-messages.js +0 -42
- package/lib/module/core/services/user-friendly-messages.js.map +0 -1
- package/lib/module/internal/telemetry-collector.js +0 -75
- package/lib/module/internal/telemetry-collector.js.map +0 -1
- package/lib/module/public/constants.js +0 -17
- package/lib/module/public/constants.js.map +0 -1
- package/lib/module/public/spare-link-callbacks.js +0 -4
- package/lib/module/public/spare-link-callbacks.js.map +0 -1
- package/lib/module/ui/consent/charge-bearer-display.js +0 -95
- package/lib/module/ui/consent/charge-bearer-display.js.map +0 -1
- package/lib/module/ui/consent/consent-accordion.js +0 -90
- package/lib/module/ui/consent/consent-accordion.js.map +0 -1
- package/lib/module/ui/consent/consent-summary-section.js +0 -23
- package/lib/module/ui/consent/consent-summary-section.js.map +0 -1
- package/lib/module/ui/consent/cop-information.js +0 -165
- package/lib/module/ui/consent/cop-information.js.map +0 -1
- package/lib/module/ui/consent/international-payment-summary.js +0 -94
- package/lib/module/ui/consent/international-payment-summary.js.map +0 -1
- package/lib/module/ui/consent/label-value-rows.js +0 -55
- package/lib/module/ui/consent/label-value-rows.js.map +0 -1
- package/lib/module/ui/consent/multi-payment-rules-list.js +0 -125
- package/lib/module/ui/consent/multi-payment-rules-list.js.map +0 -1
- package/lib/module/ui/consent/multi-payment-summary.js +0 -95
- package/lib/module/ui/consent/multi-payment-summary.js.map +0 -1
- package/lib/module/ui/consent/single-payment-summary.js +0 -154
- package/lib/module/ui/consent/single-payment-summary.js.map +0 -1
- package/lib/module/ui/consent/terms-link.js +0 -31
- package/lib/module/ui/consent/terms-link.js.map +0 -1
- package/lib/module/ui/hooks/use-payment-flow-state.js.map +0 -1
- package/lib/module/ui/payment-flow-page.js +0 -232
- package/lib/module/ui/payment-flow-page.js.map +0 -1
- package/lib/module/ui/screens/bank-selection-screen.js +0 -211
- package/lib/module/ui/screens/bank-selection-screen.js.map +0 -1
- package/lib/module/ui/screens/consent-details-screen.js +0 -120
- package/lib/module/ui/screens/consent-details-screen.js.map +0 -1
- package/lib/module/ui/screens/mandate-setup-success-screen.js +0 -75
- package/lib/module/ui/screens/mandate-setup-success-screen.js.map +0 -1
- package/lib/module/ui/widgets/layout-w-header.js +0 -102
- package/lib/module/ui/widgets/layout-w-header.js.map +0 -1
- package/lib/module/ui/widgets/stepper.js +0 -120
- package/lib/module/ui/widgets/stepper.js.map +0 -1
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts +0 -70
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts +0 -15
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts +0 -6
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/models/payment-type.d.ts +0 -18
- package/lib/typescript/commonjs/core/models/payment-type.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts +0 -19
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts +0 -67
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts +0 -32
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts +0 -9
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts +0 -146
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts +0 -64
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts +0 -5
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts +0 -5
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts +0 -6
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts.map +0 -1
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts +0 -6
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts +0 -2
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts.map +0 -1
- package/lib/typescript/commonjs/public/constants.d.ts +0 -12
- package/lib/typescript/commonjs/public/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts +0 -14
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts +0 -5
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts +0 -10
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts +0 -6
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts +0 -6
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts +0 -6
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts +0 -10
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts +0 -15
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts +0 -6
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts +0 -6
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts +0 -2
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts +0 -9
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts +0 -20
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts +0 -15
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts +0 -13
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts +0 -10
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts +0 -20
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts +0 -15
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts.map +0 -1
- package/lib/typescript/module/core/client/link-api-client.d.ts +0 -70
- package/lib/typescript/module/core/client/link-api-client.d.ts.map +0 -1
- package/lib/typescript/module/core/errors/payment-api-error.d.ts +0 -15
- package/lib/typescript/module/core/errors/payment-api-error.d.ts.map +0 -1
- package/lib/typescript/module/core/models/link-session-status.d.ts +0 -6
- package/lib/typescript/module/core/models/link-session-status.d.ts.map +0 -1
- package/lib/typescript/module/core/models/payment-type.d.ts +0 -18
- package/lib/typescript/module/core/models/payment-type.d.ts.map +0 -1
- package/lib/typescript/module/core/models/wire-mappers.d.ts +0 -19
- package/lib/typescript/module/core/models/wire-mappers.d.ts.map +0 -1
- package/lib/typescript/module/core/services/consent-presenter.d.ts +0 -67
- package/lib/typescript/module/core/services/consent-presenter.d.ts.map +0 -1
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts +0 -32
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts.map +0 -1
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts +0 -9
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts.map +0 -1
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts +0 -146
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts.map +0 -1
- package/lib/typescript/module/core/services/payment-flow-state.d.ts +0 -64
- package/lib/typescript/module/core/services/payment-flow-state.d.ts.map +0 -1
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts +0 -5
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts.map +0 -1
- package/lib/typescript/module/core/services/presentation-utils.d.ts +0 -5
- package/lib/typescript/module/core/services/presentation-utils.d.ts.map +0 -1
- package/lib/typescript/module/core/services/redirect-buffer.d.ts +0 -6
- package/lib/typescript/module/core/services/redirect-buffer.d.ts.map +0 -1
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts +0 -6
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts.map +0 -1
- package/lib/typescript/module/internal/telemetry-collector.d.ts +0 -2
- package/lib/typescript/module/internal/telemetry-collector.d.ts.map +0 -1
- package/lib/typescript/module/public/constants.d.ts +0 -12
- package/lib/typescript/module/public/constants.d.ts.map +0 -1
- package/lib/typescript/module/public/spare-link-callbacks.d.ts +0 -14
- package/lib/typescript/module/public/spare-link-callbacks.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts +0 -5
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts +0 -10
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts +0 -6
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/cop-information.d.ts +0 -6
- package/lib/typescript/module/ui/consent/cop-information.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts +0 -6
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts +0 -10
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts +0 -15
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts +0 -6
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts +0 -6
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts.map +0 -1
- package/lib/typescript/module/ui/consent/terms-link.d.ts +0 -2
- package/lib/typescript/module/ui/consent/terms-link.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts +0 -9
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts.map +0 -1
- package/lib/typescript/module/ui/payment-flow-page.d.ts +0 -20
- package/lib/typescript/module/ui/payment-flow-page.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts +0 -15
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts +0 -13
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts +0 -10
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts.map +0 -1
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts +0 -20
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts.map +0 -1
- package/lib/typescript/module/ui/widgets/stepper.d.ts +0 -15
- package/lib/typescript/module/ui/widgets/stepper.d.ts.map +0 -1
- package/src/core/client/link-api-client.ts +0 -414
- package/src/core/errors/payment-api-error.ts +0 -35
- package/src/core/models/link-session-status.ts +0 -7
- package/src/core/models/payment-type.ts +0 -54
- package/src/core/models/wire-mappers.ts +0 -315
- package/src/core/services/consent-presenter.ts +0 -213
- package/src/core/services/execute-resume-if-needed.ts +0 -243
- package/src/core/services/multi-payment-rules-presenter.ts +0 -158
- package/src/core/services/payment-flow-controller.ts +0 -607
- package/src/core/services/payment-flow-state.ts +0 -124
- package/src/core/services/payment-result-mapper.ts +0 -41
- package/src/core/services/presentation-utils.ts +0 -4
- package/src/core/services/redirect-buffer.ts +0 -34
- package/src/core/services/user-friendly-messages.ts +0 -39
- package/src/internal/telemetry-collector.ts +0 -90
- package/src/public/constants.ts +0 -14
- package/src/public/spare-link-callbacks.ts +0 -20
- package/src/ui/consent/charge-bearer-display.tsx +0 -68
- package/src/ui/consent/consent-accordion.tsx +0 -89
- package/src/ui/consent/consent-summary-section.tsx +0 -19
- package/src/ui/consent/cop-information.tsx +0 -121
- package/src/ui/consent/international-payment-summary.tsx +0 -83
- package/src/ui/consent/label-value-rows.tsx +0 -50
- package/src/ui/consent/multi-payment-rules-list.tsx +0 -138
- package/src/ui/consent/multi-payment-summary.tsx +0 -82
- package/src/ui/consent/single-payment-summary.tsx +0 -123
- package/src/ui/consent/terms-link.tsx +0 -27
- package/src/ui/hooks/use-payment-flow-state.ts +0 -16
- package/src/ui/payment-flow-page.tsx +0 -254
- package/src/ui/screens/bank-selection-screen.tsx +0 -209
- package/src/ui/screens/consent-details-screen.tsx +0 -106
- package/src/ui/screens/mandate-setup-success-screen.tsx +0 -72
- package/src/ui/widgets/layout-w-header.tsx +0 -89
- package/src/ui/widgets/stepper.tsx +0 -126
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
-
import { Colors, FONT_FAMILY, Spacing } from "../theme/index.js";
|
|
6
|
-
import { ConsentAccordion } from "./consent-accordion.js";
|
|
7
|
-
import { CopInformation, CopLoadingPlaceholder } from "./cop-information.js";
|
|
8
|
-
import { LabelValueRows, present } from "./label-value-rows.js";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
-
export function SinglePaymentSummary(props) {
|
|
11
|
-
const {
|
|
12
|
-
data
|
|
13
|
-
} = props;
|
|
14
|
-
const creditor = data.creditorName?.trim();
|
|
15
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
16
|
-
children: [/*#__PURE__*/_jsx(PaymentDetailsCard, {
|
|
17
|
-
amount: data.formattedAmount,
|
|
18
|
-
paymentReference: data.paymentReference,
|
|
19
|
-
paymentPurpose: data.paymentPurpose
|
|
20
|
-
}), /*#__PURE__*/_jsx(ConsentAccordion, {
|
|
21
|
-
items: [{
|
|
22
|
-
header: 'Payee Information',
|
|
23
|
-
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
-
children: [/*#__PURE__*/_jsx(LabelValueRows, {
|
|
25
|
-
rows: [{
|
|
26
|
-
label: 'IBAN',
|
|
27
|
-
value: present(data.iban)
|
|
28
|
-
}]
|
|
29
|
-
}), creditor ? /*#__PURE__*/_jsx(LabelValueRows, {
|
|
30
|
-
rows: [{
|
|
31
|
-
label: 'Payee Name',
|
|
32
|
-
value: creditor
|
|
33
|
-
}]
|
|
34
|
-
}) : null, data.isCopLoading || data.copDisplay ? /*#__PURE__*/_jsxs(View, {
|
|
35
|
-
style: styles.copSection,
|
|
36
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
37
|
-
style: styles.copDivider,
|
|
38
|
-
testID: "consent-cop-divider"
|
|
39
|
-
}), data.isCopLoading ? /*#__PURE__*/_jsx(CopLoadingPlaceholder, {}) : data.copDisplay ? /*#__PURE__*/_jsx(CopInformation, {
|
|
40
|
-
display: data.copDisplay
|
|
41
|
-
}) : null]
|
|
42
|
-
}) : null]
|
|
43
|
-
})
|
|
44
|
-
}, {
|
|
45
|
-
header: 'Payer Information',
|
|
46
|
-
children: /*#__PURE__*/_jsx(LabelValueRows, {
|
|
47
|
-
rows: [{
|
|
48
|
-
label: 'Bank',
|
|
49
|
-
value: present(data.bankName)
|
|
50
|
-
}]
|
|
51
|
-
})
|
|
52
|
-
}]
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function PaymentDetailsCard(props) {
|
|
57
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
58
|
-
style: styles.paymentCard,
|
|
59
|
-
testID: "consent-payment-details",
|
|
60
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
61
|
-
style: styles.rowBetween,
|
|
62
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
63
|
-
style: styles.rowCenter,
|
|
64
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
65
|
-
name: "wallet-outline",
|
|
66
|
-
size: 18,
|
|
67
|
-
color: Colors.textPrimary
|
|
68
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
69
|
-
style: styles.totalLabel,
|
|
70
|
-
children: "Payment Total"
|
|
71
|
-
})]
|
|
72
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
73
|
-
style: styles.totalAmount,
|
|
74
|
-
testID: "consent-details-amount",
|
|
75
|
-
children: props.amount
|
|
76
|
-
})]
|
|
77
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
78
|
-
style: styles.rowBetween,
|
|
79
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
80
|
-
style: styles.muted,
|
|
81
|
-
children: "Payment References"
|
|
82
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
83
|
-
style: styles.muted,
|
|
84
|
-
children: present(props.paymentReference)
|
|
85
|
-
})]
|
|
86
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
87
|
-
style: styles.rowBetween,
|
|
88
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
89
|
-
style: styles.muted,
|
|
90
|
-
children: "Payment Purpose"
|
|
91
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
92
|
-
style: styles.muted,
|
|
93
|
-
children: present(props.paymentPurpose)
|
|
94
|
-
})]
|
|
95
|
-
})]
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const styles = StyleSheet.create({
|
|
99
|
-
paymentCard: {
|
|
100
|
-
backgroundColor: Colors.surfaceCard,
|
|
101
|
-
borderRadius: 16,
|
|
102
|
-
paddingVertical: 14,
|
|
103
|
-
paddingHorizontal: 20,
|
|
104
|
-
marginBottom: 14,
|
|
105
|
-
gap: 10,
|
|
106
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
107
|
-
borderColor: Colors.divider,
|
|
108
|
-
shadowColor: '#000000',
|
|
109
|
-
shadowOpacity: 0.06,
|
|
110
|
-
shadowRadius: 6,
|
|
111
|
-
shadowOffset: {
|
|
112
|
-
width: 0,
|
|
113
|
-
height: 2
|
|
114
|
-
},
|
|
115
|
-
elevation: 2
|
|
116
|
-
},
|
|
117
|
-
rowBetween: {
|
|
118
|
-
flexDirection: 'row',
|
|
119
|
-
justifyContent: 'space-between',
|
|
120
|
-
alignItems: 'center'
|
|
121
|
-
},
|
|
122
|
-
rowCenter: {
|
|
123
|
-
flexDirection: 'row',
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
gap: Spacing.sm
|
|
126
|
-
},
|
|
127
|
-
totalLabel: {
|
|
128
|
-
fontFamily: FONT_FAMILY,
|
|
129
|
-
fontSize: 14,
|
|
130
|
-
fontWeight: '700',
|
|
131
|
-
color: Colors.textPrimary
|
|
132
|
-
},
|
|
133
|
-
totalAmount: {
|
|
134
|
-
fontFamily: FONT_FAMILY,
|
|
135
|
-
fontSize: 14,
|
|
136
|
-
fontWeight: '700',
|
|
137
|
-
color: Colors.textPrimary
|
|
138
|
-
},
|
|
139
|
-
muted: {
|
|
140
|
-
fontFamily: FONT_FAMILY,
|
|
141
|
-
fontSize: 14,
|
|
142
|
-
color: Colors.textMuted
|
|
143
|
-
},
|
|
144
|
-
copSection: {
|
|
145
|
-
marginTop: 4
|
|
146
|
-
},
|
|
147
|
-
copDivider: {
|
|
148
|
-
height: StyleSheet.hairlineWidth,
|
|
149
|
-
backgroundColor: Colors.divider,
|
|
150
|
-
marginHorizontal: 20,
|
|
151
|
-
marginBottom: 8
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
//# sourceMappingURL=single-payment-summary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Ionicons","StyleSheet","Text","View","Colors","FONT_FAMILY","Spacing","ConsentAccordion","CopInformation","CopLoadingPlaceholder","LabelValueRows","present","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SinglePaymentSummary","props","data","creditor","creditorName","trim","children","PaymentDetailsCard","amount","formattedAmount","paymentReference","paymentPurpose","items","header","rows","label","value","iban","isCopLoading","copDisplay","style","styles","copSection","copDivider","testID","display","bankName","paymentCard","rowBetween","rowCenter","name","size","color","textPrimary","totalLabel","totalAmount","muted","create","backgroundColor","surfaceCard","borderRadius","paddingVertical","paddingHorizontal","marginBottom","gap","borderWidth","hairlineWidth","borderColor","divider","shadowColor","shadowOpacity","shadowRadius","shadowOffset","width","height","elevation","flexDirection","justifyContent","alignItems","sm","fontFamily","fontSize","fontWeight","textMuted","marginTop","marginHorizontal"],"sourceRoot":"../../../../src","sources":["ui/consent/single-payment-summary.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SAASC,MAAM,EAAEC,WAAW,EAAEC,OAAO,QAAQ,mBAAU;AACvD,SAASC,gBAAgB,QAAQ,wBAAqB;AACtD,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,sBAAmB;AACzE,SAASC,cAAc,EAAEC,OAAO,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAM7D,OAAO,SAASC,oBAAoBA,CAACC,KAAgC,EAAe;EAClF,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,QAAQ,GAAGD,IAAI,CAACE,YAAY,EAAEC,IAAI,CAAC,CAAC;EAE1C,oBACER,KAAA,CAAAE,SAAA;IAAAO,QAAA,gBACEX,IAAA,CAACY,kBAAkB;MACjBC,MAAM,EAAEN,IAAI,CAACO,eAAgB;MAC7BC,gBAAgB,EAAER,IAAI,CAACQ,gBAAiB;MACxCC,cAAc,EAAET,IAAI,CAACS;IAAe,CACrC,CAAC,eACFhB,IAAA,CAACN,gBAAgB;MACfuB,KAAK,EAAE,CACL;QACEC,MAAM,EAAE,mBAAmB;QAC3BP,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E0C,SAAS,EAAE;EAAE,CAAC;EAC5BzC,UAAU,EAAE;IACV+B,MAAM,EAAEvE,UAAU,CAAC+D,aAAa;IAChCR,eAAe,EAAEpD,MAAM,CAAC8D,OAAO;IAC/BiB,gBAAgB,EAAE,EAAE;IACpBtB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Linking, Pressable, StyleSheet, Text } from 'react-native';
|
|
4
|
-
import { Colors, FONT_FAMILY } from "../theme/index.js";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const TERMS_URL = 'https://terms.tryspare.com/ae/en';
|
|
7
|
-
export function TermsLink() {
|
|
8
|
-
return /*#__PURE__*/_jsx(Pressable, {
|
|
9
|
-
accessibilityRole: "link",
|
|
10
|
-
onPress: () => void Linking.openURL(TERMS_URL),
|
|
11
|
-
testID: "consent-terms-link",
|
|
12
|
-
style: styles.wrap,
|
|
13
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
14
|
-
style: styles.link,
|
|
15
|
-
children: "View terms and conditions"
|
|
16
|
-
})
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
const styles = StyleSheet.create({
|
|
20
|
-
wrap: {
|
|
21
|
-
paddingHorizontal: 20,
|
|
22
|
-
paddingVertical: 4
|
|
23
|
-
},
|
|
24
|
-
link: {
|
|
25
|
-
fontFamily: FONT_FAMILY,
|
|
26
|
-
fontSize: 14,
|
|
27
|
-
color: Colors.spareBlue,
|
|
28
|
-
textDecorationLine: 'underline'
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=terms-link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","Pressable","StyleSheet","Text","Colors","FONT_FAMILY","jsx","_jsx","TERMS_URL","TermsLink","accessibilityRole","onPress","openURL","testID","style","styles","wrap","children","link","create","paddingHorizontal","paddingVertical","fontFamily","fontSize","color","spareBlue","textDecorationLine"],"sourceRoot":"../../../../src","sources":["ui/consent/terms-link.tsx"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACnE,SAASC,MAAM,EAAEC,WAAW,QAAQ,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,SAAS,GAAG,kCAAkC;AAEpD,OAAO,SAASC,SAASA,CAAA,EAAgB;EACvC,oBACEF,IAAA,CAACN,SAAS;IACRS,iBAAiB,EAAC,MAAM;IACxBC,OAAO,EAAEA,CAAA,KAAM,KAAKX,OAAO,CAACY,OAAO,CAACJ,SAAS,CAAE;IAC/CK,MAAM,EAAC,oBAAoB;IAC3BC,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAC,QAAA,eAEnBV,IAAA,CAACJ,IAAI;MAACW,KAAK,EAAEC,MAAM,CAACG,IAAK;MAAAD,QAAA,EAAC;IAAyB,CAAM;EAAC,CACjD,CAAC;AAEhB;AAEA,MAAMF,MAAM,GAAGb,UAAU,CAACiB,MAAM,CAAC;EAC/BH,IAAI,EAAE;IAAEI,iBAAiB,EAAE,EAAE;IAAEC,eAAe,EAAE;EAAE,CAAC;EACnDH,IAAI,EAAE;IACJI,UAAU,EAAEjB,WAAW;IACvBkB,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEpB,MAAM,CAACqB,SAAS;IACvBC,kBAAkB,EAAE;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSyncExternalStore","usePaymentFlowState","controller","notify","subscribe","state"],"sourceRoot":"../../../../src","sources":["ui/hooks/use-payment-flow-state.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAI5C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAACC,UAAiC,EAAoB;EACvF,OAAOF,oBAAoB,CACxBG,MAAM,IAAKD,UAAU,CAACE,SAAS,CAACD,MAAM,CAAC,EACxC,MAAMD,UAAU,CAACG,KAAK,EACtB,MAAMH,UAAU,CAACG,KACnB,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
5
|
-
import { Text } from 'react-native';
|
|
6
|
-
import { isMultiPayment, resolvedPaymentType } from "../core/models/payment-type.js";
|
|
7
|
-
import { summaryFromState } from "../core/services/consent-presenter.js";
|
|
8
|
-
import { buildMultiPaymentRules, rulesSectionTitle } from "../core/services/multi-payment-rules-presenter.js";
|
|
9
|
-
import { userFriendlyMessageFor } from "../core/services/user-friendly-messages.js";
|
|
10
|
-
import { DEFAULT_AWAITING_CALLBACK_POLL_MS } from "../public/constants.js";
|
|
11
|
-
import { usePaymentFlowState } from "./hooks/use-payment-flow-state.js";
|
|
12
|
-
import { BankSelectionScreen } from "./screens/bank-selection-screen.js";
|
|
13
|
-
import { ConsentDetailsScreen } from "./screens/consent-details-screen.js";
|
|
14
|
-
import { MandateSetupSuccessScreen } from "./screens/mandate-setup-success-screen.js";
|
|
15
|
-
import { RedirectHandoffScreen } from "./screens/redirect-handoff-screen.js";
|
|
16
|
-
import { ResultScreen } from "./screens/result-screen.js";
|
|
17
|
-
import { ResumeProcessingScreen } from "./screens/resume-processing-screen.js";
|
|
18
|
-
import { Colors, Typography } from "./theme/index.js";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export function PaymentFlowPage(props) {
|
|
21
|
-
const {
|
|
22
|
-
controller,
|
|
23
|
-
onResolved,
|
|
24
|
-
launchBankRedirect
|
|
25
|
-
} = props;
|
|
26
|
-
const state = usePaymentFlowState(controller);
|
|
27
|
-
const [processing, setProcessing] = useState(false);
|
|
28
|
-
const [mandateAcknowledged, setMandateAcknowledged] = useState(false);
|
|
29
|
-
const hydratedRef = useRef(false);
|
|
30
|
-
const terminalFiredRef = useRef(false);
|
|
31
|
-
const mandateClosedRef = useRef(false);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (hydratedRef.current) return;
|
|
34
|
-
hydratedRef.current = true;
|
|
35
|
-
// Recovery parks at awaitingCallback before mount (Flutter parity) — GET /link
|
|
36
|
-
// is one-time and must not be called again on resume.
|
|
37
|
-
if (controller.state.phase !== 'idle') return;
|
|
38
|
-
void controller.hydrate().catch(() => {
|
|
39
|
-
// hydrate already setStates failed — callback will fire below.
|
|
40
|
-
});
|
|
41
|
-
}, [controller]);
|
|
42
|
-
|
|
43
|
-
// Launch bank redirect once we hit `redirecting`.
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (state.phase !== 'redirecting' || !state.consent) return;
|
|
46
|
-
const consent = state.consent;
|
|
47
|
-
let cancelled = false;
|
|
48
|
-
(async () => {
|
|
49
|
-
try {
|
|
50
|
-
await launchBankRedirect?.({
|
|
51
|
-
authorizationUrl: consent.redirectUrl,
|
|
52
|
-
...(consent.mobileAppUrl ? {
|
|
53
|
-
mobileAppUrl: consent.mobileAppUrl
|
|
54
|
-
} : {})
|
|
55
|
-
});
|
|
56
|
-
if (cancelled) return;
|
|
57
|
-
controller.fireEvent('redirectToBank');
|
|
58
|
-
controller.setAwaitingCallbackState({
|
|
59
|
-
...(state.selectedProvider ? {
|
|
60
|
-
providerName: state.selectedProvider.name
|
|
61
|
-
} : {})
|
|
62
|
-
});
|
|
63
|
-
} catch {
|
|
64
|
-
if (!cancelled) {
|
|
65
|
-
void controller.reportError('bank_launch_failed');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
})();
|
|
69
|
-
return () => {
|
|
70
|
-
cancelled = true;
|
|
71
|
-
};
|
|
72
|
-
}, [state.phase, state.consent, state.selectedProvider, launchBankRedirect, controller]);
|
|
73
|
-
|
|
74
|
-
// Poll /link/status while waiting for the bank — production and sandbox.
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (state.phase !== 'awaitingCallback') return;
|
|
77
|
-
const id = setInterval(() => {
|
|
78
|
-
void controller.pollStatus();
|
|
79
|
-
}, DEFAULT_AWAITING_CALLBACK_POLL_MS);
|
|
80
|
-
return () => clearInterval(id);
|
|
81
|
-
}, [state.phase, controller]);
|
|
82
|
-
|
|
83
|
-
// Fire terminal callbacks exactly once.
|
|
84
|
-
// or re-delivered terminal state (e.g. a duplicate callback) can't fire
|
|
85
|
-
// onSuccess/onEvent twice — integrators treat onSuccess as fire-once
|
|
86
|
-
// (navigate, capture funds, record analytics).
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
const phase = state.phase;
|
|
89
|
-
if (phase !== 'succeeded' && phase !== 'failed' && phase !== 'cancelled') return;
|
|
90
|
-
if (terminalFiredRef.current) return;
|
|
91
|
-
if (phase === 'succeeded') {
|
|
92
|
-
const request = state.session?.request;
|
|
93
|
-
if (request && isMultiPayment(request) && !mandateAcknowledged) return;
|
|
94
|
-
}
|
|
95
|
-
terminalFiredRef.current = true;
|
|
96
|
-
if (phase === 'succeeded') {
|
|
97
|
-
props.callbacks?.onSuccess?.(state.exchangeCode, state.linkSessionId);
|
|
98
|
-
props.callbacks?.onEvent?.('succeeded');
|
|
99
|
-
} else if (phase === 'failed') {
|
|
100
|
-
props.callbacks?.onEvent?.('failed');
|
|
101
|
-
} else {
|
|
102
|
-
props.callbacks?.onEvent?.('cancelled');
|
|
103
|
-
}
|
|
104
|
-
}, [state.phase, state.exchangeCode, state.linkSessionId, state.session, mandateAcknowledged, props.callbacks]);
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (state.phase !== 'succeeded' || !mandateAcknowledged || mandateClosedRef.current) return;
|
|
107
|
-
const request = state.session?.request;
|
|
108
|
-
if (!request || !isMultiPayment(request)) return;
|
|
109
|
-
mandateClosedRef.current = true;
|
|
110
|
-
onResolved();
|
|
111
|
-
}, [state.phase, state.session, mandateAcknowledged, onResolved]);
|
|
112
|
-
switch (state.phase) {
|
|
113
|
-
case 'idle':
|
|
114
|
-
case 'hydrating':
|
|
115
|
-
return /*#__PURE__*/_jsx(LoadingState, {});
|
|
116
|
-
case 'bankSelection':
|
|
117
|
-
return /*#__PURE__*/_jsx(BankSelectionScreen, {
|
|
118
|
-
providers: state.providers,
|
|
119
|
-
isProcessing: processing,
|
|
120
|
-
onSelected: async bankId => {
|
|
121
|
-
setProcessing(true);
|
|
122
|
-
try {
|
|
123
|
-
controller.selectBank(bankId);
|
|
124
|
-
} finally {
|
|
125
|
-
setProcessing(false);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
onCancel: async () => {
|
|
129
|
-
setProcessing(true);
|
|
130
|
-
try {
|
|
131
|
-
await controller.cancel();
|
|
132
|
-
} finally {
|
|
133
|
-
setProcessing(false);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
case 'consentDetails':
|
|
138
|
-
{
|
|
139
|
-
const summary = summaryFromState(state);
|
|
140
|
-
if (!summary) return /*#__PURE__*/_jsx(LoadingState, {});
|
|
141
|
-
return /*#__PURE__*/_jsx(ConsentDetailsScreen, {
|
|
142
|
-
display: summary,
|
|
143
|
-
isProcessing: processing,
|
|
144
|
-
...(state.isCopLoading ? {
|
|
145
|
-
isCopLoading: true
|
|
146
|
-
} : {}),
|
|
147
|
-
onContinue: async () => {
|
|
148
|
-
setProcessing(true);
|
|
149
|
-
try {
|
|
150
|
-
await controller.confirmConsent();
|
|
151
|
-
} catch {
|
|
152
|
-
// controller already setStates failed
|
|
153
|
-
} finally {
|
|
154
|
-
setProcessing(false);
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
onCancel: async () => {
|
|
158
|
-
setProcessing(true);
|
|
159
|
-
try {
|
|
160
|
-
await controller.cancel();
|
|
161
|
-
} finally {
|
|
162
|
-
setProcessing(false);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
case 'redirecting':
|
|
168
|
-
return /*#__PURE__*/_jsx(RedirectHandoffScreen, {});
|
|
169
|
-
case 'awaitingCallback':
|
|
170
|
-
return /*#__PURE__*/_jsx(ResumeProcessingScreen, {
|
|
171
|
-
...(controller.awaitingCallbackStartedAtMs !== undefined ? {
|
|
172
|
-
awaitingCallbackStartedAtMs: controller.awaitingCallbackStartedAtMs
|
|
173
|
-
} : {}),
|
|
174
|
-
onCancel: async () => {
|
|
175
|
-
await controller.cancel();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
case 'succeeded':
|
|
179
|
-
{
|
|
180
|
-
const request = state.session?.request;
|
|
181
|
-
if (request && isMultiPayment(request) && !mandateAcknowledged) {
|
|
182
|
-
const paymentType = resolvedPaymentType(request);
|
|
183
|
-
return /*#__PURE__*/_jsx(MandateSetupSuccessScreen, {
|
|
184
|
-
rulesTitle: rulesSectionTitle(paymentType),
|
|
185
|
-
rules: buildMultiPaymentRules(paymentType, request.instructions),
|
|
186
|
-
paymentType: paymentType,
|
|
187
|
-
onDone: () => setMandateAcknowledged(true)
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
191
|
-
title: "Your payment was successful.",
|
|
192
|
-
isSuccess: true,
|
|
193
|
-
onDone: onResolved
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
case 'failed':
|
|
197
|
-
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
198
|
-
title: userFriendlyMessageFor(state.errorCode ?? 'unknown_error'),
|
|
199
|
-
isSuccess: false,
|
|
200
|
-
onDone: onResolved
|
|
201
|
-
});
|
|
202
|
-
case 'cancelled':
|
|
203
|
-
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
204
|
-
title: "The payment was cancelled.",
|
|
205
|
-
isSuccess: false,
|
|
206
|
-
onDone: onResolved
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
function LoadingState() {
|
|
211
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
212
|
-
style: styles.loading,
|
|
213
|
-
testID: "payment-flow-loading",
|
|
214
|
-
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
215
|
-
size: "large",
|
|
216
|
-
color: Colors.spareBlue
|
|
217
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
218
|
-
style: Typography.bodyMuted,
|
|
219
|
-
children: "Loading\u2026"
|
|
220
|
-
})]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
const styles = StyleSheet.create({
|
|
224
|
-
loading: {
|
|
225
|
-
flex: 1,
|
|
226
|
-
alignItems: 'center',
|
|
227
|
-
justifyContent: 'center',
|
|
228
|
-
gap: 12,
|
|
229
|
-
backgroundColor: Colors.surfacePage
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
//# sourceMappingURL=payment-flow-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","Text","isMultiPayment","resolvedPaymentType","summaryFromState","buildMultiPaymentRules","rulesSectionTitle","userFriendlyMessageFor","DEFAULT_AWAITING_CALLBACK_POLL_MS","usePaymentFlowState","BankSelectionScreen","ConsentDetailsScreen","MandateSetupSuccessScreen","RedirectHandoffScreen","ResultScreen","ResumeProcessingScreen","Colors","Typography","jsx","_jsx","jsxs","_jsxs","PaymentFlowPage","props","controller","onResolved","launchBankRedirect","state","processing","setProcessing","mandateAcknowledged","setMandateAcknowledged","hydratedRef","terminalFiredRef","mandateClosedRef","current","phase","hydrate","catch","consent","cancelled","authorizationUrl","redirectUrl","mobileAppUrl","fireEvent","setAwaitingCallbackState","selectedProvider","providerName","name","reportError","id","setInterval","pollStatus","clearInterval","request","session","callbacks","onSuccess","exchangeCode","linkSessionId","onEvent","LoadingState","providers","isProcessing","onSelected","bankId","selectBank","onCancel","cancel","summary","display","isCopLoading","onContinue","confirmConsent","awaitingCallbackStartedAtMs","undefined","paymentType","rulesTitle","rules","instructions","onDone","title","isSuccess","errorCode","style","styles","loading","testID","children","size","color","spareBlue","bodyMuted","create","flex","alignItems","justifyContent","gap","backgroundColor","surfacePage"],"sourceRoot":"../../../src","sources":["ui/payment-flow-page.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,gCAA6B;AACjF,SAASC,gBAAgB,QAAQ,uCAAoC;AACrE,SACEC,sBAAsB,EACtBC,iBAAiB,QACZ,mDAAgD;AAEvD,SAASC,sBAAsB,QAAQ,4CAAyC;AAChF,SAASC,iCAAiC,QAAQ,wBAAqB;AAEvE,SAASC,mBAAmB,QAAQ,mCAAgC;AACpE,SAASC,mBAAmB,QAAQ,oCAAiC;AACrE,SAASC,oBAAoB,QAAQ,qCAAkC;AACvE,SAASC,yBAAyB,QAAQ,2CAAwC;AAClF,SAASC,qBAAqB,QAAQ,sCAAmC;AACzE,SAASC,YAAY,QAAQ,4BAAyB;AACtD,SAASC,sBAAsB,QAAQ,uCAAoC;AAC3E,SAASC,MAAM,EAAEC,UAAU,QAAQ,kBAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgB7C,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAe;EACxE,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAmB,CAAC,GAAGH,KAAK;EAC5D,MAAMI,KAAK,GAAGlB,mBAAmB,CAACe,UAAU,CAAC;EAC7C,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGhC,QAAQ,CAAC,KAAK,CAAC;EACnD,MAAM,CAACiC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGlC,QAAQ,C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AO;MAACC,KAAK,EAAE1E,MAAM,CAAC2E;IAAU,CAAE,CAAC,eAC3DxE,IAAA,CAAClB,IAAI;MAACmF,KAAK,EAAEnE,UAAU,CAAC2E,SAAU;MAAAJ,QAAA,EAAC;IAAQ,CAAM,CAAC;EAAA,CAC9C,CAAC;AAEX;AAEA,MAAMH,MAAM,GAAGtF,UAAU,CAAC8F,MAAM,CAAC;EAC/BP,OAAO,EAAE;IACPQ,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,GAAG,EAAE,EAAE;IACPC,eAAe,EAAElF,MAAM,CAACmF;EAC1B;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
5
|
-
import { Image, Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
6
|
-
import { Colors, FONT_FAMILY, Spacing } from "../theme/index.js";
|
|
7
|
-
import { Footer, LayoutWHeader } from "../widgets/index.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
/**
|
|
10
|
-
* CBUAE-approved bank picker. Port of Flutter `bank_selection_screen.dart`:
|
|
11
|
-
* "Choose your bank" inside a white card with a search field and logo rows
|
|
12
|
-
* (blue-outline selection), wrapped in the shared {@link LayoutWHeader} stepper
|
|
13
|
-
* chrome with a "Proceed using Altareq" footer.
|
|
14
|
-
*/
|
|
15
|
-
export function BankSelectionScreen(props) {
|
|
16
|
-
const [query, setQuery] = useState('');
|
|
17
|
-
const [selectedId, setSelectedId] = useState(undefined);
|
|
18
|
-
const trimmed = query.trim().toLowerCase();
|
|
19
|
-
const filtered = useMemo(() => trimmed ? props.providers.filter(p => p.name.toLowerCase().includes(trimmed)) : props.providers, [props.providers, trimmed]);
|
|
20
|
-
const isBankSelected = !!selectedId;
|
|
21
|
-
return /*#__PURE__*/_jsx(LayoutWHeader, {
|
|
22
|
-
progress: 0,
|
|
23
|
-
onBackPress: props.onCancel,
|
|
24
|
-
...(props.isProcessing ? {
|
|
25
|
-
backDisabled: true
|
|
26
|
-
} : {}),
|
|
27
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
28
|
-
style: styles.container,
|
|
29
|
-
testID: "bank-selection-screen",
|
|
30
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
31
|
-
style: styles.card,
|
|
32
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
33
|
-
style: styles.cardTitle,
|
|
34
|
-
testID: "bank-selection-title",
|
|
35
|
-
children: "Choose your bank"
|
|
36
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
37
|
-
style: styles.searchRow,
|
|
38
|
-
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
39
|
-
accessibilityLabel: "Search account providers",
|
|
40
|
-
testID: "bank-selection-search",
|
|
41
|
-
value: query,
|
|
42
|
-
onChangeText: setQuery,
|
|
43
|
-
placeholder: "Enter account provider...",
|
|
44
|
-
placeholderTextColor: Colors.textMuted,
|
|
45
|
-
style: styles.searchInput
|
|
46
|
-
}), query.length > 0 ? /*#__PURE__*/_jsx(Pressable, {
|
|
47
|
-
accessibilityRole: "button",
|
|
48
|
-
testID: "bank-selection-search-clear",
|
|
49
|
-
onPress: () => setQuery(''),
|
|
50
|
-
hitSlop: 8,
|
|
51
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
52
|
-
name: "close",
|
|
53
|
-
size: 18,
|
|
54
|
-
color: Colors.textMuted
|
|
55
|
-
})
|
|
56
|
-
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
57
|
-
name: "search",
|
|
58
|
-
size: 18,
|
|
59
|
-
color: Colors.textMuted
|
|
60
|
-
})]
|
|
61
|
-
}), filtered.length === 0 ? /*#__PURE__*/_jsx(Text, {
|
|
62
|
-
testID: "bank-selection-empty",
|
|
63
|
-
style: styles.empty,
|
|
64
|
-
children: trimmed ? `No banks match "${query.trim()}"` : 'No banks available'
|
|
65
|
-
}) : filtered.map(provider => /*#__PURE__*/_jsx(BankRow, {
|
|
66
|
-
provider: provider,
|
|
67
|
-
isSelected: provider.id === selectedId,
|
|
68
|
-
onPress: () => setSelectedId(provider.id)
|
|
69
|
-
}, provider.id))]
|
|
70
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
71
|
-
style: styles.spacer
|
|
72
|
-
}), /*#__PURE__*/_jsx(Footer, {
|
|
73
|
-
continueButtonText: "Proceed using Altareq",
|
|
74
|
-
continueTestID: "bank-selection-continue-btn",
|
|
75
|
-
cancelTestID: "bank-selection-cancel-btn",
|
|
76
|
-
onCancel: props.onCancel,
|
|
77
|
-
disabledContinueButton: !isBankSelected,
|
|
78
|
-
...(isBankSelected ? {
|
|
79
|
-
onContinue: () => props.onSelected(selectedId)
|
|
80
|
-
} : {}),
|
|
81
|
-
...(props.isProcessing ? {
|
|
82
|
-
isLoading: true
|
|
83
|
-
} : {})
|
|
84
|
-
})]
|
|
85
|
-
})
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
function BankRow(props) {
|
|
89
|
-
const {
|
|
90
|
-
provider,
|
|
91
|
-
isSelected
|
|
92
|
-
} = props;
|
|
93
|
-
const [logoFailed, setLogoFailed] = useState(false);
|
|
94
|
-
const showLogo = !!provider.logoUrl && !logoFailed;
|
|
95
|
-
return /*#__PURE__*/_jsxs(Pressable, {
|
|
96
|
-
testID: `bank-row-${provider.code}`,
|
|
97
|
-
accessibilityRole: "button",
|
|
98
|
-
onPress: props.onPress,
|
|
99
|
-
style: [styles.row, isSelected && styles.rowSelected],
|
|
100
|
-
children: [showLogo ? /*#__PURE__*/_jsx(Image, {
|
|
101
|
-
source: {
|
|
102
|
-
uri: provider.logoUrl
|
|
103
|
-
},
|
|
104
|
-
style: styles.logo,
|
|
105
|
-
resizeMode: "contain",
|
|
106
|
-
onError: () => setLogoFailed(true)
|
|
107
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
108
|
-
style: [styles.logo, styles.logoFallback],
|
|
109
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
110
|
-
name: "business-outline",
|
|
111
|
-
size: 20,
|
|
112
|
-
color: Colors.textMuted
|
|
113
|
-
})
|
|
114
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
115
|
-
style: [styles.rowName, isSelected && styles.rowNameSelected],
|
|
116
|
-
numberOfLines: 1,
|
|
117
|
-
children: provider.name
|
|
118
|
-
})]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
const styles = StyleSheet.create({
|
|
122
|
-
container: {
|
|
123
|
-
flex: 1
|
|
124
|
-
},
|
|
125
|
-
card: {
|
|
126
|
-
backgroundColor: Colors.surfaceCard,
|
|
127
|
-
borderRadius: 12,
|
|
128
|
-
paddingHorizontal: 12,
|
|
129
|
-
paddingVertical: 16,
|
|
130
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
131
|
-
borderColor: Colors.divider,
|
|
132
|
-
shadowColor: '#000000',
|
|
133
|
-
shadowOpacity: 0.06,
|
|
134
|
-
shadowRadius: 6,
|
|
135
|
-
shadowOffset: {
|
|
136
|
-
width: 0,
|
|
137
|
-
height: 2
|
|
138
|
-
},
|
|
139
|
-
elevation: 2
|
|
140
|
-
},
|
|
141
|
-
cardTitle: {
|
|
142
|
-
fontFamily: FONT_FAMILY,
|
|
143
|
-
fontSize: 16,
|
|
144
|
-
fontWeight: '700',
|
|
145
|
-
color: Colors.textPrimary,
|
|
146
|
-
marginBottom: 12
|
|
147
|
-
},
|
|
148
|
-
searchRow: {
|
|
149
|
-
flexDirection: 'row',
|
|
150
|
-
alignItems: 'center',
|
|
151
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
152
|
-
borderColor: Colors.divider,
|
|
153
|
-
borderRadius: 12,
|
|
154
|
-
paddingHorizontal: 12,
|
|
155
|
-
height: 44,
|
|
156
|
-
marginBottom: Spacing.md
|
|
157
|
-
},
|
|
158
|
-
searchInput: {
|
|
159
|
-
flex: 1,
|
|
160
|
-
fontFamily: FONT_FAMILY,
|
|
161
|
-
fontSize: 14,
|
|
162
|
-
color: Colors.textPrimary,
|
|
163
|
-
paddingVertical: 0
|
|
164
|
-
},
|
|
165
|
-
empty: {
|
|
166
|
-
fontFamily: FONT_FAMILY,
|
|
167
|
-
fontSize: 14,
|
|
168
|
-
color: Colors.textMuted,
|
|
169
|
-
textAlign: 'center',
|
|
170
|
-
paddingVertical: Spacing.xl
|
|
171
|
-
},
|
|
172
|
-
row: {
|
|
173
|
-
flexDirection: 'row',
|
|
174
|
-
alignItems: 'center',
|
|
175
|
-
paddingHorizontal: 12,
|
|
176
|
-
paddingVertical: 10,
|
|
177
|
-
marginVertical: 4,
|
|
178
|
-
borderRadius: 10,
|
|
179
|
-
borderWidth: 1.5,
|
|
180
|
-
borderColor: 'transparent'
|
|
181
|
-
},
|
|
182
|
-
rowSelected: {
|
|
183
|
-
borderColor: Colors.spareBlue
|
|
184
|
-
},
|
|
185
|
-
logo: {
|
|
186
|
-
width: 36,
|
|
187
|
-
height: 36,
|
|
188
|
-
borderRadius: 4
|
|
189
|
-
},
|
|
190
|
-
logoFallback: {
|
|
191
|
-
backgroundColor: Colors.surfaceMuted,
|
|
192
|
-
alignItems: 'center',
|
|
193
|
-
justifyContent: 'center'
|
|
194
|
-
},
|
|
195
|
-
rowName: {
|
|
196
|
-
flex: 1,
|
|
197
|
-
marginLeft: 12,
|
|
198
|
-
fontFamily: FONT_FAMILY,
|
|
199
|
-
fontSize: 14,
|
|
200
|
-
color: Colors.textPrimary
|
|
201
|
-
},
|
|
202
|
-
rowNameSelected: {
|
|
203
|
-
color: Colors.spareBlue,
|
|
204
|
-
fontWeight: '600'
|
|
205
|
-
},
|
|
206
|
-
spacer: {
|
|
207
|
-
flex: 1,
|
|
208
|
-
minHeight: Spacing.xl
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
//# sourceMappingURL=bank-selection-screen.js.map
|