@spare-technologies/spare-link 0.1.0-beta.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/CHANGELOG.md +66 -0
- package/LICENSE +21 -0
- package/README.md +173 -0
- package/assets/fonts/MetroSans-Bold.otf +0 -0
- package/assets/fonts/MetroSans-Light.otf +0 -0
- package/assets/fonts/MetroSans-Medium.otf +0 -0
- package/assets/fonts/MetroSans-Regular.otf +0 -0
- package/assets/fonts/MetroSans-SemiBold.otf +0 -0
- package/assets/images/altareq_logo_mini.png +0 -0
- package/assets/images/altareq_logo_transparent_bg.png +0 -0
- package/assets/images/altareq_logo_white_bg.png +0 -0
- package/assets/images/spare_logo.png +0 -0
- package/lib/commonjs/core/client/link-api-client.js +297 -0
- package/lib/commonjs/core/client/link-api-client.js.map +1 -0
- package/lib/commonjs/core/errors/payment-api-error.js +35 -0
- package/lib/commonjs/core/errors/payment-api-error.js.map +1 -0
- package/lib/commonjs/core/models/index.js +2 -0
- package/lib/commonjs/core/models/index.js.map +1 -0
- package/lib/commonjs/core/models/link-session-status.js +14 -0
- package/lib/commonjs/core/models/link-session-status.js.map +1 -0
- package/lib/commonjs/core/models/payment-return-params.js +42 -0
- package/lib/commonjs/core/models/payment-return-params.js.map +1 -0
- package/lib/commonjs/core/models/payment-type.js +45 -0
- package/lib/commonjs/core/models/payment-type.js.map +1 -0
- package/lib/commonjs/core/models/wire-mappers.js +277 -0
- package/lib/commonjs/core/models/wire-mappers.js.map +1 -0
- package/lib/commonjs/core/services/consent-presenter.js +150 -0
- package/lib/commonjs/core/services/consent-presenter.js.map +1 -0
- package/lib/commonjs/core/services/execute-resume-if-needed.js +216 -0
- package/lib/commonjs/core/services/execute-resume-if-needed.js.map +1 -0
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js +151 -0
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js.map +1 -0
- package/lib/commonjs/core/services/payment-flow-controller.js +547 -0
- package/lib/commonjs/core/services/payment-flow-controller.js.map +1 -0
- package/lib/commonjs/core/services/payment-flow-state.js +110 -0
- package/lib/commonjs/core/services/payment-flow-state.js.map +1 -0
- package/lib/commonjs/core/services/payment-result-mapper.js +49 -0
- package/lib/commonjs/core/services/payment-result-mapper.js.map +1 -0
- package/lib/commonjs/core/services/pending-session-store.js +6 -0
- package/lib/commonjs/core/services/pending-session-store.js.map +1 -0
- package/lib/commonjs/core/services/presentation-utils.js +11 -0
- package/lib/commonjs/core/services/presentation-utils.js.map +1 -0
- package/lib/commonjs/core/services/redirect-buffer.js +40 -0
- package/lib/commonjs/core/services/redirect-buffer.js.map +1 -0
- package/lib/commonjs/core/services/user-friendly-messages.js +46 -0
- package/lib/commonjs/core/services/user-friendly-messages.js.map +1 -0
- package/lib/commonjs/index.js +294 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal/bank-redirect.js +53 -0
- package/lib/commonjs/internal/bank-redirect.js.map +1 -0
- package/lib/commonjs/internal/deep-link-listener.js +39 -0
- package/lib/commonjs/internal/deep-link-listener.js.map +1 -0
- package/lib/commonjs/internal/event-emitter.js +36 -0
- package/lib/commonjs/internal/event-emitter.js.map +1 -0
- package/lib/commonjs/internal/index.js +34 -0
- package/lib/commonjs/internal/index.js.map +1 -0
- package/lib/commonjs/internal/logger.js +67 -0
- package/lib/commonjs/internal/logger.js.map +1 -0
- package/lib/commonjs/internal/redact-uri.js +25 -0
- package/lib/commonjs/internal/redact-uri.js.map +1 -0
- package/lib/commonjs/internal/secure-store-pending-session-store.js +92 -0
- package/lib/commonjs/internal/secure-store-pending-session-store.js.map +1 -0
- package/lib/commonjs/internal/telemetry-collector.js +80 -0
- package/lib/commonjs/internal/telemetry-collector.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/public/constants.js +21 -0
- package/lib/commonjs/public/constants.js.map +1 -0
- package/lib/commonjs/public/index.js +152 -0
- package/lib/commonjs/public/index.js.map +1 -0
- package/lib/commonjs/public/payment-result.js +48 -0
- package/lib/commonjs/public/payment-result.js.map +1 -0
- package/lib/commonjs/public/recovery-result.js +40 -0
- package/lib/commonjs/public/recovery-result.js.map +1 -0
- package/lib/commonjs/public/spare-link-callbacks.js +6 -0
- package/lib/commonjs/public/spare-link-callbacks.js.map +1 -0
- package/lib/commonjs/public/spare-link-config.js +62 -0
- package/lib/commonjs/public/spare-link-config.js.map +1 -0
- package/lib/commonjs/public/spare-link-event.js +120 -0
- package/lib/commonjs/public/spare-link-event.js.map +1 -0
- package/lib/commonjs/public/spare-link-host-api.js +6 -0
- package/lib/commonjs/public/spare-link-host-api.js.map +1 -0
- package/lib/commonjs/public/spare-link-instance.js +285 -0
- package/lib/commonjs/public/spare-link-instance.js.map +1 -0
- package/lib/commonjs/public/spare-link-session.js +26 -0
- package/lib/commonjs/public/spare-link-session.js.map +1 -0
- package/lib/commonjs/public/spare-link.js +31 -0
- package/lib/commonjs/public/spare-link.js.map +1 -0
- package/lib/commonjs/ui/consent/charge-bearer-display.js +99 -0
- package/lib/commonjs/ui/consent/charge-bearer-display.js.map +1 -0
- package/lib/commonjs/ui/consent/consent-accordion.js +94 -0
- package/lib/commonjs/ui/consent/consent-accordion.js.map +1 -0
- package/lib/commonjs/ui/consent/consent-summary-section.js +27 -0
- package/lib/commonjs/ui/consent/consent-summary-section.js.map +1 -0
- package/lib/commonjs/ui/consent/cop-information.js +168 -0
- package/lib/commonjs/ui/consent/cop-information.js.map +1 -0
- package/lib/commonjs/ui/consent/international-payment-summary.js +98 -0
- package/lib/commonjs/ui/consent/international-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/label-value-rows.js +59 -0
- package/lib/commonjs/ui/consent/label-value-rows.js.map +1 -0
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js +130 -0
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js.map +1 -0
- package/lib/commonjs/ui/consent/multi-payment-summary.js +99 -0
- package/lib/commonjs/ui/consent/multi-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/single-payment-summary.js +158 -0
- package/lib/commonjs/ui/consent/single-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/terms-link.js +35 -0
- package/lib/commonjs/ui/consent/terms-link.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-payment-flow-state.js +16 -0
- package/lib/commonjs/ui/hooks/use-payment-flow-state.js.map +1 -0
- package/lib/commonjs/ui/payment-flow-page.js +235 -0
- package/lib/commonjs/ui/payment-flow-page.js.map +1 -0
- package/lib/commonjs/ui/screens/bank-selection-screen.js +215 -0
- package/lib/commonjs/ui/screens/bank-selection-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/consent-details-screen.js +124 -0
- package/lib/commonjs/ui/screens/consent-details-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/index.js +48 -0
- package/lib/commonjs/ui/screens/index.js.map +1 -0
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js +79 -0
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/redirect-handoff-screen.js +42 -0
- package/lib/commonjs/ui/screens/redirect-handoff-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/result-screen.js +83 -0
- package/lib/commonjs/ui/screens/result-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/resume-processing-screen.js +109 -0
- package/lib/commonjs/ui/screens/resume-processing-screen.js.map +1 -0
- package/lib/commonjs/ui/spare-link-host.js +354 -0
- package/lib/commonjs/ui/spare-link-host.js.map +1 -0
- package/lib/commonjs/ui/theme/assets.js +20 -0
- package/lib/commonjs/ui/theme/assets.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +36 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/fonts.js +29 -0
- package/lib/commonjs/ui/theme/fonts.js.map +1 -0
- package/lib/commonjs/ui/theme/index.js +53 -0
- package/lib/commonjs/ui/theme/index.js.map +1 -0
- package/lib/commonjs/ui/theme/typography.js +76 -0
- package/lib/commonjs/ui/theme/typography.js.map +1 -0
- package/lib/commonjs/ui/widgets/footer.js +144 -0
- package/lib/commonjs/ui/widgets/footer.js.map +1 -0
- package/lib/commonjs/ui/widgets/gradient-spinner.js +172 -0
- package/lib/commonjs/ui/widgets/gradient-spinner.js.map +1 -0
- package/lib/commonjs/ui/widgets/handoff-screen-layout.js +77 -0
- package/lib/commonjs/ui/widgets/handoff-screen-layout.js.map +1 -0
- package/lib/commonjs/ui/widgets/index.js +41 -0
- package/lib/commonjs/ui/widgets/index.js.map +1 -0
- package/lib/commonjs/ui/widgets/layout-w-header.js +106 -0
- package/lib/commonjs/ui/widgets/layout-w-header.js.map +1 -0
- package/lib/commonjs/ui/widgets/modal-dismiss-button.js +47 -0
- package/lib/commonjs/ui/widgets/modal-dismiss-button.js.map +1 -0
- package/lib/commonjs/ui/widgets/stepper.js +124 -0
- package/lib/commonjs/ui/widgets/stepper.js.map +1 -0
- package/lib/commonjs/version.js +14 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/core/client/link-api-client.js +292 -0
- package/lib/module/core/client/link-api-client.js.map +1 -0
- package/lib/module/core/errors/payment-api-error.js +29 -0
- package/lib/module/core/errors/payment-api-error.js.map +1 -0
- package/lib/module/core/models/index.js +2 -0
- package/lib/module/core/models/index.js.map +1 -0
- package/lib/module/core/models/link-session-status.js +10 -0
- package/lib/module/core/models/link-session-status.js.map +1 -0
- package/lib/module/core/models/payment-return-params.js +37 -0
- package/lib/module/core/models/payment-return-params.js.map +1 -0
- package/lib/module/core/models/payment-type.js +36 -0
- package/lib/module/core/models/payment-type.js.map +1 -0
- package/lib/module/core/models/wire-mappers.js +263 -0
- package/lib/module/core/models/wire-mappers.js.map +1 -0
- package/lib/module/core/services/consent-presenter.js +140 -0
- package/lib/module/core/services/consent-presenter.js.map +1 -0
- package/lib/module/core/services/execute-resume-if-needed.js +211 -0
- package/lib/module/core/services/execute-resume-if-needed.js.map +1 -0
- package/lib/module/core/services/multi-payment-rules-presenter.js +146 -0
- package/lib/module/core/services/multi-payment-rules-presenter.js.map +1 -0
- package/lib/module/core/services/payment-flow-controller.js +544 -0
- package/lib/module/core/services/payment-flow-controller.js.map +1 -0
- package/lib/module/core/services/payment-flow-state.js +106 -0
- package/lib/module/core/services/payment-flow-state.js.map +1 -0
- package/lib/module/core/services/payment-result-mapper.js +45 -0
- package/lib/module/core/services/payment-result-mapper.js.map +1 -0
- package/lib/module/core/services/pending-session-store.js +4 -0
- package/lib/module/core/services/pending-session-store.js.map +1 -0
- package/lib/module/core/services/presentation-utils.js +7 -0
- package/lib/module/core/services/presentation-utils.js.map +1 -0
- package/lib/module/core/services/redirect-buffer.js +33 -0
- package/lib/module/core/services/redirect-buffer.js.map +1 -0
- package/lib/module/core/services/user-friendly-messages.js +42 -0
- package/lib/module/core/services/user-friendly-messages.js.map +1 -0
- package/lib/module/index.js +40 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/bank-redirect.js +49 -0
- package/lib/module/internal/bank-redirect.js.map +1 -0
- package/lib/module/internal/deep-link-listener.js +34 -0
- package/lib/module/internal/deep-link-listener.js.map +1 -0
- package/lib/module/internal/event-emitter.js +32 -0
- package/lib/module/internal/event-emitter.js.map +1 -0
- package/lib/module/internal/index.js +7 -0
- package/lib/module/internal/index.js.map +1 -0
- package/lib/module/internal/logger.js +61 -0
- package/lib/module/internal/logger.js.map +1 -0
- package/lib/module/internal/redact-uri.js +21 -0
- package/lib/module/internal/redact-uri.js.map +1 -0
- package/lib/module/internal/secure-store-pending-session-store.js +88 -0
- package/lib/module/internal/secure-store-pending-session-store.js.map +1 -0
- package/lib/module/internal/telemetry-collector.js +75 -0
- package/lib/module/internal/telemetry-collector.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/public/constants.js +17 -0
- package/lib/module/public/constants.js.map +1 -0
- package/lib/module/public/index.js +11 -0
- package/lib/module/public/index.js.map +1 -0
- package/lib/module/public/payment-result.js +41 -0
- package/lib/module/public/payment-result.js.map +1 -0
- package/lib/module/public/recovery-result.js +34 -0
- package/lib/module/public/recovery-result.js.map +1 -0
- package/lib/module/public/spare-link-callbacks.js +4 -0
- package/lib/module/public/spare-link-callbacks.js.map +1 -0
- package/lib/module/public/spare-link-config.js +54 -0
- package/lib/module/public/spare-link-config.js.map +1 -0
- package/lib/module/public/spare-link-event.js +115 -0
- package/lib/module/public/spare-link-event.js.map +1 -0
- package/lib/module/public/spare-link-host-api.js +4 -0
- package/lib/module/public/spare-link-host-api.js.map +1 -0
- package/lib/module/public/spare-link-instance.js +273 -0
- package/lib/module/public/spare-link-instance.js.map +1 -0
- package/lib/module/public/spare-link-session.js +21 -0
- package/lib/module/public/spare-link-session.js.map +1 -0
- package/lib/module/public/spare-link.js +4 -0
- package/lib/module/public/spare-link.js.map +1 -0
- package/lib/module/ui/consent/charge-bearer-display.js +95 -0
- package/lib/module/ui/consent/charge-bearer-display.js.map +1 -0
- package/lib/module/ui/consent/consent-accordion.js +90 -0
- package/lib/module/ui/consent/consent-accordion.js.map +1 -0
- package/lib/module/ui/consent/consent-summary-section.js +23 -0
- package/lib/module/ui/consent/consent-summary-section.js.map +1 -0
- package/lib/module/ui/consent/cop-information.js +165 -0
- package/lib/module/ui/consent/cop-information.js.map +1 -0
- package/lib/module/ui/consent/international-payment-summary.js +94 -0
- package/lib/module/ui/consent/international-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/label-value-rows.js +55 -0
- package/lib/module/ui/consent/label-value-rows.js.map +1 -0
- package/lib/module/ui/consent/multi-payment-rules-list.js +125 -0
- package/lib/module/ui/consent/multi-payment-rules-list.js.map +1 -0
- package/lib/module/ui/consent/multi-payment-summary.js +95 -0
- package/lib/module/ui/consent/multi-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/single-payment-summary.js +154 -0
- package/lib/module/ui/consent/single-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/terms-link.js +31 -0
- package/lib/module/ui/consent/terms-link.js.map +1 -0
- package/lib/module/ui/hooks/use-payment-flow-state.js +12 -0
- package/lib/module/ui/hooks/use-payment-flow-state.js.map +1 -0
- package/lib/module/ui/payment-flow-page.js +232 -0
- package/lib/module/ui/payment-flow-page.js.map +1 -0
- package/lib/module/ui/screens/bank-selection-screen.js +211 -0
- package/lib/module/ui/screens/bank-selection-screen.js.map +1 -0
- package/lib/module/ui/screens/consent-details-screen.js +120 -0
- package/lib/module/ui/screens/consent-details-screen.js.map +1 -0
- package/lib/module/ui/screens/index.js +9 -0
- package/lib/module/ui/screens/index.js.map +1 -0
- package/lib/module/ui/screens/mandate-setup-success-screen.js +75 -0
- package/lib/module/ui/screens/mandate-setup-success-screen.js.map +1 -0
- package/lib/module/ui/screens/redirect-handoff-screen.js +39 -0
- package/lib/module/ui/screens/redirect-handoff-screen.js.map +1 -0
- package/lib/module/ui/screens/result-screen.js +79 -0
- package/lib/module/ui/screens/result-screen.js.map +1 -0
- package/lib/module/ui/screens/resume-processing-screen.js +105 -0
- package/lib/module/ui/screens/resume-processing-screen.js.map +1 -0
- package/lib/module/ui/spare-link-host.js +350 -0
- package/lib/module/ui/spare-link-host.js.map +1 -0
- package/lib/module/ui/theme/assets.js +16 -0
- package/lib/module/ui/theme/assets.js.map +1 -0
- package/lib/module/ui/theme/colors.js +32 -0
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/fonts.js +23 -0
- package/lib/module/ui/theme/fonts.js.map +1 -0
- package/lib/module/ui/theme/index.js +13 -0
- package/lib/module/ui/theme/index.js.map +1 -0
- package/lib/module/ui/theme/typography.js +49 -0
- package/lib/module/ui/theme/typography.js.map +1 -0
- package/lib/module/ui/widgets/footer.js +140 -0
- package/lib/module/ui/widgets/footer.js.map +1 -0
- package/lib/module/ui/widgets/gradient-spinner.js +168 -0
- package/lib/module/ui/widgets/gradient-spinner.js.map +1 -0
- package/lib/module/ui/widgets/handoff-screen-layout.js +73 -0
- package/lib/module/ui/widgets/handoff-screen-layout.js.map +1 -0
- package/lib/module/ui/widgets/index.js +8 -0
- package/lib/module/ui/widgets/index.js.map +1 -0
- package/lib/module/ui/widgets/layout-w-header.js +102 -0
- package/lib/module/ui/widgets/layout-w-header.js.map +1 -0
- package/lib/module/ui/widgets/modal-dismiss-button.js +43 -0
- package/lib/module/ui/widgets/modal-dismiss-button.js.map +1 -0
- package/lib/module/ui/widgets/stepper.js +120 -0
- package/lib/module/ui/widgets/stepper.js.map +1 -0
- package/lib/module/version.js +10 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts +70 -0
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts +15 -0
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/index.d.ts +124 -0
- package/lib/typescript/commonjs/core/models/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts +6 -0
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts +15 -0
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/payment-type.d.ts +18 -0
- package/lib/typescript/commonjs/core/models/payment-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts +19 -0
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts +67 -0
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts +32 -0
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts +9 -0
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts +146 -0
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts +64 -0
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts +5 -0
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/pending-session-store.d.ts +12 -0
- package/lib/typescript/commonjs/core/services/pending-session-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts +5 -0
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts +6 -0
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts +6 -0
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +19 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/bank-redirect.d.ts +6 -0
- package/lib/typescript/commonjs/internal/bank-redirect.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/deep-link-listener.d.ts +3 -0
- package/lib/typescript/commonjs/internal/deep-link-listener.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/event-emitter.d.ts +13 -0
- package/lib/typescript/commonjs/internal/event-emitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/index.d.ts +5 -0
- package/lib/typescript/commonjs/internal/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/logger.d.ts +23 -0
- package/lib/typescript/commonjs/internal/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/redact-uri.d.ts +3 -0
- package/lib/typescript/commonjs/internal/redact-uri.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts +33 -0
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts +2 -0
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/public/constants.d.ts +12 -0
- package/lib/typescript/commonjs/public/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/index.d.ts +11 -0
- package/lib/typescript/commonjs/public/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/payment-result.d.ts +43 -0
- package/lib/typescript/commonjs/public/payment-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/recovery-result.d.ts +36 -0
- package/lib/typescript/commonjs/public/recovery-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts +14 -0
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-config.d.ts +49 -0
- package/lib/typescript/commonjs/public/spare-link-config.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-event.d.ts +90 -0
- package/lib/typescript/commonjs/public/spare-link-event.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts +29 -0
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts +89 -0
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-session.d.ts +20 -0
- package/lib/typescript/commonjs/public/spare-link-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link.d.ts +3 -0
- package/lib/typescript/commonjs/public/spare-link.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts +5 -0
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts +10 -0
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts +10 -0
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts +15 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts +2 -0
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts +20 -0
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts +15 -0
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts +13 -0
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/redirect-handoff-screen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/redirect-handoff-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/result-screen.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/result-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/resume-processing-screen.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/resume-processing-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts +23 -0
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/assets.d.ts +15 -0
- package/lib/typescript/commonjs/ui/theme/assets.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/colors.d.ts +31 -0
- package/lib/typescript/commonjs/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/fonts.d.ts +12 -0
- package/lib/typescript/commonjs/ui/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/index.d.ts +11 -0
- package/lib/typescript/commonjs/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/typography.d.ts +12 -0
- package/lib/typescript/commonjs/ui/theme/typography.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/footer.d.ts +23 -0
- package/lib/typescript/commonjs/ui/widgets/footer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/gradient-spinner.d.ts +13 -0
- package/lib/typescript/commonjs/ui/widgets/gradient-spinner.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/handoff-screen-layout.d.ts +11 -0
- package/lib/typescript/commonjs/ui/widgets/handoff-screen-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/index.d.ts +6 -0
- package/lib/typescript/commonjs/ui/widgets/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts +20 -0
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/modal-dismiss-button.d.ts +6 -0
- package/lib/typescript/commonjs/ui/widgets/modal-dismiss-button.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts +15 -0
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/version.d.ts +8 -0
- package/lib/typescript/commonjs/version.d.ts.map +1 -0
- package/lib/typescript/module/core/client/link-api-client.d.ts +70 -0
- package/lib/typescript/module/core/client/link-api-client.d.ts.map +1 -0
- package/lib/typescript/module/core/errors/payment-api-error.d.ts +15 -0
- package/lib/typescript/module/core/errors/payment-api-error.d.ts.map +1 -0
- package/lib/typescript/module/core/models/index.d.ts +124 -0
- package/lib/typescript/module/core/models/index.d.ts.map +1 -0
- package/lib/typescript/module/core/models/link-session-status.d.ts +6 -0
- package/lib/typescript/module/core/models/link-session-status.d.ts.map +1 -0
- package/lib/typescript/module/core/models/payment-return-params.d.ts +15 -0
- package/lib/typescript/module/core/models/payment-return-params.d.ts.map +1 -0
- package/lib/typescript/module/core/models/payment-type.d.ts +18 -0
- package/lib/typescript/module/core/models/payment-type.d.ts.map +1 -0
- package/lib/typescript/module/core/models/wire-mappers.d.ts +19 -0
- package/lib/typescript/module/core/models/wire-mappers.d.ts.map +1 -0
- package/lib/typescript/module/core/services/consent-presenter.d.ts +67 -0
- package/lib/typescript/module/core/services/consent-presenter.d.ts.map +1 -0
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts +32 -0
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts.map +1 -0
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts +9 -0
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts +146 -0
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-flow-state.d.ts +64 -0
- package/lib/typescript/module/core/services/payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts +5 -0
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts.map +1 -0
- package/lib/typescript/module/core/services/pending-session-store.d.ts +12 -0
- package/lib/typescript/module/core/services/pending-session-store.d.ts.map +1 -0
- package/lib/typescript/module/core/services/presentation-utils.d.ts +5 -0
- package/lib/typescript/module/core/services/presentation-utils.d.ts.map +1 -0
- package/lib/typescript/module/core/services/redirect-buffer.d.ts +6 -0
- package/lib/typescript/module/core/services/redirect-buffer.d.ts.map +1 -0
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts +6 -0
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +19 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/internal/bank-redirect.d.ts +6 -0
- package/lib/typescript/module/internal/bank-redirect.d.ts.map +1 -0
- package/lib/typescript/module/internal/deep-link-listener.d.ts +3 -0
- package/lib/typescript/module/internal/deep-link-listener.d.ts.map +1 -0
- package/lib/typescript/module/internal/event-emitter.d.ts +13 -0
- package/lib/typescript/module/internal/event-emitter.d.ts.map +1 -0
- package/lib/typescript/module/internal/index.d.ts +5 -0
- package/lib/typescript/module/internal/index.d.ts.map +1 -0
- package/lib/typescript/module/internal/logger.d.ts +23 -0
- package/lib/typescript/module/internal/logger.d.ts.map +1 -0
- package/lib/typescript/module/internal/redact-uri.d.ts +3 -0
- package/lib/typescript/module/internal/redact-uri.d.ts.map +1 -0
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts +33 -0
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts.map +1 -0
- package/lib/typescript/module/internal/telemetry-collector.d.ts +2 -0
- package/lib/typescript/module/internal/telemetry-collector.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/public/constants.d.ts +12 -0
- package/lib/typescript/module/public/constants.d.ts.map +1 -0
- package/lib/typescript/module/public/index.d.ts +11 -0
- package/lib/typescript/module/public/index.d.ts.map +1 -0
- package/lib/typescript/module/public/payment-result.d.ts +43 -0
- package/lib/typescript/module/public/payment-result.d.ts.map +1 -0
- package/lib/typescript/module/public/recovery-result.d.ts +36 -0
- package/lib/typescript/module/public/recovery-result.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-callbacks.d.ts +14 -0
- package/lib/typescript/module/public/spare-link-callbacks.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-config.d.ts +49 -0
- package/lib/typescript/module/public/spare-link-config.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-event.d.ts +90 -0
- package/lib/typescript/module/public/spare-link-event.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-host-api.d.ts +29 -0
- package/lib/typescript/module/public/spare-link-host-api.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-instance.d.ts +89 -0
- package/lib/typescript/module/public/spare-link-instance.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-session.d.ts +20 -0
- package/lib/typescript/module/public/spare-link-session.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link.d.ts +3 -0
- package/lib/typescript/module/public/spare-link.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts +5 -0
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts +10 -0
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts +6 -0
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/cop-information.d.ts +6 -0
- package/lib/typescript/module/ui/consent/cop-information.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts +10 -0
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts +15 -0
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/terms-link.d.ts +2 -0
- package/lib/typescript/module/ui/consent/terms-link.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/ui/payment-flow-page.d.ts +20 -0
- package/lib/typescript/module/ui/payment-flow-page.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts +15 -0
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts +13 -0
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/index.d.ts +7 -0
- package/lib/typescript/module/ui/screens/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts +10 -0
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/redirect-handoff-screen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/redirect-handoff-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/result-screen.d.ts +7 -0
- package/lib/typescript/module/ui/screens/result-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/resume-processing-screen.d.ts +10 -0
- package/lib/typescript/module/ui/screens/resume-processing-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/spare-link-host.d.ts +23 -0
- package/lib/typescript/module/ui/spare-link-host.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/assets.d.ts +15 -0
- package/lib/typescript/module/ui/theme/assets.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/colors.d.ts +31 -0
- package/lib/typescript/module/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/fonts.d.ts +12 -0
- package/lib/typescript/module/ui/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/index.d.ts +11 -0
- package/lib/typescript/module/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/typography.d.ts +12 -0
- package/lib/typescript/module/ui/theme/typography.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/footer.d.ts +23 -0
- package/lib/typescript/module/ui/widgets/footer.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/gradient-spinner.d.ts +13 -0
- package/lib/typescript/module/ui/widgets/gradient-spinner.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/handoff-screen-layout.d.ts +11 -0
- package/lib/typescript/module/ui/widgets/handoff-screen-layout.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/index.d.ts +6 -0
- package/lib/typescript/module/ui/widgets/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts +20 -0
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/modal-dismiss-button.d.ts +6 -0
- package/lib/typescript/module/ui/widgets/modal-dismiss-button.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/stepper.d.ts +15 -0
- package/lib/typescript/module/ui/widgets/stepper.d.ts.map +1 -0
- package/lib/typescript/module/version.d.ts +8 -0
- package/lib/typescript/module/version.d.ts.map +1 -0
- package/package.json +124 -0
- package/plugins/with-spare-link.js +98 -0
- package/src/core/client/link-api-client.ts +414 -0
- package/src/core/errors/payment-api-error.ts +35 -0
- package/src/core/models/index.ts +139 -0
- package/src/core/models/link-session-status.ts +7 -0
- package/src/core/models/payment-return-params.ts +34 -0
- package/src/core/models/payment-type.ts +54 -0
- package/src/core/models/wire-mappers.ts +315 -0
- package/src/core/services/consent-presenter.ts +213 -0
- package/src/core/services/execute-resume-if-needed.ts +243 -0
- package/src/core/services/multi-payment-rules-presenter.ts +158 -0
- package/src/core/services/payment-flow-controller.ts +607 -0
- package/src/core/services/payment-flow-state.ts +124 -0
- package/src/core/services/payment-result-mapper.ts +41 -0
- package/src/core/services/pending-session-store.ts +12 -0
- package/src/core/services/presentation-utils.ts +4 -0
- package/src/core/services/redirect-buffer.ts +34 -0
- package/src/core/services/user-friendly-messages.ts +39 -0
- package/src/index.ts +115 -0
- package/src/internal/bank-redirect.ts +61 -0
- package/src/internal/deep-link-listener.ts +31 -0
- package/src/internal/event-emitter.ts +42 -0
- package/src/internal/index.ts +4 -0
- package/src/internal/logger.ts +81 -0
- package/src/internal/redact-uri.ts +18 -0
- package/src/internal/secure-store-pending-session-store.ts +131 -0
- package/src/internal/telemetry-collector.ts +90 -0
- package/src/public/constants.ts +14 -0
- package/src/public/index.ts +80 -0
- package/src/public/payment-result.ts +61 -0
- package/src/public/recovery-result.ts +49 -0
- package/src/public/spare-link-callbacks.ts +20 -0
- package/src/public/spare-link-config.ts +87 -0
- package/src/public/spare-link-event.ts +146 -0
- package/src/public/spare-link-host-api.ts +28 -0
- package/src/public/spare-link-instance.ts +289 -0
- package/src/public/spare-link-session.ts +28 -0
- package/src/public/spare-link.ts +2 -0
- package/src/ui/consent/charge-bearer-display.tsx +68 -0
- package/src/ui/consent/consent-accordion.tsx +89 -0
- package/src/ui/consent/consent-summary-section.tsx +19 -0
- package/src/ui/consent/cop-information.tsx +121 -0
- package/src/ui/consent/international-payment-summary.tsx +83 -0
- package/src/ui/consent/label-value-rows.tsx +50 -0
- package/src/ui/consent/multi-payment-rules-list.tsx +138 -0
- package/src/ui/consent/multi-payment-summary.tsx +82 -0
- package/src/ui/consent/single-payment-summary.tsx +123 -0
- package/src/ui/consent/terms-link.tsx +27 -0
- package/src/ui/hooks/use-payment-flow-state.ts +16 -0
- package/src/ui/payment-flow-page.tsx +254 -0
- package/src/ui/screens/bank-selection-screen.tsx +209 -0
- package/src/ui/screens/consent-details-screen.tsx +106 -0
- package/src/ui/screens/index.ts +12 -0
- package/src/ui/screens/mandate-setup-success-screen.tsx +72 -0
- package/src/ui/screens/redirect-handoff-screen.tsx +33 -0
- package/src/ui/screens/result-screen.tsx +71 -0
- package/src/ui/screens/resume-processing-screen.tsx +111 -0
- package/src/ui/spare-link-host.tsx +394 -0
- package/src/ui/theme/assets.ts +17 -0
- package/src/ui/theme/colors.ts +32 -0
- package/src/ui/theme/fonts.ts +25 -0
- package/src/ui/theme/index.ts +11 -0
- package/src/ui/theme/typography.ts +47 -0
- package/src/ui/widgets/footer.tsx +138 -0
- package/src/ui/widgets/gradient-spinner.tsx +156 -0
- package/src/ui/widgets/handoff-screen-layout.tsx +70 -0
- package/src/ui/widgets/index.ts +5 -0
- package/src/ui/widgets/layout-w-header.tsx +89 -0
- package/src/ui/widgets/modal-dismiss-button.tsx +44 -0
- package/src/ui/widgets/stepper.tsx +126 -0
- package/src/version.ts +7 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { Text } from 'react-native';
|
|
6
|
+
import { isMultiPayment, resolvedPaymentType } from "../core/models/payment-type.js";
|
|
7
|
+
import { summaryFromState } from "../core/services/consent-presenter.js";
|
|
8
|
+
import { buildMultiPaymentRules, rulesSectionTitle } from "../core/services/multi-payment-rules-presenter.js";
|
|
9
|
+
import { userFriendlyMessageFor } from "../core/services/user-friendly-messages.js";
|
|
10
|
+
import { DEFAULT_AWAITING_CALLBACK_POLL_MS } from "../public/constants.js";
|
|
11
|
+
import { usePaymentFlowState } from "./hooks/use-payment-flow-state.js";
|
|
12
|
+
import { BankSelectionScreen } from "./screens/bank-selection-screen.js";
|
|
13
|
+
import { ConsentDetailsScreen } from "./screens/consent-details-screen.js";
|
|
14
|
+
import { MandateSetupSuccessScreen } from "./screens/mandate-setup-success-screen.js";
|
|
15
|
+
import { RedirectHandoffScreen } from "./screens/redirect-handoff-screen.js";
|
|
16
|
+
import { ResultScreen } from "./screens/result-screen.js";
|
|
17
|
+
import { ResumeProcessingScreen } from "./screens/resume-processing-screen.js";
|
|
18
|
+
import { Colors, Typography } from "./theme/index.js";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
export function PaymentFlowPage(props) {
|
|
21
|
+
const {
|
|
22
|
+
controller,
|
|
23
|
+
onResolved,
|
|
24
|
+
launchBankRedirect
|
|
25
|
+
} = props;
|
|
26
|
+
const state = usePaymentFlowState(controller);
|
|
27
|
+
const [processing, setProcessing] = useState(false);
|
|
28
|
+
const [mandateAcknowledged, setMandateAcknowledged] = useState(false);
|
|
29
|
+
const hydratedRef = useRef(false);
|
|
30
|
+
const terminalFiredRef = useRef(false);
|
|
31
|
+
const mandateClosedRef = useRef(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (hydratedRef.current) return;
|
|
34
|
+
hydratedRef.current = true;
|
|
35
|
+
// Recovery parks at awaitingCallback before mount (Flutter parity) — GET /link
|
|
36
|
+
// is one-time and must not be called again on resume.
|
|
37
|
+
if (controller.state.phase !== 'idle') return;
|
|
38
|
+
void controller.hydrate().catch(() => {
|
|
39
|
+
// hydrate already setStates failed — callback will fire below.
|
|
40
|
+
});
|
|
41
|
+
}, [controller]);
|
|
42
|
+
|
|
43
|
+
// Launch bank redirect once we hit `redirecting`.
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (state.phase !== 'redirecting' || !state.consent) return;
|
|
46
|
+
const consent = state.consent;
|
|
47
|
+
let cancelled = false;
|
|
48
|
+
(async () => {
|
|
49
|
+
try {
|
|
50
|
+
await launchBankRedirect?.({
|
|
51
|
+
authorizationUrl: consent.redirectUrl,
|
|
52
|
+
...(consent.mobileAppUrl ? {
|
|
53
|
+
mobileAppUrl: consent.mobileAppUrl
|
|
54
|
+
} : {})
|
|
55
|
+
});
|
|
56
|
+
if (cancelled) return;
|
|
57
|
+
controller.fireEvent('redirectToBank');
|
|
58
|
+
controller.setAwaitingCallbackState({
|
|
59
|
+
...(state.selectedProvider ? {
|
|
60
|
+
providerName: state.selectedProvider.name
|
|
61
|
+
} : {})
|
|
62
|
+
});
|
|
63
|
+
} catch {
|
|
64
|
+
if (!cancelled) {
|
|
65
|
+
void controller.reportError('bank_launch_failed');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
return () => {
|
|
70
|
+
cancelled = true;
|
|
71
|
+
};
|
|
72
|
+
}, [state.phase, state.consent, state.selectedProvider, launchBankRedirect, controller]);
|
|
73
|
+
|
|
74
|
+
// Poll /link/status while waiting for the bank — production and sandbox.
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (state.phase !== 'awaitingCallback') return;
|
|
77
|
+
const id = setInterval(() => {
|
|
78
|
+
void controller.pollStatus();
|
|
79
|
+
}, DEFAULT_AWAITING_CALLBACK_POLL_MS);
|
|
80
|
+
return () => clearInterval(id);
|
|
81
|
+
}, [state.phase, controller]);
|
|
82
|
+
|
|
83
|
+
// Fire terminal callbacks exactly once.
|
|
84
|
+
// or re-delivered terminal state (e.g. a duplicate callback) can't fire
|
|
85
|
+
// onSuccess/onEvent twice — integrators treat onSuccess as fire-once
|
|
86
|
+
// (navigate, capture funds, record analytics).
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const phase = state.phase;
|
|
89
|
+
if (phase !== 'succeeded' && phase !== 'failed' && phase !== 'cancelled') return;
|
|
90
|
+
if (terminalFiredRef.current) return;
|
|
91
|
+
if (phase === 'succeeded') {
|
|
92
|
+
const request = state.session?.request;
|
|
93
|
+
if (request && isMultiPayment(request) && !mandateAcknowledged) return;
|
|
94
|
+
}
|
|
95
|
+
terminalFiredRef.current = true;
|
|
96
|
+
if (phase === 'succeeded') {
|
|
97
|
+
props.callbacks?.onSuccess?.(state.exchangeCode, state.linkSessionId);
|
|
98
|
+
props.callbacks?.onEvent?.('succeeded');
|
|
99
|
+
} else if (phase === 'failed') {
|
|
100
|
+
props.callbacks?.onEvent?.('failed');
|
|
101
|
+
} else {
|
|
102
|
+
props.callbacks?.onEvent?.('cancelled');
|
|
103
|
+
}
|
|
104
|
+
}, [state.phase, state.exchangeCode, state.linkSessionId, state.session, mandateAcknowledged, props.callbacks]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (state.phase !== 'succeeded' || !mandateAcknowledged || mandateClosedRef.current) return;
|
|
107
|
+
const request = state.session?.request;
|
|
108
|
+
if (!request || !isMultiPayment(request)) return;
|
|
109
|
+
mandateClosedRef.current = true;
|
|
110
|
+
onResolved();
|
|
111
|
+
}, [state.phase, state.session, mandateAcknowledged, onResolved]);
|
|
112
|
+
switch (state.phase) {
|
|
113
|
+
case 'idle':
|
|
114
|
+
case 'hydrating':
|
|
115
|
+
return /*#__PURE__*/_jsx(LoadingState, {});
|
|
116
|
+
case 'bankSelection':
|
|
117
|
+
return /*#__PURE__*/_jsx(BankSelectionScreen, {
|
|
118
|
+
providers: state.providers,
|
|
119
|
+
isProcessing: processing,
|
|
120
|
+
onSelected: async bankId => {
|
|
121
|
+
setProcessing(true);
|
|
122
|
+
try {
|
|
123
|
+
controller.selectBank(bankId);
|
|
124
|
+
} finally {
|
|
125
|
+
setProcessing(false);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
onCancel: async () => {
|
|
129
|
+
setProcessing(true);
|
|
130
|
+
try {
|
|
131
|
+
await controller.cancel();
|
|
132
|
+
} finally {
|
|
133
|
+
setProcessing(false);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
case 'consentDetails':
|
|
138
|
+
{
|
|
139
|
+
const summary = summaryFromState(state);
|
|
140
|
+
if (!summary) return /*#__PURE__*/_jsx(LoadingState, {});
|
|
141
|
+
return /*#__PURE__*/_jsx(ConsentDetailsScreen, {
|
|
142
|
+
display: summary,
|
|
143
|
+
isProcessing: processing,
|
|
144
|
+
...(state.isCopLoading ? {
|
|
145
|
+
isCopLoading: true
|
|
146
|
+
} : {}),
|
|
147
|
+
onContinue: async () => {
|
|
148
|
+
setProcessing(true);
|
|
149
|
+
try {
|
|
150
|
+
await controller.confirmConsent();
|
|
151
|
+
} catch {
|
|
152
|
+
// controller already setStates failed
|
|
153
|
+
} finally {
|
|
154
|
+
setProcessing(false);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
onCancel: async () => {
|
|
158
|
+
setProcessing(true);
|
|
159
|
+
try {
|
|
160
|
+
await controller.cancel();
|
|
161
|
+
} finally {
|
|
162
|
+
setProcessing(false);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
case 'redirecting':
|
|
168
|
+
return /*#__PURE__*/_jsx(RedirectHandoffScreen, {});
|
|
169
|
+
case 'awaitingCallback':
|
|
170
|
+
return /*#__PURE__*/_jsx(ResumeProcessingScreen, {
|
|
171
|
+
...(controller.awaitingCallbackStartedAtMs !== undefined ? {
|
|
172
|
+
awaitingCallbackStartedAtMs: controller.awaitingCallbackStartedAtMs
|
|
173
|
+
} : {}),
|
|
174
|
+
onCancel: async () => {
|
|
175
|
+
await controller.cancel();
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
case 'succeeded':
|
|
179
|
+
{
|
|
180
|
+
const request = state.session?.request;
|
|
181
|
+
if (request && isMultiPayment(request) && !mandateAcknowledged) {
|
|
182
|
+
const paymentType = resolvedPaymentType(request);
|
|
183
|
+
return /*#__PURE__*/_jsx(MandateSetupSuccessScreen, {
|
|
184
|
+
rulesTitle: rulesSectionTitle(paymentType),
|
|
185
|
+
rules: buildMultiPaymentRules(paymentType, request.instructions),
|
|
186
|
+
paymentType: paymentType,
|
|
187
|
+
onDone: () => setMandateAcknowledged(true)
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
191
|
+
title: "Your payment was successful.",
|
|
192
|
+
isSuccess: true,
|
|
193
|
+
onDone: onResolved
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
case 'failed':
|
|
197
|
+
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
198
|
+
title: userFriendlyMessageFor(state.errorCode ?? 'unknown_error'),
|
|
199
|
+
isSuccess: false,
|
|
200
|
+
onDone: onResolved
|
|
201
|
+
});
|
|
202
|
+
case 'cancelled':
|
|
203
|
+
return /*#__PURE__*/_jsx(ResultScreen, {
|
|
204
|
+
title: "The payment was cancelled.",
|
|
205
|
+
isSuccess: false,
|
|
206
|
+
onDone: onResolved
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function LoadingState() {
|
|
211
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
212
|
+
style: styles.loading,
|
|
213
|
+
testID: "payment-flow-loading",
|
|
214
|
+
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
215
|
+
size: "large",
|
|
216
|
+
color: Colors.spareBlue
|
|
217
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
218
|
+
style: Typography.bodyMuted,
|
|
219
|
+
children: "Loading\u2026"
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const styles = StyleSheet.create({
|
|
224
|
+
loading: {
|
|
225
|
+
flex: 1,
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
gap: 12,
|
|
229
|
+
backgroundColor: Colors.surfacePage
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
//# sourceMappingURL=payment-flow-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","Text","isMultiPayment","resolvedPaymentType","summaryFromState","buildMultiPaymentRules","rulesSectionTitle","userFriendlyMessageFor","DEFAULT_AWAITING_CALLBACK_POLL_MS","usePaymentFlowState","BankSelectionScreen","ConsentDetailsScreen","MandateSetupSuccessScreen","RedirectHandoffScreen","ResultScreen","ResumeProcessingScreen","Colors","Typography","jsx","_jsx","jsxs","_jsxs","PaymentFlowPage","props","controller","onResolved","launchBankRedirect","state","processing","setProcessing","mandateAcknowledged","setMandateAcknowledged","hydratedRef","terminalFiredRef","mandateClosedRef","current","phase","hydrate","catch","consent","cancelled","authorizationUrl","redirectUrl","mobileAppUrl","fireEvent","setAwaitingCallbackState","selectedProvider","providerName","name","reportError","id","setInterval","pollStatus","clearInterval","request","session","callbacks","onSuccess","exchangeCode","linkSessionId","onEvent","LoadingState","providers","isProcessing","onSelected","bankId","selectBank","onCancel","cancel","summary","display","isCopLoading","onContinue","confirmConsent","awaitingCallbackStartedAtMs","undefined","paymentType","rulesTitle","rules","instructions","onDone","title","isSuccess","errorCode","style","styles","loading","testID","children","size","color","spareBlue","bodyMuted","create","flex","alignItems","justifyContent","gap","backgroundColor","surfacePage"],"sourceRoot":"../../../src","sources":["ui/payment-flow-page.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,gCAA6B;AACjF,SAASC,gBAAgB,QAAQ,uCAAoC;AACrE,SACEC,sBAAsB,EACtBC,iBAAiB,QACZ,mDAAgD;AAEvD,SA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
+
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
+
import { useMemo, useState } from 'react';
|
|
5
|
+
import { Image, Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
6
|
+
import { Colors, FONT_FAMILY, Spacing } from "../theme/index.js";
|
|
7
|
+
import { Footer, LayoutWHeader } from "../widgets/index.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* CBUAE-approved bank picker. Port of Flutter `bank_selection_screen.dart`:
|
|
11
|
+
* "Choose your bank" inside a white card with a search field and logo rows
|
|
12
|
+
* (blue-outline selection), wrapped in the shared {@link LayoutWHeader} stepper
|
|
13
|
+
* chrome with a "Proceed using Altareq" footer.
|
|
14
|
+
*/
|
|
15
|
+
export function BankSelectionScreen(props) {
|
|
16
|
+
const [query, setQuery] = useState('');
|
|
17
|
+
const [selectedId, setSelectedId] = useState(undefined);
|
|
18
|
+
const trimmed = query.trim().toLowerCase();
|
|
19
|
+
const filtered = useMemo(() => trimmed ? props.providers.filter(p => p.name.toLowerCase().includes(trimmed)) : props.providers, [props.providers, trimmed]);
|
|
20
|
+
const isBankSelected = !!selectedId;
|
|
21
|
+
return /*#__PURE__*/_jsx(LayoutWHeader, {
|
|
22
|
+
progress: 0,
|
|
23
|
+
onBackPress: props.onCancel,
|
|
24
|
+
...(props.isProcessing ? {
|
|
25
|
+
backDisabled: true
|
|
26
|
+
} : {}),
|
|
27
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
28
|
+
style: styles.container,
|
|
29
|
+
testID: "bank-selection-screen",
|
|
30
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
31
|
+
style: styles.card,
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
33
|
+
style: styles.cardTitle,
|
|
34
|
+
testID: "bank-selection-title",
|
|
35
|
+
children: "Choose your bank"
|
|
36
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
37
|
+
style: styles.searchRow,
|
|
38
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
39
|
+
accessibilityLabel: "Search account providers",
|
|
40
|
+
testID: "bank-selection-search",
|
|
41
|
+
value: query,
|
|
42
|
+
onChangeText: setQuery,
|
|
43
|
+
placeholder: "Enter account provider...",
|
|
44
|
+
placeholderTextColor: Colors.textMuted,
|
|
45
|
+
style: styles.searchInput
|
|
46
|
+
}), query.length > 0 ? /*#__PURE__*/_jsx(Pressable, {
|
|
47
|
+
accessibilityRole: "button",
|
|
48
|
+
testID: "bank-selection-search-clear",
|
|
49
|
+
onPress: () => setQuery(''),
|
|
50
|
+
hitSlop: 8,
|
|
51
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
52
|
+
name: "close",
|
|
53
|
+
size: 18,
|
|
54
|
+
color: Colors.textMuted
|
|
55
|
+
})
|
|
56
|
+
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
57
|
+
name: "search",
|
|
58
|
+
size: 18,
|
|
59
|
+
color: Colors.textMuted
|
|
60
|
+
})]
|
|
61
|
+
}), filtered.length === 0 ? /*#__PURE__*/_jsx(Text, {
|
|
62
|
+
testID: "bank-selection-empty",
|
|
63
|
+
style: styles.empty,
|
|
64
|
+
children: trimmed ? `No banks match "${query.trim()}"` : 'No banks available'
|
|
65
|
+
}) : filtered.map(provider => /*#__PURE__*/_jsx(BankRow, {
|
|
66
|
+
provider: provider,
|
|
67
|
+
isSelected: provider.id === selectedId,
|
|
68
|
+
onPress: () => setSelectedId(provider.id)
|
|
69
|
+
}, provider.id))]
|
|
70
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
71
|
+
style: styles.spacer
|
|
72
|
+
}), /*#__PURE__*/_jsx(Footer, {
|
|
73
|
+
continueButtonText: "Proceed using Altareq",
|
|
74
|
+
continueTestID: "bank-selection-continue-btn",
|
|
75
|
+
cancelTestID: "bank-selection-cancel-btn",
|
|
76
|
+
onCancel: props.onCancel,
|
|
77
|
+
disabledContinueButton: !isBankSelected,
|
|
78
|
+
...(isBankSelected ? {
|
|
79
|
+
onContinue: () => props.onSelected(selectedId)
|
|
80
|
+
} : {}),
|
|
81
|
+
...(props.isProcessing ? {
|
|
82
|
+
isLoading: true
|
|
83
|
+
} : {})
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function BankRow(props) {
|
|
89
|
+
const {
|
|
90
|
+
provider,
|
|
91
|
+
isSelected
|
|
92
|
+
} = props;
|
|
93
|
+
const [logoFailed, setLogoFailed] = useState(false);
|
|
94
|
+
const showLogo = !!provider.logoUrl && !logoFailed;
|
|
95
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
96
|
+
testID: `bank-row-${provider.code}`,
|
|
97
|
+
accessibilityRole: "button",
|
|
98
|
+
onPress: props.onPress,
|
|
99
|
+
style: [styles.row, isSelected && styles.rowSelected],
|
|
100
|
+
children: [showLogo ? /*#__PURE__*/_jsx(Image, {
|
|
101
|
+
source: {
|
|
102
|
+
uri: provider.logoUrl
|
|
103
|
+
},
|
|
104
|
+
style: styles.logo,
|
|
105
|
+
resizeMode: "contain",
|
|
106
|
+
onError: () => setLogoFailed(true)
|
|
107
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
108
|
+
style: [styles.logo, styles.logoFallback],
|
|
109
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
110
|
+
name: "business-outline",
|
|
111
|
+
size: 20,
|
|
112
|
+
color: Colors.textMuted
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
115
|
+
style: [styles.rowName, isSelected && styles.rowNameSelected],
|
|
116
|
+
numberOfLines: 1,
|
|
117
|
+
children: provider.name
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const styles = StyleSheet.create({
|
|
122
|
+
container: {
|
|
123
|
+
flex: 1
|
|
124
|
+
},
|
|
125
|
+
card: {
|
|
126
|
+
backgroundColor: Colors.surfaceCard,
|
|
127
|
+
borderRadius: 12,
|
|
128
|
+
paddingHorizontal: 12,
|
|
129
|
+
paddingVertical: 16,
|
|
130
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
131
|
+
borderColor: Colors.divider,
|
|
132
|
+
shadowColor: '#000000',
|
|
133
|
+
shadowOpacity: 0.06,
|
|
134
|
+
shadowRadius: 6,
|
|
135
|
+
shadowOffset: {
|
|
136
|
+
width: 0,
|
|
137
|
+
height: 2
|
|
138
|
+
},
|
|
139
|
+
elevation: 2
|
|
140
|
+
},
|
|
141
|
+
cardTitle: {
|
|
142
|
+
fontFamily: FONT_FAMILY,
|
|
143
|
+
fontSize: 16,
|
|
144
|
+
fontWeight: '700',
|
|
145
|
+
color: Colors.textPrimary,
|
|
146
|
+
marginBottom: 12
|
|
147
|
+
},
|
|
148
|
+
searchRow: {
|
|
149
|
+
flexDirection: 'row',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
152
|
+
borderColor: Colors.divider,
|
|
153
|
+
borderRadius: 12,
|
|
154
|
+
paddingHorizontal: 12,
|
|
155
|
+
height: 44,
|
|
156
|
+
marginBottom: Spacing.md
|
|
157
|
+
},
|
|
158
|
+
searchInput: {
|
|
159
|
+
flex: 1,
|
|
160
|
+
fontFamily: FONT_FAMILY,
|
|
161
|
+
fontSize: 14,
|
|
162
|
+
color: Colors.textPrimary,
|
|
163
|
+
paddingVertical: 0
|
|
164
|
+
},
|
|
165
|
+
empty: {
|
|
166
|
+
fontFamily: FONT_FAMILY,
|
|
167
|
+
fontSize: 14,
|
|
168
|
+
color: Colors.textMuted,
|
|
169
|
+
textAlign: 'center',
|
|
170
|
+
paddingVertical: Spacing.xl
|
|
171
|
+
},
|
|
172
|
+
row: {
|
|
173
|
+
flexDirection: 'row',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
paddingHorizontal: 12,
|
|
176
|
+
paddingVertical: 10,
|
|
177
|
+
marginVertical: 4,
|
|
178
|
+
borderRadius: 10,
|
|
179
|
+
borderWidth: 1.5,
|
|
180
|
+
borderColor: 'transparent'
|
|
181
|
+
},
|
|
182
|
+
rowSelected: {
|
|
183
|
+
borderColor: Colors.spareBlue
|
|
184
|
+
},
|
|
185
|
+
logo: {
|
|
186
|
+
width: 36,
|
|
187
|
+
height: 36,
|
|
188
|
+
borderRadius: 4
|
|
189
|
+
},
|
|
190
|
+
logoFallback: {
|
|
191
|
+
backgroundColor: Colors.surfaceMuted,
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
justifyContent: 'center'
|
|
194
|
+
},
|
|
195
|
+
rowName: {
|
|
196
|
+
flex: 1,
|
|
197
|
+
marginLeft: 12,
|
|
198
|
+
fontFamily: FONT_FAMILY,
|
|
199
|
+
fontSize: 14,
|
|
200
|
+
color: Colors.textPrimary
|
|
201
|
+
},
|
|
202
|
+
rowNameSelected: {
|
|
203
|
+
color: Colors.spareBlue,
|
|
204
|
+
fontWeight: '600'
|
|
205
|
+
},
|
|
206
|
+
spacer: {
|
|
207
|
+
flex: 1,
|
|
208
|
+
minHeight: Spacing.xl
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=bank-selection-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ionicons","useMemo","useState","Image","Pressable","StyleSheet","Text","TextInput","View","Colors","FONT_FAMILY","Spacing","Footer","LayoutWHeader","jsx","_jsx","jsxs","_jsxs","BankSelectionScreen","props","query","setQuery","selectedId","setSelectedId","undefined","trimmed","trim","toLowerCase","filtered","providers","filter","p","name","includes","isBankSelected","progress","onBackPress","onCancel","isProcessing","backDisabled","children","style","styles","container","testID","card","cardTitle","searchRow","accessibilityLabel","value","onChangeText","placeholder","placeholderTextColor","textMuted","searchInput","length","accessibilityRole","onPress","hitSlop","size","color","empty","map","provider","BankRow","isSelected","id","spacer","continueButtonText","continueTestID","cancelTestID","disabledContinueButton","onContinue","onSelected","isLoading","logoFailed","setLogoFailed","showLogo","logoUrl","code","row","rowSelected","source","uri","logo","resizeMode","onError","logoFallback","rowName","rowNameSelected","numberOfLines","create","flex","backgroundColor","surfaceCard","borderRadius","paddingHorizontal","paddingVertical","borderWidth","hairlineWidth","borderColor","divider","shadowColor","shadowOpacity","shadowRadius","shadowOffset","width","height","elevation","fontFamily","fontSize","fontWeight","textPrimary","marginBottom","flexDirection","alignItems","md","textAlign","xl","marginVertical","spareBlue","surfaceMuted","justifyContent","marginLeft","minHeight"],"sourceRoot":"../../../../src","sources":["ui/screens/bank-selection-screen.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzC,SAASC,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAElF,SAASC,MAAM,EAAEC,WAAW,EAAEC,OAAO,QAAQ,mBAAU;AACvD,SAASC,MAAM,EAAEC,aAAa,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASnD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAACC,KAA+B,EAAe;EAChF,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGnB,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAM,CAACoB,UAAU,EAAEC,aAAa,CAAC,GAAGrB,QAAQ,CAAqBsB,SAAS,CAAC;EAE3E,MAAMC,OAAO,GAAGL,KAAK,CAACM,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EAC1C,MAAMC,QAAQ,GAAG3B,OAAO,CACtB,MACEwB,OAAO,GACHN,KAAK,CAACU,SAAS,CAACC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,CAACL,WAAW,CAAC,CAAC,CAACM,QAAQ,CAACR,OAAO,CAAC,CAAC,GACrEN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leSheet, Text, View } from 'react-native';
|
|
4
|
+
import { ConsentSummarySection } from "../consent/consent-summary-section.js";
|
|
5
|
+
import { present } from "../consent/label-value-rows.js";
|
|
6
|
+
import { Colors, FONT_FAMILY, Spacing } from "../theme/index.js";
|
|
7
|
+
import { Footer, LayoutWHeader } from "../widgets/index.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* CBUAE-approved consent screen. Port of Flutter `consent_details_screen.dart`.
|
|
11
|
+
*/
|
|
12
|
+
export function ConsentDetailsScreen(props) {
|
|
13
|
+
const {
|
|
14
|
+
display,
|
|
15
|
+
onContinue,
|
|
16
|
+
onCancel,
|
|
17
|
+
isProcessing,
|
|
18
|
+
isCopLoading
|
|
19
|
+
} = props;
|
|
20
|
+
const bankName = present(display.bankName, 'your bank');
|
|
21
|
+
const disableContinue = isCopLoading ?? (display.variant === 'singlePayment' ? display.isCopLoading : false);
|
|
22
|
+
const backDisabled = !!isProcessing;
|
|
23
|
+
return /*#__PURE__*/_jsx(LayoutWHeader, {
|
|
24
|
+
progress: 0.5,
|
|
25
|
+
onBackPress: onCancel,
|
|
26
|
+
backDisabled: backDisabled,
|
|
27
|
+
children: /*#__PURE__*/_jsxs(ScrollView, {
|
|
28
|
+
style: styles.scroll,
|
|
29
|
+
contentContainerStyle: styles.content,
|
|
30
|
+
testID: "consent-details-screen",
|
|
31
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
32
|
+
style: styles.title,
|
|
33
|
+
testID: "consent-details-title",
|
|
34
|
+
children: "Permission to make a payment"
|
|
35
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
36
|
+
style: styles.intro,
|
|
37
|
+
testID: "consent-details-intro",
|
|
38
|
+
children: ["To make a payment we need your permission to securely initiate payment order from", ' ', bankName, "."]
|
|
39
|
+
}), /*#__PURE__*/_jsx(ConsentSummarySection, {
|
|
40
|
+
data: display
|
|
41
|
+
}), display.variant === 'multiPayment' ? /*#__PURE__*/_jsxs(View, {
|
|
42
|
+
style: styles.balancePermission,
|
|
43
|
+
testID: "consent-balance-permission",
|
|
44
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
45
|
+
style: styles.title,
|
|
46
|
+
children: "Permission to check balance"
|
|
47
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
48
|
+
style: styles.balanceIntro,
|
|
49
|
+
children: "You also allow us to check the available funds before making a payment"
|
|
50
|
+
})]
|
|
51
|
+
}) : null, /*#__PURE__*/_jsx(View, {
|
|
52
|
+
style: styles.footerWrap,
|
|
53
|
+
children: /*#__PURE__*/_jsx(Footer, {
|
|
54
|
+
onContinue: onContinue,
|
|
55
|
+
continueButtonText: "Pay using Altareq",
|
|
56
|
+
continueTestID: "consent-proceed-btn",
|
|
57
|
+
showCancelButton: false,
|
|
58
|
+
disabledContinueButton: disableContinue,
|
|
59
|
+
...(isProcessing ? {
|
|
60
|
+
isLoading: true
|
|
61
|
+
} : {})
|
|
62
|
+
})
|
|
63
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
64
|
+
style: styles.disclaimer,
|
|
65
|
+
testID: "consent-details-disclaimer",
|
|
66
|
+
children: ["We will securely transfer you to", ' ', /*#__PURE__*/_jsx(Text, {
|
|
67
|
+
style: styles.disclaimerBold,
|
|
68
|
+
children: display.bankName
|
|
69
|
+
}), " to authorize and make the payment."]
|
|
70
|
+
})]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const styles = StyleSheet.create({
|
|
75
|
+
scroll: {
|
|
76
|
+
flex: 1
|
|
77
|
+
},
|
|
78
|
+
content: {
|
|
79
|
+
paddingBottom: Spacing.xl
|
|
80
|
+
},
|
|
81
|
+
title: {
|
|
82
|
+
fontFamily: FONT_FAMILY,
|
|
83
|
+
fontSize: 18,
|
|
84
|
+
fontWeight: '700',
|
|
85
|
+
color: Colors.textPrimary
|
|
86
|
+
},
|
|
87
|
+
intro: {
|
|
88
|
+
fontFamily: FONT_FAMILY,
|
|
89
|
+
fontSize: 14,
|
|
90
|
+
color: Colors.textMuted,
|
|
91
|
+
lineHeight: 22,
|
|
92
|
+
marginTop: 10,
|
|
93
|
+
marginBottom: 20
|
|
94
|
+
},
|
|
95
|
+
balancePermission: {
|
|
96
|
+
marginTop: 20
|
|
97
|
+
},
|
|
98
|
+
balanceIntro: {
|
|
99
|
+
fontFamily: FONT_FAMILY,
|
|
100
|
+
fontSize: 14,
|
|
101
|
+
color: Colors.textMuted,
|
|
102
|
+
lineHeight: 22,
|
|
103
|
+
marginTop: Spacing.sm
|
|
104
|
+
},
|
|
105
|
+
footerWrap: {
|
|
106
|
+
marginTop: 20
|
|
107
|
+
},
|
|
108
|
+
disclaimer: {
|
|
109
|
+
fontFamily: FONT_FAMILY,
|
|
110
|
+
fontSize: 14,
|
|
111
|
+
color: Colors.textMuted,
|
|
112
|
+
lineHeight: 22,
|
|
113
|
+
marginTop: Spacing.md
|
|
114
|
+
},
|
|
115
|
+
disclaimerBold: {
|
|
116
|
+
fontWeight: '700',
|
|
117
|
+
color: Colors.textMuted
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=consent-details-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScrollView","StyleSheet","Text","View","ConsentSummarySection","present","Colors","FONT_FAMILY","Spacing","Footer","LayoutWHeader","jsx","_jsx","jsxs","_jsxs","ConsentDetailsScreen","props","display","onContinue","onCancel","isProcessing","isCopLoading","bankName","disableContinue","variant","backDisabled","progress","onBackPress","children","style","styles","scroll","contentContainerStyle","content","testID","title","intro","data","balancePermission","balanceIntro","footerWrap","continueButtonText","continueTestID","showCancelButton","disabledContinueButton","isLoading","disclaimer","disclaimerBold","create","flex","paddingBottom","xl","fontFamily","fontSize","fontWeight","color","textPrimary","textMuted","lineHeight","marginTop","marginBottom","sm","md"],"sourceRoot":"../../../../src","sources":["ui/screens/consent-details-screen.tsx"],"mappings":";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EAC/BjB,MAAM,EAAE;IAAEkB,IAAI,EAAE;EAAE,CAAC;EACnBhB,OAAO,EAAE;IAAEiB,aAAa,EAAE1C,OAAO,CAAC2C;EAAG,CAAC;EACtChB,KAAK,EAAE;IACLiB,UAAU,EAAE7C,WAAW;IACvB8C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAEjD,MAAM,CAACkD;EAChB,CAAC;EACDpB,KAAK,EAAE;IACLgB,UAAU,EAAE7C,WAAW;IACvB8C,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAEjD,MAAM,CAACmD,SAAS;IACvBC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDtB,iBAAiB,EAAE;IAAEqB,SAAS,EAAE;EAAG,CAAC;EACpCpB,YAAY,EAAE;IACZa,UAAU,EAAE7C,WAAW;IACvB8C,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAEjD,MAAM,CAACmD,SAAS;IACvBC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAEnD,OAAO,CAACqD;EACrB,CAAC;EACDrB,UAAU,EAAE;IAAEmB,SAAS,EAAE;EAAG,CAAC;EAC7Bb,UAAU,EAAE;IACVM,UAAU,EAAE7C,WAAW;IACvB8C,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAEjD,MAAM,CAACmD,SAAS;IACvBC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAEnD,OAAO,CAACsD;EACrB,CAAC;EACDf,cAAc,EAAE;IAAEO,UAAU,EAAE,KAAK;IAAEC,KAAK,EAAEjD,MAAM,CAACmD;EAAU;AAC/D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { BankSelectionScreen } from "./bank-selection-screen.js";
|
|
4
|
+
export { ConsentDetailsScreen } from "./consent-details-screen.js";
|
|
5
|
+
export { RedirectHandoffScreen } from "./redirect-handoff-screen.js";
|
|
6
|
+
export { ResumeProcessingScreen } from "./resume-processing-screen.js";
|
|
7
|
+
export { ResultScreen } from "./result-screen.js";
|
|
8
|
+
export { MandateSetupSuccessScreen } from "./mandate-setup-success-screen.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BankSelectionScreen","ConsentDetailsScreen","RedirectHandoffScreen","ResumeProcessingScreen","ResultScreen","MandateSetupSuccessScreen"],"sourceRoot":"../../../../src","sources":["ui/screens/index.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAuC,4BAAyB;AAC5F,SAASC,oBAAoB,QAAwC,6BAA0B;AAC/F,SAASC,qBAAqB,QAAQ,8BAA2B;AACjE,SACEC,sBAAsB,QAEjB,+BAA4B;AACnC,SAASC,YAAY,QAAgC,oBAAiB;AACtE,SACEC,yBAAyB,QAEpB,mCAAgC","ignoreList":[]}
|