@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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Max non-terminal `resumeIfNeeded` recovery attempts before the SDK gives up
|
|
5
|
+
* and resolves the flow as failed with code `recovery_exhausted`.
|
|
6
|
+
*/
|
|
7
|
+
export const kMaxRecoveryAttempts = 3;
|
|
8
|
+
|
|
9
|
+
/** Default per-request HTTP timeout in milliseconds (15s). */
|
|
10
|
+
export const DEFAULT_REQUEST_TIMEOUT_MS = 15_000;
|
|
11
|
+
|
|
12
|
+
/** How long the SDK waits for a bank callback before auto-failing with `session_timeout`. */
|
|
13
|
+
export const DEFAULT_AWAITING_CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
14
|
+
|
|
15
|
+
/** Polling interval while the flow is in awaitingCallback (status endpoint). */
|
|
16
|
+
export const DEFAULT_AWAITING_CALLBACK_POLL_MS = 10_000;
|
|
17
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["kMaxRecoveryAttempts","DEFAULT_REQUEST_TIMEOUT_MS","DEFAULT_AWAITING_CALLBACK_TIMEOUT_MS","DEFAULT_AWAITING_CALLBACK_POLL_MS"],"sourceRoot":"../../../src","sources":["public/constants.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,oBAAoB,GAAG,CAAU;;AAE9C;AACA,OAAO,MAAMC,0BAA0B,GAAG,MAAe;;AAEzD;AACA,OAAO,MAAMC,oCAAoC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAEjE;AACA,OAAO,MAAMC,iCAAiC,GAAG,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { defaultBaseUrlFor, tenantCountryCode, resolvedBaseUrl, resolvedResumeBaseUrl, assertValidConfig } from "./spare-link-config.js";
|
|
4
|
+
export { SPARE_LINK_EVENT_TYPES, isSpareLinkEvent, SpareLinkEvents } from "./spare-link-event.js";
|
|
5
|
+
export { paymentSuccess, paymentCancelled, paymentFailed, paymentAbandoned } from "./payment-result.js";
|
|
6
|
+
export { isSessionRecovered, isNoRecoveryNeeded, isRecoveryAwaitingUser } from "./recovery-result.js";
|
|
7
|
+
export { SpareLinkSession } from "./spare-link-session.js";
|
|
8
|
+
export { SpareLink } from "./spare-link-instance.js";
|
|
9
|
+
export { kMaxRecoveryAttempts, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_AWAITING_CALLBACK_TIMEOUT_MS, DEFAULT_AWAITING_CALLBACK_POLL_MS } from "./constants.js";
|
|
10
|
+
export { configureSpareLinkLogging, createLogger } from "../internal/logger.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultBaseUrlFor","tenantCountryCode","resolvedBaseUrl","resolvedResumeBaseUrl","assertValidConfig","SPARE_LINK_EVENT_TYPES","isSpareLinkEvent","SpareLinkEvents","paymentSuccess","paymentCancelled","paymentFailed","paymentAbandoned","isSessionRecovered","isNoRecoveryNeeded","isRecoveryAwaitingUser","SpareLinkSession","SpareLink","kMaxRecoveryAttempts","DEFAULT_REQUEST_TIMEOUT_MS","DEFAULT_AWAITING_CALLBACK_TIMEOUT_MS","DEFAULT_AWAITING_CALLBACK_POLL_MS","configureSpareLinkLogging","createLogger"],"sourceRoot":"../../../src","sources":["public/index.ts"],"mappings":";;AAAA,SAKEA,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,qBAAqB,EACrBC,iBAAiB,QACZ,wBAAqB;AAE5B,SAYEC,sBAAsB,EACtBC,gBAAgB,EAChBC,eAAe,QACV,uBAAoB;AAE3B,SAOEC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,qBAAkB;AAgBzB,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,sBAAsB,QACjB,sBAAmB;AAE1B,SAASC,gBAAgB,QAAQ,yBAAsB;AACvD,SAASC,SAAS,QAA+B,0BAAuB;AAExE,SACEC,oBAAoB,EACpBC,0BAA0B,EAC1BC,oCAAoC,EACpCC,iCAAiC,QAC5B,gBAAa;AAEpB,SACEC,yBAAyB,EACzBC,YAAY,QAKP,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Terminal outcome of a payment flow — narrow on the `status` field.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Payment completed at the bank. `exchangeCode` may be null when recovered
|
|
8
|
+
* via status polling (the bank delivered the code straight to the merchant
|
|
9
|
+
* backend, bypassing the SDK). */
|
|
10
|
+
|
|
11
|
+
/** Payment failed. Always has an `errorCode` so merchants can map to UI copy. */
|
|
12
|
+
|
|
13
|
+
/** Flow abandoned mid-flight (app killed, host removed the SDK navigator). */
|
|
14
|
+
|
|
15
|
+
// ---- Constructor helpers ---------------------------------------------------
|
|
16
|
+
|
|
17
|
+
export function paymentSuccess(args) {
|
|
18
|
+
return {
|
|
19
|
+
status: 'success',
|
|
20
|
+
...args
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function paymentCancelled(args) {
|
|
24
|
+
return {
|
|
25
|
+
status: 'cancelled',
|
|
26
|
+
...args
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function paymentFailed(args) {
|
|
30
|
+
return {
|
|
31
|
+
status: 'failed',
|
|
32
|
+
...args
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function paymentAbandoned(args) {
|
|
36
|
+
return {
|
|
37
|
+
status: 'abandoned',
|
|
38
|
+
...args
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=payment-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["paymentSuccess","args","status","paymentCancelled","paymentFailed","paymentAbandoned"],"sourceRoot":"../../../src","sources":["public/payment-result.ts"],"mappings":";;AAAA;AACA;AACA;;AAcA;AACA;AACA;;AAaA;;AAMA;;AAOA;;AAEA,OAAO,SAASA,cAAcA,CAACC,IAAoC,EAAkB;EACnF,OAAO;IAAEC,MAAM,EAAE,SAAS;IAAE,GAAGD;EAAK,CAAC;AACvC;AAEA,OAAO,SAASE,gBAAgBA,CAACF,IAAsC,EAAoB;EACzF,OAAO;IAAEC,MAAM,EAAE,WAAW;IAAE,GAAGD;EAAK,CAAC;AACzC;AAEA,OAAO,SAASG,aAAaA,CAACH,IAAmC,EAAiB;EAChF,OAAO;IAAEC,MAAM,EAAE,QAAQ;IAAE,GAAGD;EAAK,CAAC;AACtC;AAEA,OAAO,SAASI,gBAAgBA,CAACJ,IAAsC,EAAoB;EACzF,OAAO;IAAEC,MAAM,EAAE,WAAW;IAAE,GAAGD;EAAK,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Why {@link SpareLink.resumeIfNeeded} did not recover a terminal session.
|
|
5
|
+
* Mirrors Flutter's `NoRecoveryReason`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Outcome of {@link SpareLink.resumeIfNeeded}.
|
|
10
|
+
*
|
|
11
|
+
* Discriminated union aligned with Flutter's sealed `RecoveryResult`.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** No pending session was recovered. */
|
|
15
|
+
|
|
16
|
+
/** A pending session was recovered to a terminal {@link PaymentResult}. */
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A pending session is non-terminal and the SDK opened its recovery UI —
|
|
20
|
+
* the integrator should treat this as in-progress, not "nothing happened".
|
|
21
|
+
* The terminal outcome arrives later via `SpareLink.events` /
|
|
22
|
+
* `spareLink.emitTerminal`, not as a second `resumeIfNeeded` resolution.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export function isSessionRecovered(r) {
|
|
26
|
+
return r.kind === 'recovered';
|
|
27
|
+
}
|
|
28
|
+
export function isNoRecoveryNeeded(r) {
|
|
29
|
+
return r.kind === 'none';
|
|
30
|
+
}
|
|
31
|
+
export function isRecoveryAwaitingUser(r) {
|
|
32
|
+
return r.kind === 'awaitingUser';
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=recovery-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isSessionRecovered","r","kind","isNoRecoveryNeeded","isRecoveryAwaitingUser"],"sourceRoot":"../../../src","sources":["public/recovery-result.ts"],"mappings":";;AAEA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASA,kBAAkBA,CAACC,CAAiB,EAAyB;EAC3E,OAAOA,CAAC,CAACC,IAAI,KAAK,WAAW;AAC/B;AAEA,OAAO,SAASC,kBAAkBA,CAACF,CAAiB,EAAyB;EAC3E,OAAOA,CAAC,CAACC,IAAI,KAAK,MAAM;AAC1B;AAEA,OAAO,SAASE,sBAAsBA,CAACH,CAAiB,EAA6B;EACnF,OAAOA,CAAC,CAACC,IAAI,KAAK,cAAc;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["public/spare-link-callbacks.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Deployment environment for the Spare Link API.
|
|
5
|
+
*
|
|
6
|
+
* Each value maps to a default base URL
|
|
7
|
+
* the SDK will hit unless `baseUrl` is overridden in {@link SpareLinkConfig}.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const DEFAULT_BASE_URLS = {
|
|
11
|
+
sandbox: 'https://api.sandbox.tryspare.ae',
|
|
12
|
+
production: 'https://api.tryspare.ae'
|
|
13
|
+
};
|
|
14
|
+
export function defaultBaseUrlFor(env) {
|
|
15
|
+
return DEFAULT_BASE_URLS[env];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Spare API tenant — one country per tenant. */
|
|
19
|
+
|
|
20
|
+
const TENANT_COUNTRY_CODES = {
|
|
21
|
+
ksa: 'KSA',
|
|
22
|
+
uae: 'UAE',
|
|
23
|
+
bah: 'BAH'
|
|
24
|
+
};
|
|
25
|
+
export function tenantCountryCode(t) {
|
|
26
|
+
return TENANT_COUNTRY_CODES[t];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Configuration to start a Spare Link payment flow. */
|
|
30
|
+
|
|
31
|
+
/** Resolved base URL: explicit `baseUrl` if provided, else the environment default. */
|
|
32
|
+
export function resolvedBaseUrl(config) {
|
|
33
|
+
return config.baseUrl ?? defaultBaseUrlFor(config.environment);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Recovery config — like {@link SpareLinkConfig} but without `linkToken`
|
|
38
|
+
* (read from the persisted record).
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
export function resolvedResumeBaseUrl(config) {
|
|
42
|
+
return config.baseUrl ?? defaultBaseUrlFor(config.environment);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Throws if a SpareLinkConfig is structurally invalid. */
|
|
46
|
+
export function assertValidConfig(config) {
|
|
47
|
+
if (!config.linkToken) {
|
|
48
|
+
throw new Error('SpareLinkConfig: linkToken must not be empty');
|
|
49
|
+
}
|
|
50
|
+
if (config.baseUrl && !/^https?:\/\//.test(config.baseUrl)) {
|
|
51
|
+
throw new Error('SpareLinkConfig: baseUrl must start with http:// or https://');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=spare-link-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_BASE_URLS","sandbox","production","defaultBaseUrlFor","env","TENANT_COUNTRY_CODES","ksa","uae","bah","tenantCountryCode","t","resolvedBaseUrl","config","baseUrl","environment","resolvedResumeBaseUrl","assertValidConfig","linkToken","Error","test"],"sourceRoot":"../../../src","sources":["public/spare-link-config.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMA,iBAAqD,GAAG;EAC5DC,OAAO,EAAE,iCAAiC;EAC1CC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,SAASC,iBAAiBA,CAACC,GAAuB,EAAU;EACjE,OAAOJ,iBAAiB,CAACI,GAAG,CAAC;AAC/B;;AAEA;;AAGA,MAAMC,oBAAoD,GAAG;EAC3DC,GAAG,EAAE,KAAK;EACVC,GAAG,EAAE,KAAK;EACVC,GAAG,EAAE;AACP,CAAC;AAED,OAAO,SAASC,iBAAiBA,CAACC,CAAiB,EAAU;EAC3D,OAAOL,oBAAoB,CAACK,CAAC,CAAC;AAChC;;AAEA;;AA2BA;AACA,OAAO,SAASC,eAAeA,CAACC,MAAuB,EAAU;EAC/D,OAAOA,MAAM,CAACC,OAAO,IAAIV,iBAAiB,CAACS,MAAM,CAACE,WAAW,CAAC;AAChE;;AAEA;AACA;AACA;AACA;;AASA,OAAO,SAASC,qBAAqBA,CAACH,MAA6B,EAAU;EAC3E,OAAOA,MAAM,CAACC,OAAO,IAAIV,iBAAiB,CAACS,MAAM,CAACE,WAAW,CAAC;AAChE;;AAEA;AACA,OAAO,SAASE,iBAAiBA,CAACJ,MAAuB,EAAQ;EAC/D,IAAI,CAACA,MAAM,CAACK,SAAS,EAAE;IACrB,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EACA,IAAIN,MAAM,CAACC,OAAO,IAAI,CAAC,cAAc,CAACM,IAAI,CAACP,MAAM,CAACC,OAAO,CAAC,EAAE;IAC1D,MAAM,IAAIK,KAAK,CAAC,8DAA8D,CAAC;EACjF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle events emitted on {@link SpareLink.events}.
|
|
5
|
+
*
|
|
6
|
+
* This is a discriminated union (TypeScript's equivalent to Dart sealed classes).
|
|
7
|
+
* Use a switch on the `type` field for exhaustive handling:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* spareLink.events.subscribe((event) => {
|
|
11
|
+
* switch (event.type) {
|
|
12
|
+
* case 'initialized':
|
|
13
|
+
* console.log('Started flow for', event.linkToken);
|
|
14
|
+
* break;
|
|
15
|
+
* case 'sessionLoaded':
|
|
16
|
+
* console.log('Session loaded', event.linkSessionId);
|
|
17
|
+
* break;
|
|
18
|
+
* case 'succeeded':
|
|
19
|
+
* console.log('Payment succeeded', event.result.exchangeCode);
|
|
20
|
+
* break;
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/** The SDK has started a payment flow. */
|
|
28
|
+
|
|
29
|
+
/** The payment session was loaded from the server. */
|
|
30
|
+
|
|
31
|
+
/** The user confirmed consent and a consent request was submitted. */
|
|
32
|
+
|
|
33
|
+
/** The user is being redirected to their bank's authorization page. */
|
|
34
|
+
|
|
35
|
+
/** The bank has redirected back with a callback URI. */
|
|
36
|
+
|
|
37
|
+
/** The payment completed successfully and the flow is about to resolve. */
|
|
38
|
+
|
|
39
|
+
/** The payment failed and the flow is about to resolve. */
|
|
40
|
+
|
|
41
|
+
/** The user cancelled the payment and the flow is about to resolve. */
|
|
42
|
+
|
|
43
|
+
/** The flow was abandoned without an explicit user action. */
|
|
44
|
+
|
|
45
|
+
/** All possible event type strings for type narrowing. */
|
|
46
|
+
export const SPARE_LINK_EVENT_TYPES = ['initialized', 'sessionLoaded', 'consentStarted', 'redirectToBank', 'bankCallbackReceived', 'succeeded', 'failed', 'cancelled', 'abandoned'];
|
|
47
|
+
/** Type guard for SpareLinkEvent. */
|
|
48
|
+
export function isSpareLinkEvent(value) {
|
|
49
|
+
if (typeof value !== 'object' || value === null) return false;
|
|
50
|
+
const type = value.type;
|
|
51
|
+
return typeof type === 'string' && SPARE_LINK_EVENT_TYPES.includes(type);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Factory functions for creating events (internal use). */
|
|
55
|
+
export const SpareLinkEvents = {
|
|
56
|
+
initialized(linkToken) {
|
|
57
|
+
return {
|
|
58
|
+
type: 'initialized',
|
|
59
|
+
linkToken
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
sessionLoaded(linkToken, linkSessionId) {
|
|
63
|
+
return linkSessionId ? {
|
|
64
|
+
type: 'sessionLoaded',
|
|
65
|
+
linkToken,
|
|
66
|
+
linkSessionId
|
|
67
|
+
} : {
|
|
68
|
+
type: 'sessionLoaded',
|
|
69
|
+
linkToken
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
consentStarted(linkToken) {
|
|
73
|
+
return {
|
|
74
|
+
type: 'consentStarted',
|
|
75
|
+
linkToken
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
redirectToBank(linkToken) {
|
|
79
|
+
return {
|
|
80
|
+
type: 'redirectToBank',
|
|
81
|
+
linkToken
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
bankCallbackReceived(linkToken) {
|
|
85
|
+
return {
|
|
86
|
+
type: 'bankCallbackReceived',
|
|
87
|
+
linkToken
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
succeeded(result) {
|
|
91
|
+
return {
|
|
92
|
+
type: 'succeeded',
|
|
93
|
+
result
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
failed(result) {
|
|
97
|
+
return {
|
|
98
|
+
type: 'failed',
|
|
99
|
+
result
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
cancelled(result) {
|
|
103
|
+
return {
|
|
104
|
+
type: 'cancelled',
|
|
105
|
+
result
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
abandoned(result) {
|
|
109
|
+
return {
|
|
110
|
+
type: 'abandoned',
|
|
111
|
+
result
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=spare-link-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SPARE_LINK_EVENT_TYPES","isSpareLinkEvent","value","type","includes","SpareLinkEvents","initialized","linkToken","sessionLoaded","linkSessionId","consentStarted","redirectToBank","bankCallbackReceived","succeeded","result","failed","cancelled","abandoned"],"sourceRoot":"../../../src","sources":["public/spare-link-event.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;;AAMA;;AAQA;;AAMA;;AAMA;;AAMA;;AAMA;;AAMA;;AAMA;;AAMA;AACA,OAAO,MAAMA,sBAAsB,GAAG,CACpC,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,CACH;AAIV;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAAc,EAA2B;EACxE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE,OAAO,KAAK;EAC7D,MAAMC,IAAI,GAAID,KAAK,CAAwBC,IAAI;EAC/C,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIH,sBAAsB,CAACI,QAAQ,CAACD,IAA0B,CAAC;AAChG;;AAEA;AACA,OAAO,MAAME,eAAe,GAAG;EAC7BC,WAAWA,CAACC,SAAiB,EAAwB;IACnD,OAAO;MAAEJ,IAAI,EAAE,aAAa;MAAEI;IAAU,CAAC;EAC3C,CAAC;EACDC,aAAaA,CAACD,SAAiB,EAAEE,aAAsB,EAA0B;IAC/E,OAAOA,aAAa,GAChB;MAAEN,IAAI,EAAE,eAAe;MAAEI,SAAS;MAAEE;IAAc,CAAC,GACnD;MAAEN,IAAI,EAAE,eAAe;MAAEI;IAAU,CAAC;EAC1C,CAAC;EACDG,cAAcA,CAACH,SAAiB,EAA2B;IACzD,OAAO;MAAEJ,IAAI,EAAE,gBAAgB;MAAEI;IAAU,CAAC;EAC9C,CAAC;EACDI,cAAcA,CAACJ,SAAiB,EAA2B;IACzD,OAAO;MAAEJ,IAAI,EAAE,gBAAgB;MAAEI;IAAU,CAAC;EAC9C,CAAC;EACDK,oBAAoBA,CAACL,SAAiB,EAAiC;IACrE,OAAO;MAAEJ,IAAI,EAAE,sBAAsB;MAAEI;IAAU,CAAC;EACpD,CAAC;EACDM,SAASA,CAACC,MAAqB,EAAsB;IACnD,OAAO;MAAEX,IAAI,EAAE,WAAW;MAAEW;IAAO,CAAC;EACtC,CAAC;EACDC,MAAMA,CAACD,MAAqB,EAAmB;IAC7C,OAAO;MAAEX,IAAI,EAAE,QAAQ;MAAEW;IAAO,CAAC;EACnC,CAAC;EACDE,SAASA,CAACF,MAAqB,EAAsB;IACnD,OAAO;MAAEX,IAAI,EAAE,WAAW;MAAEW;IAAO,CAAC;EACtC,CAAC;EACDG,SAASA,CAACH,MAAqB,EAAsB;IACnD,OAAO;MAAEX,IAAI,EAAE,WAAW;MAAEW;IAAO,CAAC;EACtC;AACF,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["public/spare-link-host-api.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEventEmitter } from "../internal/event-emitter.js";
|
|
4
|
+
import { paymentAbandoned } from "./payment-result.js";
|
|
5
|
+
import { isSessionRecovered } from "./recovery-result.js";
|
|
6
|
+
import { defaultBaseUrlFor } from "./spare-link-config.js";
|
|
7
|
+
import { SpareLinkEvents } from "./spare-link-event.js";
|
|
8
|
+
import { SpareLinkSession } from "./spare-link-session.js";
|
|
9
|
+
/**
|
|
10
|
+
* Entry point for the Spare Link payment SDK — aligned with Flutter's
|
|
11
|
+
* instance-based {@link SpareLink} API.
|
|
12
|
+
*
|
|
13
|
+
* Mount {@link SpareLinkHost} once near your app root and pass this instance:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const spareLink = useMemo(
|
|
17
|
+
* () => new SpareLink({ environment: 'sandbox', tenant: 'uae' }),
|
|
18
|
+
* [],
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* <SpareLinkHost spareLink={spareLink}>
|
|
22
|
+
* <App />
|
|
23
|
+
* </SpareLinkHost>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export class SpareLink {
|
|
27
|
+
_events = createEventEmitter();
|
|
28
|
+
_host = null;
|
|
29
|
+
_disposed = false;
|
|
30
|
+
_pendingStarts = [];
|
|
31
|
+
_pendingRedirects = [];
|
|
32
|
+
_pendingResumes = [];
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.environment = options.environment;
|
|
35
|
+
this.tenant = options.tenant;
|
|
36
|
+
this.baseUrl = options.baseUrl;
|
|
37
|
+
this.fetch = options.fetch;
|
|
38
|
+
this.requestTimeoutMs = options.requestTimeoutMs;
|
|
39
|
+
this.pendingSessionStore = options.pendingSessionStore;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Lifecycle events for all flows started on this instance. */
|
|
43
|
+
get events() {
|
|
44
|
+
return this._events;
|
|
45
|
+
}
|
|
46
|
+
get resolvedBaseUrl() {
|
|
47
|
+
return this.baseUrl ?? defaultBaseUrlFor(this.environment);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Returns `true` while a payment flow started via {@link start} is in progress. */
|
|
51
|
+
get isFlowActive() {
|
|
52
|
+
return this._host?.isFlowActive() ?? false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Starts a new payment flow.
|
|
57
|
+
*
|
|
58
|
+
* Returns a {@link SpareLinkSession} immediately; await `session.result`
|
|
59
|
+
* for the terminal outcome.
|
|
60
|
+
*/
|
|
61
|
+
async start(args) {
|
|
62
|
+
const {
|
|
63
|
+
linkToken
|
|
64
|
+
} = args;
|
|
65
|
+
if (!linkToken) {
|
|
66
|
+
const result = paymentAbandoned({
|
|
67
|
+
linkToken: '',
|
|
68
|
+
message: 'SpareLinkConfig: linkToken must not be empty',
|
|
69
|
+
resolvedAtMs: Date.now()
|
|
70
|
+
});
|
|
71
|
+
this._emitTerminal(result);
|
|
72
|
+
return new SpareLinkSession({
|
|
73
|
+
linkToken: '',
|
|
74
|
+
result: Promise.resolve(result)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (this._disposed) {
|
|
78
|
+
const result = paymentAbandoned({
|
|
79
|
+
linkToken,
|
|
80
|
+
message: 'SpareLink has been disposed.',
|
|
81
|
+
resolvedAtMs: Date.now()
|
|
82
|
+
});
|
|
83
|
+
this._emitTerminal(result);
|
|
84
|
+
return new SpareLinkSession({
|
|
85
|
+
linkToken,
|
|
86
|
+
result: Promise.resolve(result)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
this._events.emit(SpareLinkEvents.initialized(linkToken));
|
|
90
|
+
if (!this._host) {
|
|
91
|
+
return new Promise(resolve => {
|
|
92
|
+
this._pendingStarts.push({
|
|
93
|
+
linkToken,
|
|
94
|
+
resolve
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return this._hostStart(linkToken);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Processes a deep-link URI received from the bank. */
|
|
102
|
+
async handleRedirect(uri) {
|
|
103
|
+
if (this._disposed) return false;
|
|
104
|
+
if (!this._host) {
|
|
105
|
+
return new Promise(resolve => {
|
|
106
|
+
this._pendingRedirects.push({
|
|
107
|
+
uri,
|
|
108
|
+
resolve
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return this._host.handleRedirect(uri);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Checks for a pending session saved during a previous flow and recovers it. */
|
|
116
|
+
async resumeIfNeeded() {
|
|
117
|
+
if (this._disposed) {
|
|
118
|
+
return {
|
|
119
|
+
kind: 'none',
|
|
120
|
+
reason: 'persistenceUnavailable'
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (!this.pendingSessionStore) {
|
|
124
|
+
return {
|
|
125
|
+
kind: 'none',
|
|
126
|
+
reason: 'persistenceUnavailable'
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (!this._host) {
|
|
130
|
+
return new Promise(resolve => {
|
|
131
|
+
this._pendingResumes.push({
|
|
132
|
+
resolve
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return this._host.resumeIfNeeded();
|
|
137
|
+
}
|
|
138
|
+
dispose() {
|
|
139
|
+
this._disposed = true;
|
|
140
|
+
const starts = this._pendingStarts.splice(0);
|
|
141
|
+
const redirects = this._pendingRedirects.splice(0);
|
|
142
|
+
const resumes = this._pendingResumes.splice(0);
|
|
143
|
+
for (const p of starts) {
|
|
144
|
+
const result = paymentAbandoned({
|
|
145
|
+
linkToken: p.linkToken,
|
|
146
|
+
message: 'SpareLink has been disposed.',
|
|
147
|
+
resolvedAtMs: Date.now()
|
|
148
|
+
});
|
|
149
|
+
this._emitTerminal(result);
|
|
150
|
+
p.resolve(new SpareLinkSession({
|
|
151
|
+
linkToken: p.linkToken,
|
|
152
|
+
result: Promise.resolve(result)
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
for (const p of redirects) {
|
|
156
|
+
p.resolve(false);
|
|
157
|
+
}
|
|
158
|
+
for (const p of resumes) {
|
|
159
|
+
p.resolve({
|
|
160
|
+
kind: 'none',
|
|
161
|
+
reason: 'persistenceUnavailable'
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
this._events.dispose();
|
|
165
|
+
this._host = null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Called by {@link SpareLinkHost} on mount. Drains any buffered calls.
|
|
170
|
+
*
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
_attachHost(host) {
|
|
174
|
+
this._host = host;
|
|
175
|
+
this._drainPending(host);
|
|
176
|
+
return () => {
|
|
177
|
+
if (this._host === host) this._host = null;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** @internal */
|
|
182
|
+
emitEvent(event) {
|
|
183
|
+
this._events.emit(event);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** @internal */
|
|
187
|
+
emitTerminal(result) {
|
|
188
|
+
this._emitTerminal(result);
|
|
189
|
+
}
|
|
190
|
+
_emitTerminal(result) {
|
|
191
|
+
switch (result.status) {
|
|
192
|
+
case 'success':
|
|
193
|
+
this._events.emit(SpareLinkEvents.succeeded(result));
|
|
194
|
+
break;
|
|
195
|
+
case 'failed':
|
|
196
|
+
this._events.emit(SpareLinkEvents.failed(result));
|
|
197
|
+
break;
|
|
198
|
+
case 'cancelled':
|
|
199
|
+
this._events.emit(SpareLinkEvents.cancelled(result));
|
|
200
|
+
break;
|
|
201
|
+
case 'abandoned':
|
|
202
|
+
this._events.emit(SpareLinkEvents.abandoned(result));
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
async _hostStart(linkToken) {
|
|
207
|
+
const host = this._host;
|
|
208
|
+
if (!host) {
|
|
209
|
+
return new Promise(resolve => {
|
|
210
|
+
this._pendingStarts.push({
|
|
211
|
+
linkToken,
|
|
212
|
+
resolve
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
let resolveResult;
|
|
217
|
+
const resultPromise = new Promise(resolve => {
|
|
218
|
+
resolveResult = resolve;
|
|
219
|
+
});
|
|
220
|
+
const session = new SpareLinkSession({
|
|
221
|
+
linkToken,
|
|
222
|
+
result: resultPromise
|
|
223
|
+
});
|
|
224
|
+
host.startFlow({
|
|
225
|
+
linkToken,
|
|
226
|
+
resolve: result => {
|
|
227
|
+
this._emitTerminal(result);
|
|
228
|
+
resolveResult(result);
|
|
229
|
+
},
|
|
230
|
+
onSessionLoaded: linkSessionId => {
|
|
231
|
+
session.updateLinkSessionId(linkSessionId);
|
|
232
|
+
this._events.emit(SpareLinkEvents.sessionLoaded(linkToken, linkSessionId));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
return session;
|
|
236
|
+
}
|
|
237
|
+
_drainPending(host) {
|
|
238
|
+
const starts = this._pendingStarts.splice(0);
|
|
239
|
+
const redirects = this._pendingRedirects.splice(0);
|
|
240
|
+
const resumes = this._pendingResumes.splice(0);
|
|
241
|
+
for (const p of starts) {
|
|
242
|
+
void this._hostStart(p.linkToken).then(p.resolve);
|
|
243
|
+
}
|
|
244
|
+
for (const p of redirects) {
|
|
245
|
+
void host.handleRedirect(p.uri).then(p.resolve, () => p.resolve(false));
|
|
246
|
+
}
|
|
247
|
+
for (const p of resumes) {
|
|
248
|
+
void host.resumeIfNeeded().then(p.resolve, () => p.resolve({
|
|
249
|
+
kind: 'none',
|
|
250
|
+
reason: 'persistenceUnavailable'
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Map legacy recovery helper outcomes to Flutter-aligned {@link RecoveryResult}. */
|
|
257
|
+
export function mapHostRecovery(recovery) {
|
|
258
|
+
if (recovery.kind === 'inProgress') {
|
|
259
|
+
return {
|
|
260
|
+
kind: 'awaitingUser',
|
|
261
|
+
linkToken: recovery.linkToken
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
return recovery;
|
|
265
|
+
}
|
|
266
|
+
export function noRecovery(reason) {
|
|
267
|
+
return {
|
|
268
|
+
kind: 'none',
|
|
269
|
+
reason
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
export { isSessionRecovered };
|
|
273
|
+
//# sourceMappingURL=spare-link-instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEventEmitter","paymentAbandoned","isSessionRecovered","defaultBaseUrlFor","SpareLinkEvents","SpareLinkSession","SpareLink","_events","_host","_disposed","_pendingStarts","_pendingRedirects","_pendingResumes","constructor","options","environment","tenant","baseUrl","fetch","requestTimeoutMs","pendingSessionStore","events","resolvedBaseUrl","isFlowActive","start","args","linkToken","result","message","resolvedAtMs","Date","now","_emitTerminal","Promise","resolve","emit","initialized","push","_hostStart","handleRedirect","uri","resumeIfNeeded","kind","reason","dispose","starts","splice","redirects","resumes","p","_attachHost","host","_drainPending","emitEvent","event","emitTerminal","status","succeeded","failed","cancelled","abandoned","resolveResult","resultPromise","session","startFlow","onSessionLoaded","linkSessionId","updateLinkSessionId","sessionLoaded","then","mapHostRecovery","recovery","noRecovery"],"sourceRoot":"../../../src","sources":["public/spare-link-instance.ts"],"mappings":";;AACA,SAA4BA,kBAAkB,QAAQ,8BAA2B;AACjF,SAA6BC,gBAAgB,QAAQ,qBAAkB;AACvE,SAAqDC,kBAAkB,QAAQ,sBAAmB;AAClG,SAGEC,iBAAiB,QACZ,wBAAqB;AAC5B,SAA8BC,eAAe,QAAQ,uBAAoB;AAEzE,SAASC,gBAAgB,QAAQ,yBAAsB;AA0BvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,CAAC;EAQJC,OAAO,GAAGP,kBAAkB,CAAiB,CAAC;EACvDQ,KAAK,GAAiC,IAAI;EAC1CC,SAAS,GAAG,KAAK;EAERC,cAAc,GAAmB,EAAE;EACnCC,iBAAiB,GAAsB,EAAE;EACzCC,eAAe,GAAoB,EAAE;EAEtDC,WAAWA,CAACC,OAAyB,EAAE;IACrC,IAAI,CAACC,WAAW,GAAGD,OAAO,CAACC,WAAW;IACtC,IAAI,CAACC,MAAM,GAAGF,OAAO,CAACE,MAAM;IAC5B,IAAI,CAACC,OAAO,GAAGH,OAAO,CAACG,OAAO;IAC9B,IAAI,CAACC,KAAK,GAAGJ,OAAO,CAACI,KAAK;IAC1B,IAAI,CAACC,gBAAgB,GAAGL,OAAO,CAACK,gBAAgB;IAChD,IAAI,CAACC,mBAAmB,GAAGN,OAAO,CAACM,mBAAmB;EACxD;;EAEA;EACA,IAAIC,MAAMA,CAAA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AAM;QAAEC,MAAM,EAAE;MAAyB,CAAC,CAAC,CAAC;IACzF;EACF;AACF;;AAEA;AACA,OAAO,SAAS2B,eAAeA,CAC7BC,QAAoE,EACpD;EAChB,IAAIA,QAAQ,CAAC7B,IAAI,KAAK,YAAY,EAAE;IAClC,OAAO;MAAEA,IAAI,EAAE,cAAc;MAAEhB,SAAS,EAAE6C,QAAQ,CAAC7C;IAAU,CAAC;EAChE;EACA,OAAO6C,QAAQ;AACjB;AAEA,OAAO,SAASC,UAAUA,CAAC7B,MAAwB,EAAkB;EACnE,OAAO;IAAED,IAAI,EAAE,MAAM;IAAEC;EAAO,CAAC;AACjC;AAEA,SAASzC,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Handle for an in-flight or completed payment started via {@link SpareLink.start}.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors Flutter's `SpareLinkSession` — `linkToken` is available immediately;
|
|
7
|
+
* await `result` for the terminal outcome.
|
|
8
|
+
*/
|
|
9
|
+
export class SpareLinkSession {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
this.linkToken = args.linkToken;
|
|
12
|
+
this.linkSessionId = args.linkSessionId;
|
|
13
|
+
this.result = args.result;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Called internally when the server provides {@link linkSessionId}. */
|
|
17
|
+
updateLinkSessionId(value) {
|
|
18
|
+
this.linkSessionId = value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=spare-link-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SpareLinkSession","constructor","args","linkToken","linkSessionId","result","updateLinkSessionId","value"],"sourceRoot":"../../../src","sources":["public/spare-link-session.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,CAAC;EAK5BC,WAAWA,CAACC,IAIX,EAAE;IACD,IAAI,CAACC,SAAS,GAAGD,IAAI,CAACC,SAAS;IAC/B,IAAI,CAACC,aAAa,GAAGF,IAAI,CAACE,aAAa;IACvC,IAAI,CAACC,MAAM,GAAGH,IAAI,CAACG,MAAM;EAC3B;;EAEA;EACAC,mBAAmBA,CAACC,KAAa,EAAQ;IACvC,IAAI,CAACH,aAAa,GAAGG,KAAK;EAC5B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SpareLink","mapHostRecovery","noRecovery","isSessionRecovered"],"sourceRoot":"../../../src","sources":["public/spare-link.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,eAAe,EAAEC,UAAU,EAAEC,kBAAkB,QAAQ,0BAAuB","ignoreList":[]}
|