@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
|
@@ -2,55 +2,54 @@ import type { PaymentResult } from './payment-result.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Lifecycle events emitted on {@link SpareLink.events}.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Analytics only — never required to drive the flow. This is a discriminated
|
|
6
|
+
* union (TypeScript's equivalent to Dart sealed classes); switch on `type` for
|
|
7
|
+
* exhaustive handling:
|
|
7
8
|
*
|
|
8
9
|
* ```ts
|
|
9
10
|
* spareLink.events.subscribe((event) => {
|
|
10
11
|
* switch (event.type) {
|
|
11
12
|
* case 'initialized':
|
|
12
|
-
* console.log('Started flow for', event.
|
|
13
|
+
* console.log('Started flow for', event.reference);
|
|
13
14
|
* break;
|
|
14
|
-
* case '
|
|
15
|
-
* console.log('
|
|
15
|
+
* case 'pageReady':
|
|
16
|
+
* console.log('Payer can act on the page');
|
|
16
17
|
* break;
|
|
17
18
|
* case 'succeeded':
|
|
18
|
-
* console.log('
|
|
19
|
+
* console.log('Reported success for', event.result.reference);
|
|
19
20
|
* break;
|
|
20
21
|
* // ...
|
|
21
22
|
* }
|
|
22
23
|
* });
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
|
-
export type SpareLinkEvent = SpareLinkInitialized |
|
|
26
|
+
export type SpareLinkEvent = SpareLinkInitialized | SpareLinkPageReady | SpareLinkRedirectToBank | SpareLinkBankCallbackReceived | SpareLinkSucceeded | SpareLinkFailed | SpareLinkCancelled | SpareLinkAbandoned;
|
|
26
27
|
/** The SDK has started a payment flow. */
|
|
27
28
|
export interface SpareLinkInitialized {
|
|
28
29
|
readonly type: 'initialized';
|
|
29
|
-
readonly
|
|
30
|
+
readonly reference: string;
|
|
30
31
|
}
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
readonly type: 'consentStarted';
|
|
41
|
-
readonly linkToken: string;
|
|
32
|
+
/**
|
|
33
|
+
* The hosted page is interactive and the payer has something to act on.
|
|
34
|
+
*
|
|
35
|
+
* The steps after this — choosing a bank, the payee check, reading the consent —
|
|
36
|
+
* happen inside the page, which does not report them.
|
|
37
|
+
*/
|
|
38
|
+
export interface SpareLinkPageReady {
|
|
39
|
+
readonly type: 'pageReady';
|
|
40
|
+
readonly reference: string;
|
|
42
41
|
}
|
|
43
|
-
/** The
|
|
42
|
+
/** The payer is being handed to their bank, outside the WebView. */
|
|
44
43
|
export interface SpareLinkRedirectToBank {
|
|
45
44
|
readonly type: 'redirectToBank';
|
|
46
|
-
readonly
|
|
45
|
+
readonly reference: string;
|
|
47
46
|
}
|
|
48
47
|
/** The bank has redirected back with a callback URI. */
|
|
49
48
|
export interface SpareLinkBankCallbackReceived {
|
|
50
49
|
readonly type: 'bankCallbackReceived';
|
|
51
|
-
readonly
|
|
50
|
+
readonly reference: string;
|
|
52
51
|
}
|
|
53
|
-
/** The
|
|
52
|
+
/** The return reported a completed payment and the flow is about to resolve. */
|
|
54
53
|
export interface SpareLinkSucceeded {
|
|
55
54
|
readonly type: 'succeeded';
|
|
56
55
|
readonly result: PaymentResult;
|
|
@@ -60,28 +59,27 @@ export interface SpareLinkFailed {
|
|
|
60
59
|
readonly type: 'failed';
|
|
61
60
|
readonly result: PaymentResult;
|
|
62
61
|
}
|
|
63
|
-
/** The
|
|
62
|
+
/** The payer cancelled the payment and the flow is about to resolve. */
|
|
64
63
|
export interface SpareLinkCancelled {
|
|
65
64
|
readonly type: 'cancelled';
|
|
66
65
|
readonly result: PaymentResult;
|
|
67
66
|
}
|
|
68
|
-
/** The
|
|
67
|
+
/** The payer left before the flow resolved either way. */
|
|
69
68
|
export interface SpareLinkAbandoned {
|
|
70
69
|
readonly type: 'abandoned';
|
|
71
70
|
readonly result: PaymentResult;
|
|
72
71
|
}
|
|
73
72
|
/** All possible event type strings for type narrowing. */
|
|
74
|
-
export declare const SPARE_LINK_EVENT_TYPES: readonly ["initialized", "
|
|
73
|
+
export declare const SPARE_LINK_EVENT_TYPES: readonly ["initialized", "pageReady", "redirectToBank", "bankCallbackReceived", "succeeded", "failed", "cancelled", "abandoned"];
|
|
75
74
|
export type SpareLinkEventType = (typeof SPARE_LINK_EVENT_TYPES)[number];
|
|
76
75
|
/** Type guard for SpareLinkEvent. */
|
|
77
76
|
export declare function isSpareLinkEvent(value: unknown): value is SpareLinkEvent;
|
|
78
77
|
/** Factory functions for creating events (internal use). */
|
|
79
78
|
export declare const SpareLinkEvents: {
|
|
80
|
-
readonly initialized: (
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
readonly bankCallbackReceived: (linkToken: string) => SpareLinkBankCallbackReceived;
|
|
79
|
+
readonly initialized: (reference: string) => SpareLinkInitialized;
|
|
80
|
+
readonly pageReady: (reference: string) => SpareLinkPageReady;
|
|
81
|
+
readonly redirectToBank: (reference: string) => SpareLinkRedirectToBank;
|
|
82
|
+
readonly bankCallbackReceived: (reference: string) => SpareLinkBankCallbackReceived;
|
|
85
83
|
readonly succeeded: (result: PaymentResult) => SpareLinkSucceeded;
|
|
86
84
|
readonly failed: (result: PaymentResult) => SpareLinkFailed;
|
|
87
85
|
readonly cancelled: (result: PaymentResult) => SpareLinkCancelled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link-event.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"spare-link-event.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,kBAAkB,GAClB,uBAAuB,GACvB,6BAA6B,GAC7B,kBAAkB,GAClB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,CAAC;AAEvB,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wDAAwD;AACxD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,kIASzB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,qCAAqC;AACrC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAIxE;AAED,4DAA4D;AAC5D,eAAO,MAAM,eAAe;sCACH,MAAM,KAAG,oBAAoB;oCAG/B,MAAM,KAAG,kBAAkB;yCAGtB,MAAM,KAAG,uBAAuB;+CAG1B,MAAM,KAAG,6BAA6B;iCAGpD,aAAa,KAAG,kBAAkB;8BAGrC,aAAa,KAAG,eAAe;iCAG5B,aAAa,KAAG,kBAAkB;iCAGlC,aAAa,KAAG,kBAAkB;CAG5C,CAAC"}
|
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
import type { PaymentResult } from './payment-result.js';
|
|
2
2
|
import type { RecoveryResult } from './recovery-result.js';
|
|
3
|
-
import type { SpareLinkSession } from './spare-link-session.js';
|
|
4
3
|
/**
|
|
5
4
|
* Imperative API the {@link SpareLinkHost} mounts and wires to a
|
|
6
5
|
* {@link SpareLink} instance.
|
|
7
6
|
*
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
10
|
-
export interface SpareLinkHostApi {
|
|
11
|
-
start(args: {
|
|
12
|
-
linkToken: string;
|
|
13
|
-
}): Promise<SpareLinkSession>;
|
|
14
|
-
handleRedirect(uri: URL | string): Promise<boolean>;
|
|
15
|
-
resumeIfNeeded(): Promise<RecoveryResult>;
|
|
16
|
-
isFlowActive(): boolean;
|
|
17
|
-
}
|
|
18
|
-
/** @internal */
|
|
19
9
|
export interface SpareLinkHostDelegate {
|
|
20
10
|
startFlow(args: {
|
|
21
|
-
|
|
11
|
+
reference: string;
|
|
22
12
|
resolve: (result: PaymentResult) => void;
|
|
23
|
-
onSessionLoaded?: (linkSessionId: string) => void;
|
|
24
13
|
}): void;
|
|
25
14
|
handleRedirect(uri: URL | string): Promise<boolean>;
|
|
26
15
|
resumeIfNeeded(): Promise<RecoveryResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link-host-api.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-host-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"spare-link-host-api.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-host-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACvF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1C,YAAY,IAAI,OAAO,CAAC;CACzB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PendingSessionStore } from '../core/services/pending-session-store.js';
|
|
2
2
|
import { type EventEmitter } from '../internal/event-emitter.js';
|
|
3
3
|
import { type PaymentResult } from './payment-result.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { NoRecoveryReason, RecoveryResult } from './recovery-result.js';
|
|
5
5
|
import { type PaymentEnvironment, type SpareApiTenant } from './spare-link-config.js';
|
|
6
6
|
import { type SpareLinkEvent } from './spare-link-event.js';
|
|
7
7
|
import type { SpareLinkHostDelegate } from './spare-link-host-api.js';
|
|
@@ -10,14 +10,15 @@ export interface SpareLinkOptions {
|
|
|
10
10
|
environment: PaymentEnvironment;
|
|
11
11
|
tenant: SpareApiTenant;
|
|
12
12
|
baseUrl?: string;
|
|
13
|
-
fetch?: typeof fetch;
|
|
14
|
-
requestTimeoutMs?: number;
|
|
15
13
|
/** Store for crash-safe recovery. Defaults to none — wire e.g. `SecureStorePendingSessionStore`. */
|
|
16
14
|
pendingSessionStore?: PendingSessionStore;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
19
|
-
* Entry point for the Spare Link payment SDK
|
|
20
|
-
*
|
|
17
|
+
* Entry point for the Spare Link payment SDK.
|
|
18
|
+
*
|
|
19
|
+
* Your backend creates the payment request — with `channel: 'sdk_react_native'`
|
|
20
|
+
* and the return URLs your app is registered for — and gives the app the
|
|
21
|
+
* reference it returns. That reference is all this SDK needs.
|
|
21
22
|
*
|
|
22
23
|
* Mount {@link SpareLinkHost} once near your app root and pass this instance:
|
|
23
24
|
*
|
|
@@ -31,13 +32,15 @@ export interface SpareLinkOptions {
|
|
|
31
32
|
* <App />
|
|
32
33
|
* </SpareLinkHost>
|
|
33
34
|
* ```
|
|
35
|
+
*
|
|
36
|
+
* The SDK makes no API calls of its own and holds no credentials. Every result
|
|
37
|
+
* it reports comes from a deep link that is interceptable by design, so confirm
|
|
38
|
+
* with your backend via `GET /payment-requests/{reference}` before acting on one.
|
|
34
39
|
*/
|
|
35
40
|
export declare class SpareLink {
|
|
36
41
|
readonly environment: PaymentEnvironment;
|
|
37
42
|
readonly tenant: SpareApiTenant;
|
|
38
43
|
readonly baseUrl: string | undefined;
|
|
39
|
-
readonly fetch: typeof fetch | undefined;
|
|
40
|
-
readonly requestTimeoutMs: number | undefined;
|
|
41
44
|
readonly pendingSessionStore: PendingSessionStore | undefined;
|
|
42
45
|
private readonly _events;
|
|
43
46
|
private _host;
|
|
@@ -52,17 +55,25 @@ export declare class SpareLink {
|
|
|
52
55
|
/** Returns `true` while a payment flow started via {@link start} is in progress. */
|
|
53
56
|
get isFlowActive(): boolean;
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
58
|
+
* Opens the hosted payment page for `reference` and resolves when the flow ends.
|
|
56
59
|
*
|
|
57
|
-
* Returns a {@link SpareLinkSession} immediately; await `session.result`
|
|
58
|
-
*
|
|
60
|
+
* Returns a {@link SpareLinkSession} immediately; await `session.result` for the
|
|
61
|
+
* terminal outcome. There is no session to load first: the page resolves the
|
|
62
|
+
* request itself, so the payer sees it without waiting on a round trip.
|
|
59
63
|
*/
|
|
60
64
|
start(args: {
|
|
61
|
-
|
|
65
|
+
reference: string;
|
|
62
66
|
}): Promise<SpareLinkSession>;
|
|
63
|
-
/** Processes a deep-link URI
|
|
67
|
+
/** Processes a deep-link URI the payer returned through. */
|
|
64
68
|
handleRedirect(uri: URL | string): Promise<boolean>;
|
|
65
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Reports a payment that was left in progress by a previous app session.
|
|
71
|
+
*
|
|
72
|
+
* If the return deep link arrived before the app had a flow to give it to, the
|
|
73
|
+
* outcome is resolved from it. Otherwise the SDK cannot say how the payment
|
|
74
|
+
* ended — it holds no credentials, so it has nothing to ask with — and reports
|
|
75
|
+
* `outcomeUnknown` with the reference for your backend to resolve.
|
|
76
|
+
*/
|
|
66
77
|
resumeIfNeeded(): Promise<RecoveryResult>;
|
|
67
78
|
dispose(): void;
|
|
68
79
|
/**
|
|
@@ -75,15 +86,10 @@ export declare class SpareLink {
|
|
|
75
86
|
emitEvent(event: SpareLinkEvent): void;
|
|
76
87
|
/** @internal */
|
|
77
88
|
emitTerminal(result: PaymentResult): void;
|
|
89
|
+
private _resolveImmediately;
|
|
78
90
|
private _emitTerminal;
|
|
79
91
|
private _hostStart;
|
|
80
92
|
private _drainPending;
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
export declare function mapHostRecovery(recovery: RecoveryResult | {
|
|
84
|
-
kind: 'inProgress';
|
|
85
|
-
linkToken: string;
|
|
86
|
-
}): RecoveryResult;
|
|
87
|
-
export declare function noRecovery(reason: NoRecoveryReason): RecoveryResult;
|
|
88
|
-
export { isSessionRecovered };
|
|
94
|
+
export declare function noRecovery(reason: NoRecoveryReason, reference?: string): RecoveryResult;
|
|
89
95
|
//# sourceMappingURL=spare-link-instance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link-instance.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAAwC,CAAC;AAClF,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,8BAA2B,CAAC;AAClF,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,qBAAkB,CAAC;AACxE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"spare-link-instance.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAAwC,CAAC;AAClF,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,8BAA2B,CAAC;AAClF,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,qBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AAC1E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAGpB,MAAM,wBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,uBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAsB,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,kBAAkB,CAAC;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oGAAoG;IACpG,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAgBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,SAAS;IACpB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAE9D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAChE,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsB;IACrD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAyB;IAC3D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;gBAE3C,OAAO,EAAE,gBAAgB;IAerC,+DAA+D;IAC/D,IAAI,MAAM,IAAI,YAAY,CAAC,cAAc,CAAC,CAEzC;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,oFAAoF;IACpF,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED;;;;;;OAMG;IACG,KAAK,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAqBnE,4DAA4D;IACtD,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzD;;;;;;;OAOG;IACG,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC;IAY/C,OAAO,IAAI,IAAI;IA2Bf;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,IAAI;IAQpD,gBAAgB;IAChB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAItC,gBAAgB;IAChB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAIzC,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,aAAa;YAiBP,UAAU;IAwBxB,OAAO,CAAC,aAAa;CAiBtB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAEvF"}
|
|
@@ -2,19 +2,14 @@ import type { PaymentResult } from './payment-result.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Handle for an in-flight or completed payment started via {@link SpareLink.start}.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* await `result` for the terminal outcome.
|
|
5
|
+
* `reference` is available immediately; await `result` for the terminal outcome.
|
|
7
6
|
*/
|
|
8
7
|
export declare class SpareLinkSession {
|
|
9
|
-
readonly
|
|
10
|
-
linkSessionId: string | undefined;
|
|
8
|
+
readonly reference: string;
|
|
11
9
|
readonly result: Promise<PaymentResult>;
|
|
12
10
|
constructor(args: {
|
|
13
|
-
|
|
11
|
+
reference: string;
|
|
14
12
|
result: Promise<PaymentResult>;
|
|
15
|
-
linkSessionId?: string;
|
|
16
13
|
});
|
|
17
|
-
/** Called internally when the server provides {@link linkSessionId}. */
|
|
18
|
-
updateLinkSessionId(value: string): void;
|
|
19
14
|
}
|
|
20
15
|
//# sourceMappingURL=spare-link-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link-session.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"spare-link-session.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AAEtD;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;gBAE5B,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;KAAE;CAIxE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { SpareLink,
|
|
1
|
+
export { SpareLink, noRecovery } from './spare-link-instance.js';
|
|
2
2
|
export type { SpareLinkOptions } from './spare-link-instance.js';
|
|
3
3
|
//# sourceMappingURL=spare-link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"spare-link.d.ts","sourceRoot":"","sources":["../../../../src/public/spare-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAAuB,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HostedFlowController } from '../../core/services/hosted-flow-controller.js';
|
|
2
|
+
import type { HostedFlowState } from '../../core/services/hosted-flow-state.js';
|
|
3
|
+
/**
|
|
4
|
+
* React hook that bridges {@link HostedFlowController}'s observable to the
|
|
5
|
+
* component tree via `useSyncExternalStore`. Re-renders when the controller
|
|
6
|
+
* notifies a new state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useHostedFlowState(controller: HostedFlowController): HostedFlowState;
|
|
9
|
+
//# sourceMappingURL=use-hosted-flow-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-hosted-flow-state.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/use-hosted-flow-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAAuC,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,oBAAoB,GAAG,eAAe,CAMpF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HostedFlowController } from '../../core/services/hosted-flow-controller.js';
|
|
2
|
+
export interface HostedPaymentPageProps {
|
|
3
|
+
controller: HostedFlowController;
|
|
4
|
+
/** Resolved API base URL — the hosted page is served from the same host. */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** Called once the outcome has been shown and the flow should hand back. */
|
|
7
|
+
onResolved: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The screen a payer sees for the whole flow.
|
|
11
|
+
*
|
|
12
|
+
* Most of it is the hosted page. The native screens cover the moments the page
|
|
13
|
+
* cannot: while it loads, while the payer is away at their bank, and once there is
|
|
14
|
+
* an outcome to report.
|
|
15
|
+
*/
|
|
16
|
+
export declare function HostedPaymentPage(props: HostedPaymentPageProps): JSX.Element;
|
|
17
|
+
//# sourceMappingURL=hosted-payment-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-payment-page.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hosted/hosted-payment-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA4C,CAAC;AAavF,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,oBAAoB,CAAC;IACjC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAuI5E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a navigation the WebView is about to make should be allowed.
|
|
3
|
+
*
|
|
4
|
+
* Only the hosted origin may load in-frame. Bank authentication deliberately
|
|
5
|
+
* happens in a real browser, so a bank URL arriving here means the page's handoff
|
|
6
|
+
* did not reach us — following it would put the payer on a bank page with no
|
|
7
|
+
* address bar, which is the signal they rely on to tell a real one from a copy.
|
|
8
|
+
* Kept as a plain function because the WebView does not render under Jest, and
|
|
9
|
+
* this is the part worth testing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function shouldAllowHostedNavigation(args: {
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}): boolean;
|
|
15
|
+
export interface HostedPaymentWebViewProps {
|
|
16
|
+
/** Resolved API base URL — the hosted page is served from the same host. */
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
/** The payment request this flow is paying. */
|
|
19
|
+
reference: string;
|
|
20
|
+
/**
|
|
21
|
+
* Called with each raw message the page posts. Parsing belongs to the caller so
|
|
22
|
+
* this component stays a transport.
|
|
23
|
+
*/
|
|
24
|
+
onBridgeMessage: (message: unknown) => void;
|
|
25
|
+
/** Called when the page itself could not be loaded. */
|
|
26
|
+
onLoadFailure?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Called once this webview is on screen.
|
|
29
|
+
*
|
|
30
|
+
* Starts the clock the page has to become interactive, measured from here so
|
|
31
|
+
* that whatever the host did before rendering is not charged against it.
|
|
32
|
+
*/
|
|
33
|
+
onMounted?: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hosts the hosted payment page.
|
|
37
|
+
*
|
|
38
|
+
* The page owns bank selection, the payee check and the consent screen, so this
|
|
39
|
+
* component carries no payment logic of its own: it loads one URL, forwards what
|
|
40
|
+
* the page reports, and refuses to navigate anywhere else.
|
|
41
|
+
*/
|
|
42
|
+
export declare function HostedPaymentWebView(props: HostedPaymentWebViewProps): JSX.Element;
|
|
43
|
+
//# sourceMappingURL=hosted-payment-webview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-payment-webview.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hosted/hosted-payment-webview.tsx"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE3F;AAED,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,CA4FlF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { ConsentDetailsScreen, type ConsentDetailsScreenProps } from './consent-details-screen.js';
|
|
1
|
+
export { PageUnavailableScreen, type PageUnavailableScreenProps, } from './page-unavailable-screen.js';
|
|
3
2
|
export { RedirectHandoffScreen } from './redirect-handoff-screen.js';
|
|
4
3
|
export { ResumeProcessingScreen, type ResumeProcessingScreenProps, } from './resume-processing-screen.js';
|
|
5
4
|
export { ResultScreen, type ResultScreenProps } from './result-screen.js';
|
|
6
|
-
export { MandateSetupSuccessScreen, type MandateSetupSuccessScreenProps, } from './mandate-setup-success-screen.js';
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,8BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA2B,CAAC;AAClE,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,+BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAiB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PageUnavailableScreenProps {
|
|
2
|
+
/** Asks for the payment page again. */
|
|
3
|
+
onRetry: () => void;
|
|
4
|
+
/** Gives up and hands the outcome back to the caller. */
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Shown when the payment page could not be loaded, or loaded and never became
|
|
9
|
+
* interactive.
|
|
10
|
+
*
|
|
11
|
+
* It deliberately does not say the payment failed. Nothing has been attempted at
|
|
12
|
+
* this point — no consent, no bank, no money — and telling a payer their payment
|
|
13
|
+
* failed when the app could not open the page is the one thing they must not be
|
|
14
|
+
* told. It says what is true, says nothing has been taken, and offers the page
|
|
15
|
+
* again, because an unreachable service is usually unreachable briefly.
|
|
16
|
+
*/
|
|
17
|
+
export declare function PageUnavailableScreen(props: PageUnavailableScreenProps): JSX.Element;
|
|
18
|
+
//# sourceMappingURL=page-unavailable-screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-unavailable-screen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/page-unavailable-screen.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,0BAA0B;IACzC,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,GAAG,CAAC,OAAO,CA8BpF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BankLauncher } from '../core/services/hosted-flow-controller.js';
|
|
1
2
|
import type { PendingSessionStore } from '../core/services/pending-session-store.js';
|
|
2
3
|
import { type SpareLink } from '../public/spare-link-instance.js';
|
|
3
4
|
export interface SpareLinkHostProps {
|
|
@@ -8,16 +9,14 @@ export interface SpareLinkHostProps {
|
|
|
8
9
|
* When omitted, uses `spareLink.pendingSessionStore`.
|
|
9
10
|
*/
|
|
10
11
|
pendingSessionStore?: PendingSessionStore;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
mobileAppUrl?: string;
|
|
14
|
-
}) => Promise<void>;
|
|
12
|
+
/** Override how a bank authorization URL is opened. Tests inject a fake. */
|
|
13
|
+
launchBankRedirect?: BankLauncher;
|
|
15
14
|
showDismissButton?: boolean;
|
|
16
15
|
children?: React.ReactNode;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Host component that mounts the SDK modal and connects a {@link SpareLink}
|
|
20
|
-
* instance —
|
|
19
|
+
* instance — one instance, one host.
|
|
21
20
|
*/
|
|
22
21
|
export declare function SpareLinkHost(props: SpareLinkHostProps): JSX.Element;
|
|
23
22
|
//# sourceMappingURL=spare-link-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spare-link-host.d.ts","sourceRoot":"","sources":["../../../../src/ui/spare-link-host.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spare-link-host.d.ts","sourceRoot":"","sources":["../../../../src/ui/spare-link-host.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,4CAAyC,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAAwC,CAAC;AAYlF,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,kCAA+B,CAAC;AAgB3E,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,YAAY,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAmSpE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { CustomStepper, type CustomStepperProps } from './stepper.js';
|
|
2
|
-
export { LayoutWHeader, type LayoutWHeaderProps } from './layout-w-header.js';
|
|
3
1
|
export { Footer, type FooterProps } from './footer.js';
|
|
4
2
|
export { GradientSpinner, type GradientSpinnerProps } from './gradient-spinner.js';
|
|
5
3
|
export { HandoffScreenLayout, type HandoffScreenLayoutProps } from './handoff-screen-layout.js';
|
|
4
|
+
export { ModalDismissButton, type ModalDismissButtonProps } from './modal-dismiss-button.js';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAU,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAAyB,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAAwB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SDK version reported in telemetry and the default User-Agent.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* SDK version reported in telemetry and the default User-Agent.
|
|
3
|
+
*
|
|
4
|
+
* GENERATED FILE — do not edit by hand. Written from package.json by
|
|
5
|
+
* scripts/sync-sdk-version.mjs (run by the root `version` npm script after
|
|
6
|
+
* `changeset version`). The src/index.ts smoke test asserts this matches
|
|
7
|
+
* package.json's version.
|
|
6
8
|
*/
|
|
7
|
-
export declare const SDK_VERSION: "
|
|
9
|
+
export declare const SDK_VERSION: "1.0.0";
|
|
8
10
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAG,OAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spare-technologies/spare-link",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "React Native SDK for Spare Link — open
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native SDK for Spare Link — open-banking payments for iOS and Android.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/module/index.d.ts",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"plugins",
|
|
29
29
|
"assets",
|
|
30
30
|
"README.md",
|
|
31
|
-
"CHANGELOG.md",
|
|
32
31
|
"LICENSE",
|
|
33
32
|
"!src/**/*.test.ts",
|
|
34
33
|
"!src/**/*.test.tsx",
|
|
@@ -36,9 +35,9 @@
|
|
|
36
35
|
"!src/**/*.spec.tsx"
|
|
37
36
|
],
|
|
38
37
|
"scripts": {
|
|
39
|
-
"test": "jest",
|
|
38
|
+
"test": "jest --forceExit",
|
|
40
39
|
"test:watch": "jest --watch",
|
|
41
|
-
"test:ci": "jest --ci --coverage",
|
|
40
|
+
"test:ci": "jest --ci --coverage --forceExit",
|
|
42
41
|
"typecheck": "tsc --noEmit",
|
|
43
42
|
"clean": "del-cli lib",
|
|
44
43
|
"build": "bob build",
|
|
@@ -82,42 +81,44 @@
|
|
|
82
81
|
"access": "public"
|
|
83
82
|
},
|
|
84
83
|
"peerDependencies": {
|
|
85
|
-
"expo": "
|
|
86
|
-
"expo
|
|
87
|
-
"expo-font": "
|
|
88
|
-
"expo-linear-gradient": "
|
|
89
|
-
"expo-
|
|
90
|
-
"expo-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"react": "
|
|
94
|
-
"react-native": "
|
|
95
|
-
"react-native-
|
|
96
|
-
"react-native-
|
|
97
|
-
|
|
84
|
+
"@expo/vector-icons": "~14.0.0",
|
|
85
|
+
"expo": ">=52.0.0 <53.0.0",
|
|
86
|
+
"expo-font": "~13.0.0",
|
|
87
|
+
"expo-linear-gradient": "~14.0.0",
|
|
88
|
+
"expo-secure-store": "~14.0.0",
|
|
89
|
+
"expo-web-browser": "~14.0.0",
|
|
90
|
+
"react": ">=18.3.0 <19.0.0",
|
|
91
|
+
"react-native": ">=0.76.0 <0.77.0",
|
|
92
|
+
"react-native-safe-area-context": "~4.12.0",
|
|
93
|
+
"react-native-webview": "~13.12.5",
|
|
94
|
+
"react-native-screens": "~4.4.0",
|
|
95
|
+
"react-native-svg": "^15.8.0"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"react-native-svg": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
98
101
|
},
|
|
99
102
|
"devDependencies": {
|
|
100
|
-
"@spare-technologies/link-test-harness": "workspace:*",
|
|
101
103
|
"@testing-library/jest-native": "^5.4.3",
|
|
102
104
|
"@testing-library/react-native": "^13.0.0",
|
|
103
105
|
"@types/jest": "^29.5.13",
|
|
104
106
|
"@types/react": "~18.3.0",
|
|
105
107
|
"del-cli": "^7.0.0",
|
|
106
108
|
"expo": "~52.0.0",
|
|
107
|
-
"expo-device": "~7.0.0",
|
|
108
109
|
"expo-font": "~13.0.0",
|
|
109
110
|
"expo-linear-gradient": "~14.0.0",
|
|
110
111
|
"expo-linking": "~7.0.0",
|
|
111
|
-
"expo-location": "~18.0.0",
|
|
112
112
|
"expo-secure-store": "~14.0.0",
|
|
113
113
|
"expo-web-browser": "~14.0.0",
|
|
114
114
|
"jest": "^29.7.0",
|
|
115
115
|
"jest-expo": "~52.0.0",
|
|
116
116
|
"react": "18.3.1",
|
|
117
|
-
"react-native": "0.76.
|
|
117
|
+
"react-native": "0.76.9",
|
|
118
118
|
"react-native-builder-bob": "^0.43.0",
|
|
119
119
|
"react-native-safe-area-context": "~4.12.0",
|
|
120
|
-
"react-native-
|
|
120
|
+
"react-native-webview": "~13.12.5",
|
|
121
|
+
"react-native-screens": "~4.4.0",
|
|
121
122
|
"react-test-renderer": "18.3.1",
|
|
122
123
|
"typescript": "^5.6.2"
|
|
123
124
|
}
|