@spare-technologies/spare-link 0.1.0-beta.1 → 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 -63
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/typescript/module/version.d.ts.map +1 -1
- package/package.json +24 -22
- 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 +1 -1
- package/CHANGELOG.md +0 -25
- 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,83 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
-
import type { InternationalPaymentSummaryData } from '../../core/services/consent-presenter';
|
|
3
|
-
import { presentField } from '../../core/services/consent-presenter';
|
|
4
|
-
import { Colors, FONT_FAMILY } from '../theme';
|
|
5
|
-
import { ChargeBearerDisplay } from './charge-bearer-display';
|
|
6
|
-
import { ConsentAccordion } from './consent-accordion';
|
|
7
|
-
import { LabelValueRows } from './label-value-rows';
|
|
8
|
-
import { TermsLink } from './terms-link';
|
|
9
|
-
|
|
10
|
-
export interface InternationalPaymentSummaryProps {
|
|
11
|
-
data: InternationalPaymentSummaryData;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function InternationalPaymentSummary(props: InternationalPaymentSummaryProps): JSX.Element {
|
|
15
|
-
const { data } = props;
|
|
16
|
-
return (
|
|
17
|
-
<View testID="international-payment-summary">
|
|
18
|
-
<View style={styles.card}>
|
|
19
|
-
<Text style={styles.title}>Payment Details</Text>
|
|
20
|
-
<LabelValueRows
|
|
21
|
-
paddingHorizontal={0}
|
|
22
|
-
rows={[
|
|
23
|
-
{ label: 'Payment References', value: presentField(data.paymentReference) },
|
|
24
|
-
{ label: 'Amount', value: data.formattedAmount },
|
|
25
|
-
{ label: 'Priority', value: presentField(data.priority) },
|
|
26
|
-
{ label: 'Payment Purpose', value: presentField(data.paymentPurpose) },
|
|
27
|
-
]}
|
|
28
|
-
/>
|
|
29
|
-
</View>
|
|
30
|
-
<ChargeBearerDisplay chargeBearer={data.chargeBearer} />
|
|
31
|
-
<ConsentAccordion
|
|
32
|
-
items={[
|
|
33
|
-
{
|
|
34
|
-
header: 'Payee Information',
|
|
35
|
-
children: (
|
|
36
|
-
<LabelValueRows
|
|
37
|
-
rows={[
|
|
38
|
-
{ label: 'IBAN', value: data.iban },
|
|
39
|
-
{ label: 'Payee Name', value: presentField(data.creditorName) },
|
|
40
|
-
]}
|
|
41
|
-
/>
|
|
42
|
-
),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
header: 'Payer Information',
|
|
46
|
-
children: (
|
|
47
|
-
<LabelValueRows rows={[{ label: 'Bank', value: presentField(data.bankName) }]} />
|
|
48
|
-
),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
header: 'Terms',
|
|
52
|
-
initiallyExpanded: false,
|
|
53
|
-
children: <TermsLink />,
|
|
54
|
-
},
|
|
55
|
-
]}
|
|
56
|
-
/>
|
|
57
|
-
</View>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const styles = StyleSheet.create({
|
|
62
|
-
card: {
|
|
63
|
-
backgroundColor: Colors.surfaceCard,
|
|
64
|
-
borderRadius: 16,
|
|
65
|
-
paddingVertical: 14,
|
|
66
|
-
paddingHorizontal: 20,
|
|
67
|
-
marginBottom: 14,
|
|
68
|
-
gap: 12,
|
|
69
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
70
|
-
borderColor: Colors.divider,
|
|
71
|
-
shadowColor: '#000000',
|
|
72
|
-
shadowOpacity: 0.06,
|
|
73
|
-
shadowRadius: 6,
|
|
74
|
-
shadowOffset: { width: 0, height: 2 },
|
|
75
|
-
elevation: 2,
|
|
76
|
-
},
|
|
77
|
-
title: {
|
|
78
|
-
fontFamily: FONT_FAMILY,
|
|
79
|
-
fontSize: 14,
|
|
80
|
-
fontWeight: '700',
|
|
81
|
-
color: Colors.textPrimary,
|
|
82
|
-
},
|
|
83
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
-
import type { LabelValueRow } from '../../core/services/multi-payment-rules-presenter';
|
|
3
|
-
import { Colors, FONT_FAMILY } from '../theme';
|
|
4
|
-
|
|
5
|
-
export interface LabelValueRowsProps {
|
|
6
|
-
rows: LabelValueRow[];
|
|
7
|
-
/** Horizontal inset; Flutter defaults to 20 and uses 0 inside padded cards. */
|
|
8
|
-
paddingHorizontal?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function LabelValueRows(props: LabelValueRowsProps): JSX.Element {
|
|
12
|
-
const paddingHorizontal = props.paddingHorizontal ?? 20;
|
|
13
|
-
return (
|
|
14
|
-
<View style={[styles.wrap, { paddingHorizontal }]} testID="label-value-rows">
|
|
15
|
-
{props.rows.map((row, idx) => (
|
|
16
|
-
<View key={`${row.label}-${idx}`} style={styles.row} testID={`label-value-row-${idx}`}>
|
|
17
|
-
<Text style={styles.label}>{row.label}</Text>
|
|
18
|
-
<Text style={styles.value}>{row.value}</Text>
|
|
19
|
-
</View>
|
|
20
|
-
))}
|
|
21
|
-
</View>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const styles = StyleSheet.create({
|
|
26
|
-
wrap: {},
|
|
27
|
-
row: {
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
justifyContent: 'space-between',
|
|
30
|
-
alignItems: 'flex-start',
|
|
31
|
-
gap: 12,
|
|
32
|
-
paddingVertical: 4,
|
|
33
|
-
},
|
|
34
|
-
label: { fontFamily: FONT_FAMILY, fontSize: 14, color: Colors.textMuted, flex: 1 },
|
|
35
|
-
value: {
|
|
36
|
-
fontFamily: FONT_FAMILY,
|
|
37
|
-
fontSize: 14,
|
|
38
|
-
color: Colors.textMuted,
|
|
39
|
-
textAlign: 'right',
|
|
40
|
-
flex: 1,
|
|
41
|
-
flexShrink: 1,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
function present(value: string | undefined, fallback = '—'): string {
|
|
46
|
-
const v = value?.trim();
|
|
47
|
-
return v ? v : fallback;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { present };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
2
|
-
import { PaymentType } from '../../core/models/payment-type';
|
|
3
|
-
import type { LabelValueRow } from '../../core/services/multi-payment-rules-presenter';
|
|
4
|
-
import { Colors, FONT_FAMILY } from '../theme';
|
|
5
|
-
import { LabelValueRows } from './label-value-rows';
|
|
6
|
-
|
|
7
|
-
/** Number of defined-schedule entry cards visible before scrolling. */
|
|
8
|
-
export const DEFINED_SCHEDULE_VISIBLE_ENTRY_COUNT = 3;
|
|
9
|
-
|
|
10
|
-
/** Approximate height of one defined-schedule entry card (incl. spacing). */
|
|
11
|
-
export const DEFINED_SCHEDULE_ENTRY_EXTENT = 96;
|
|
12
|
-
|
|
13
|
-
export interface MultiPaymentRulesListProps {
|
|
14
|
-
rulesTitle?: string;
|
|
15
|
-
rules: LabelValueRow[];
|
|
16
|
-
paymentType: PaymentType;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function MultiPaymentRulesList(props: MultiPaymentRulesListProps): JSX.Element {
|
|
20
|
-
const { rules, paymentType } = props;
|
|
21
|
-
|
|
22
|
-
if (rules.length === 0) {
|
|
23
|
-
return (
|
|
24
|
-
<View testID="multi-payment-rules-list">
|
|
25
|
-
{props.rulesTitle ? <Text style={styles.title}>{props.rulesTitle}</Text> : null}
|
|
26
|
-
<Text style={styles.empty}>—</Text>
|
|
27
|
-
</View>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const isDefinedSchedule =
|
|
32
|
-
paymentType === PaymentType.fixedDefinedSchedule ||
|
|
33
|
-
paymentType === PaymentType.variableDefinedSchedule;
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<View testID="multi-payment-rules-list">
|
|
37
|
-
{props.rulesTitle ? <Text style={styles.title}>{props.rulesTitle}</Text> : null}
|
|
38
|
-
{isDefinedSchedule ? (
|
|
39
|
-
<DefinedScheduleEntries rules={rules} />
|
|
40
|
-
) : (
|
|
41
|
-
<LabelValueRows rows={rules} />
|
|
42
|
-
)}
|
|
43
|
-
</View>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function DefinedScheduleEntries(props: { rules: LabelValueRow[] }): JSX.Element {
|
|
48
|
-
const entries = groupDefinedScheduleEntries(props.rules);
|
|
49
|
-
|
|
50
|
-
if (entries.length <= DEFINED_SCHEDULE_VISIBLE_ENTRY_COUNT) {
|
|
51
|
-
return (
|
|
52
|
-
<>
|
|
53
|
-
{entries.map((entry, index) => (
|
|
54
|
-
<DefinedScheduleEntryCard
|
|
55
|
-
key={definedScheduleEntryKey(entry)}
|
|
56
|
-
testID={`payment-schedule-entry-${index}`}
|
|
57
|
-
rows={entry}
|
|
58
|
-
/>
|
|
59
|
-
))}
|
|
60
|
-
</>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<ScrollView
|
|
66
|
-
testID="defined-schedule-scroll"
|
|
67
|
-
style={{ maxHeight: DEFINED_SCHEDULE_ENTRY_EXTENT * DEFINED_SCHEDULE_VISIBLE_ENTRY_COUNT }}
|
|
68
|
-
nestedScrollEnabled
|
|
69
|
-
showsVerticalScrollIndicator
|
|
70
|
-
>
|
|
71
|
-
{entries.map((entry, index) => (
|
|
72
|
-
<DefinedScheduleEntryCard
|
|
73
|
-
key={definedScheduleEntryKey(entry)}
|
|
74
|
-
testID={`payment-schedule-entry-${index}`}
|
|
75
|
-
rows={entry}
|
|
76
|
-
/>
|
|
77
|
-
))}
|
|
78
|
-
</ScrollView>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function DefinedScheduleEntryCard(props: {
|
|
83
|
-
rows: LabelValueRow[];
|
|
84
|
-
testID: string;
|
|
85
|
-
}): JSX.Element {
|
|
86
|
-
return (
|
|
87
|
-
<View style={styles.entryCard} testID={props.testID}>
|
|
88
|
-
<LabelValueRows paddingHorizontal={0} rows={props.rows} />
|
|
89
|
-
</View>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** Groups flat Amount/Date row pairs into per-payment entry lists. */
|
|
94
|
-
export function groupDefinedScheduleEntries(rules: LabelValueRow[]): LabelValueRow[][] {
|
|
95
|
-
const entries: LabelValueRow[][] = [];
|
|
96
|
-
for (const row of rules) {
|
|
97
|
-
if (row.label === 'Amount' || row.label === 'Max Amount') {
|
|
98
|
-
entries.push([row]);
|
|
99
|
-
} else if (row.label === 'Date' && entries.length > 0) {
|
|
100
|
-
entries[entries.length - 1]?.push(row);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return entries;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function definedScheduleEntryKey(entry: LabelValueRow[]): string {
|
|
107
|
-
return entry.map((row) => `${row.label}:${row.value}`).join('|');
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const styles = StyleSheet.create({
|
|
111
|
-
title: {
|
|
112
|
-
fontFamily: FONT_FAMILY,
|
|
113
|
-
fontSize: 16,
|
|
114
|
-
fontWeight: '700',
|
|
115
|
-
color: Colors.textPrimary,
|
|
116
|
-
marginBottom: 8,
|
|
117
|
-
paddingHorizontal: 20,
|
|
118
|
-
},
|
|
119
|
-
empty: {
|
|
120
|
-
fontFamily: FONT_FAMILY,
|
|
121
|
-
fontSize: 14,
|
|
122
|
-
color: Colors.textMuted,
|
|
123
|
-
paddingHorizontal: 20,
|
|
124
|
-
},
|
|
125
|
-
entryCard: {
|
|
126
|
-
backgroundColor: Colors.surfaceCard,
|
|
127
|
-
borderRadius: 8,
|
|
128
|
-
paddingVertical: 10,
|
|
129
|
-
paddingHorizontal: 16,
|
|
130
|
-
marginBottom: 10,
|
|
131
|
-
marginHorizontal: 20,
|
|
132
|
-
shadowColor: '#000000',
|
|
133
|
-
shadowOpacity: 0.06,
|
|
134
|
-
shadowRadius: 4,
|
|
135
|
-
shadowOffset: { width: 0, height: 1 },
|
|
136
|
-
elevation: 1,
|
|
137
|
-
},
|
|
138
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
-
import type { MultiPaymentSummaryData } from '../../core/services/consent-presenter';
|
|
3
|
-
import { Colors, FONT_FAMILY } from '../theme';
|
|
4
|
-
import { ConsentAccordion } from './consent-accordion';
|
|
5
|
-
import { LabelValueRows, present } from './label-value-rows';
|
|
6
|
-
import { MultiPaymentRulesList } from './multi-payment-rules-list';
|
|
7
|
-
import { TermsLink } from './terms-link';
|
|
8
|
-
|
|
9
|
-
export interface MultiPaymentSummaryProps {
|
|
10
|
-
data: MultiPaymentSummaryData;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function MultiPaymentSummary(props: MultiPaymentSummaryProps): JSX.Element {
|
|
14
|
-
const { data } = props;
|
|
15
|
-
return (
|
|
16
|
-
<View testID="multi-payment-summary">
|
|
17
|
-
<View style={styles.card} testID="multi-payment-setup-card">
|
|
18
|
-
<Text style={styles.setupTitle}>Payment setup</Text>
|
|
19
|
-
<LabelValueRows
|
|
20
|
-
paddingHorizontal={0}
|
|
21
|
-
rows={[
|
|
22
|
-
{ label: 'Payment to', value: present(data.creditorType) },
|
|
23
|
-
{ label: 'Reference', value: present(data.externalReference) },
|
|
24
|
-
{ label: 'Payment Purpose', value: present(data.paymentPurpose) },
|
|
25
|
-
]}
|
|
26
|
-
/>
|
|
27
|
-
</View>
|
|
28
|
-
<ConsentAccordion
|
|
29
|
-
items={[
|
|
30
|
-
{
|
|
31
|
-
header: data.rulesTitle,
|
|
32
|
-
children: <MultiPaymentRulesList rules={data.rules} paymentType={data.paymentType} />,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
header: 'To account',
|
|
36
|
-
children: (
|
|
37
|
-
<LabelValueRows
|
|
38
|
-
rows={[
|
|
39
|
-
{ label: 'IBAN', value: present(data.iban) },
|
|
40
|
-
{ label: 'Payee Name', value: present(data.creditorName) },
|
|
41
|
-
]}
|
|
42
|
-
/>
|
|
43
|
-
),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
header: 'From account',
|
|
47
|
-
children: <LabelValueRows rows={[{ label: 'Bank', value: present(data.bankName) }]} />,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
header: 'Terms',
|
|
51
|
-
initiallyExpanded: false,
|
|
52
|
-
children: <TermsLink />,
|
|
53
|
-
},
|
|
54
|
-
]}
|
|
55
|
-
/>
|
|
56
|
-
</View>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const styles = StyleSheet.create({
|
|
61
|
-
card: {
|
|
62
|
-
backgroundColor: Colors.surfaceCard,
|
|
63
|
-
borderRadius: 12,
|
|
64
|
-
paddingVertical: 14,
|
|
65
|
-
paddingHorizontal: 20,
|
|
66
|
-
marginBottom: 14,
|
|
67
|
-
gap: 12,
|
|
68
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
69
|
-
borderColor: Colors.divider,
|
|
70
|
-
shadowColor: '#000000',
|
|
71
|
-
shadowOpacity: 0.06,
|
|
72
|
-
shadowRadius: 6,
|
|
73
|
-
shadowOffset: { width: 0, height: 2 },
|
|
74
|
-
elevation: 2,
|
|
75
|
-
},
|
|
76
|
-
setupTitle: {
|
|
77
|
-
fontFamily: FONT_FAMILY,
|
|
78
|
-
fontSize: 14,
|
|
79
|
-
fontWeight: '700',
|
|
80
|
-
color: Colors.textPrimary,
|
|
81
|
-
},
|
|
82
|
-
});
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
-
import type { SinglePaymentSummaryData } from '../../core/services/consent-presenter';
|
|
4
|
-
import { Colors, FONT_FAMILY, Spacing } from '../theme';
|
|
5
|
-
import { ConsentAccordion } from './consent-accordion';
|
|
6
|
-
import { CopInformation, CopLoadingPlaceholder } from './cop-information';
|
|
7
|
-
import { LabelValueRows, present } from './label-value-rows';
|
|
8
|
-
|
|
9
|
-
export interface SinglePaymentSummaryProps {
|
|
10
|
-
data: SinglePaymentSummaryData;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function SinglePaymentSummary(props: SinglePaymentSummaryProps): JSX.Element {
|
|
14
|
-
const { data } = props;
|
|
15
|
-
const creditor = data.creditorName?.trim();
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<PaymentDetailsCard
|
|
20
|
-
amount={data.formattedAmount}
|
|
21
|
-
paymentReference={data.paymentReference}
|
|
22
|
-
paymentPurpose={data.paymentPurpose}
|
|
23
|
-
/>
|
|
24
|
-
<ConsentAccordion
|
|
25
|
-
items={[
|
|
26
|
-
{
|
|
27
|
-
header: 'Payee Information',
|
|
28
|
-
children: (
|
|
29
|
-
<>
|
|
30
|
-
<LabelValueRows rows={[{ label: 'IBAN', value: present(data.iban) }]} />
|
|
31
|
-
{creditor ? (
|
|
32
|
-
<LabelValueRows rows={[{ label: 'Payee Name', value: creditor }]} />
|
|
33
|
-
) : null}
|
|
34
|
-
{data.isCopLoading || data.copDisplay ? (
|
|
35
|
-
<View style={styles.copSection}>
|
|
36
|
-
<View style={styles.copDivider} testID="consent-cop-divider" />
|
|
37
|
-
{data.isCopLoading ? (
|
|
38
|
-
<CopLoadingPlaceholder />
|
|
39
|
-
) : data.copDisplay ? (
|
|
40
|
-
<CopInformation display={data.copDisplay} />
|
|
41
|
-
) : null}
|
|
42
|
-
</View>
|
|
43
|
-
) : null}
|
|
44
|
-
</>
|
|
45
|
-
),
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
header: 'Payer Information',
|
|
49
|
-
children: <LabelValueRows rows={[{ label: 'Bank', value: present(data.bankName) }]} />,
|
|
50
|
-
},
|
|
51
|
-
]}
|
|
52
|
-
/>
|
|
53
|
-
</>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function PaymentDetailsCard(props: {
|
|
58
|
-
amount: string;
|
|
59
|
-
paymentReference: string | undefined;
|
|
60
|
-
paymentPurpose: string | undefined;
|
|
61
|
-
}): JSX.Element {
|
|
62
|
-
return (
|
|
63
|
-
<View style={styles.paymentCard} testID="consent-payment-details">
|
|
64
|
-
<View style={styles.rowBetween}>
|
|
65
|
-
<View style={styles.rowCenter}>
|
|
66
|
-
<Ionicons name="wallet-outline" size={18} color={Colors.textPrimary} />
|
|
67
|
-
<Text style={styles.totalLabel}>Payment Total</Text>
|
|
68
|
-
</View>
|
|
69
|
-
<Text style={styles.totalAmount} testID="consent-details-amount">
|
|
70
|
-
{props.amount}
|
|
71
|
-
</Text>
|
|
72
|
-
</View>
|
|
73
|
-
<View style={styles.rowBetween}>
|
|
74
|
-
<Text style={styles.muted}>Payment References</Text>
|
|
75
|
-
<Text style={styles.muted}>{present(props.paymentReference)}</Text>
|
|
76
|
-
</View>
|
|
77
|
-
<View style={styles.rowBetween}>
|
|
78
|
-
<Text style={styles.muted}>Payment Purpose</Text>
|
|
79
|
-
<Text style={styles.muted}>{present(props.paymentPurpose)}</Text>
|
|
80
|
-
</View>
|
|
81
|
-
</View>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const styles = StyleSheet.create({
|
|
86
|
-
paymentCard: {
|
|
87
|
-
backgroundColor: Colors.surfaceCard,
|
|
88
|
-
borderRadius: 16,
|
|
89
|
-
paddingVertical: 14,
|
|
90
|
-
paddingHorizontal: 20,
|
|
91
|
-
marginBottom: 14,
|
|
92
|
-
gap: 10,
|
|
93
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
94
|
-
borderColor: Colors.divider,
|
|
95
|
-
shadowColor: '#000000',
|
|
96
|
-
shadowOpacity: 0.06,
|
|
97
|
-
shadowRadius: 6,
|
|
98
|
-
shadowOffset: { width: 0, height: 2 },
|
|
99
|
-
elevation: 2,
|
|
100
|
-
},
|
|
101
|
-
rowBetween: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },
|
|
102
|
-
rowCenter: { flexDirection: 'row', alignItems: 'center', gap: Spacing.sm },
|
|
103
|
-
totalLabel: {
|
|
104
|
-
fontFamily: FONT_FAMILY,
|
|
105
|
-
fontSize: 14,
|
|
106
|
-
fontWeight: '700',
|
|
107
|
-
color: Colors.textPrimary,
|
|
108
|
-
},
|
|
109
|
-
totalAmount: {
|
|
110
|
-
fontFamily: FONT_FAMILY,
|
|
111
|
-
fontSize: 14,
|
|
112
|
-
fontWeight: '700',
|
|
113
|
-
color: Colors.textPrimary,
|
|
114
|
-
},
|
|
115
|
-
muted: { fontFamily: FONT_FAMILY, fontSize: 14, color: Colors.textMuted },
|
|
116
|
-
copSection: { marginTop: 4 },
|
|
117
|
-
copDivider: {
|
|
118
|
-
height: StyleSheet.hairlineWidth,
|
|
119
|
-
backgroundColor: Colors.divider,
|
|
120
|
-
marginHorizontal: 20,
|
|
121
|
-
marginBottom: 8,
|
|
122
|
-
},
|
|
123
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Linking, Pressable, StyleSheet, Text } from 'react-native';
|
|
2
|
-
import { Colors, FONT_FAMILY } from '../theme';
|
|
3
|
-
|
|
4
|
-
const TERMS_URL = 'https://terms.tryspare.com/ae/en';
|
|
5
|
-
|
|
6
|
-
export function TermsLink(): JSX.Element {
|
|
7
|
-
return (
|
|
8
|
-
<Pressable
|
|
9
|
-
accessibilityRole="link"
|
|
10
|
-
onPress={() => void Linking.openURL(TERMS_URL)}
|
|
11
|
-
testID="consent-terms-link"
|
|
12
|
-
style={styles.wrap}
|
|
13
|
-
>
|
|
14
|
-
<Text style={styles.link}>View terms and conditions</Text>
|
|
15
|
-
</Pressable>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const styles = StyleSheet.create({
|
|
20
|
-
wrap: { paddingHorizontal: 20, paddingVertical: 4 },
|
|
21
|
-
link: {
|
|
22
|
-
fontFamily: FONT_FAMILY,
|
|
23
|
-
fontSize: 14,
|
|
24
|
-
color: Colors.spareBlue,
|
|
25
|
-
textDecorationLine: 'underline',
|
|
26
|
-
},
|
|
27
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore } from 'react';
|
|
2
|
-
import type { PaymentFlowController } from '../../core/services/payment-flow-controller';
|
|
3
|
-
import type { PaymentFlowState } from '../../core/services/payment-flow-state';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* React hook that bridges {@link PaymentFlowController}'s observable to the
|
|
7
|
-
* component tree via `useSyncExternalStore`. Re-renders when the controller
|
|
8
|
-
* notifies a new state.
|
|
9
|
-
*/
|
|
10
|
-
export function usePaymentFlowState(controller: PaymentFlowController): PaymentFlowState {
|
|
11
|
-
return useSyncExternalStore(
|
|
12
|
-
(notify) => controller.subscribe(notify),
|
|
13
|
-
() => controller.state,
|
|
14
|
-
() => controller.state,
|
|
15
|
-
);
|
|
16
|
-
}
|