@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,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MAX_RECOVERABLE_AGE_MS = void 0;
|
|
7
|
+
exports.executeResumeIfNeeded = executeResumeIfNeeded;
|
|
8
|
+
var _constants = require("../../public/constants.js");
|
|
9
|
+
var _paymentResult = require("../../public/payment-result.js");
|
|
10
|
+
var _spareLinkConfig = require("../../public/spare-link-config.js");
|
|
11
|
+
var _linkApiClient = require("../client/link-api-client.js");
|
|
12
|
+
var _paymentFlowController = require("./payment-flow-controller.js");
|
|
13
|
+
var _paymentResultMapper = require("./payment-result-mapper.js");
|
|
14
|
+
var _redirectBuffer = require("./redirect-buffer.js");
|
|
15
|
+
const MAX_RECOVERABLE_AGE_MS = exports.MAX_RECOVERABLE_AGE_MS = 30 * 60 * 1000;
|
|
16
|
+
function merchantRefFromUri(uri) {
|
|
17
|
+
try {
|
|
18
|
+
const value = new URL(uri).searchParams.get('merchantRef');
|
|
19
|
+
return value && value.length > 0 ? value : undefined;
|
|
20
|
+
} catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Requires a positive `merchantRef` bind between the buffered URI and the
|
|
27
|
+
* pending record — if either side lacks one we can't confirm the URI belongs
|
|
28
|
+
* to this session, so it must not be applied (a stale/unbound URI could
|
|
29
|
+
* otherwise attach to the wrong pending session).
|
|
30
|
+
*/
|
|
31
|
+
function bufferedUriMatchesRecord(uri, record) {
|
|
32
|
+
const uriMerchantRef = merchantRefFromUri(uri);
|
|
33
|
+
if (!record.merchantRef || !uriMerchantRef) return false;
|
|
34
|
+
return record.merchantRef === uriMerchantRef;
|
|
35
|
+
}
|
|
36
|
+
function createResumeApiClient(config) {
|
|
37
|
+
return new _linkApiClient.LinkApiClient({
|
|
38
|
+
baseUrl: config.baseUrl ?? (0, _spareLinkConfig.defaultBaseUrlFor)(config.environment),
|
|
39
|
+
tenant: (0, _spareLinkConfig.tenantCountryCode)(config.tenant),
|
|
40
|
+
...(config.fetch ? {
|
|
41
|
+
fetch: config.fetch
|
|
42
|
+
} : {}),
|
|
43
|
+
...(config.requestTimeoutMs !== undefined ? {
|
|
44
|
+
requestTimeoutMs: config.requestTimeoutMs
|
|
45
|
+
} : {})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function createRecoveryController(record, config, store, callbacks) {
|
|
49
|
+
return new _paymentFlowController.PaymentFlowController({
|
|
50
|
+
sessionToken: record.sessionId,
|
|
51
|
+
environment: config.environment,
|
|
52
|
+
apiClient: createResumeApiClient(config),
|
|
53
|
+
pendingSessionStore: store,
|
|
54
|
+
...(callbacks?.onEvent ? {
|
|
55
|
+
onEvent: callbacks.onEvent
|
|
56
|
+
} : {})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async function terminalFromBufferedUri(record, config, store, bufferedUri, callbacks) {
|
|
60
|
+
const controller = createRecoveryController(record, config, store, callbacks);
|
|
61
|
+
try {
|
|
62
|
+
controller.handleCallback(bufferedUri);
|
|
63
|
+
const result = (0, _paymentResultMapper.paymentResultFromFlowState)(controller.state, record.sessionId, record.selectedBankId);
|
|
64
|
+
if (result && (controller.state.phase === 'succeeded' || controller.state.phase === 'failed' || controller.state.phase === 'cancelled')) {
|
|
65
|
+
await store.clear();
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
} finally {
|
|
70
|
+
controller.dispose();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Cold-start recovery orchestrator — mirrors Flutter `SpareLink.resumeIfNeeded`.
|
|
76
|
+
* Returns a terminal {@link PaymentResult}, `null` when nothing to do / still
|
|
77
|
+
* pending, and opens the recovery UI via `openRecoveryFlow` for non-terminal
|
|
78
|
+
* sessions that need user-visible awaiting state.
|
|
79
|
+
*/
|
|
80
|
+
async function executeResumeIfNeeded(args, deps) {
|
|
81
|
+
const {
|
|
82
|
+
pendingSessionStore: store
|
|
83
|
+
} = deps;
|
|
84
|
+
const now = deps.now ?? (() => Date.now());
|
|
85
|
+
if (deps.isFlowActive()) return null;
|
|
86
|
+
let record;
|
|
87
|
+
try {
|
|
88
|
+
record = await store.load();
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
if (!record) return null;
|
|
93
|
+
if (record.consentAt !== undefined && now() - record.consentAt > MAX_RECOVERABLE_AGE_MS) {
|
|
94
|
+
await store.clear();
|
|
95
|
+
return (0, _paymentResult.paymentFailed)({
|
|
96
|
+
linkToken: record.sessionId,
|
|
97
|
+
errorCode: 'session_expired',
|
|
98
|
+
message: 'Pending session is older than the recovery window.',
|
|
99
|
+
resolvedAtMs: now()
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (record.recoveryAttempts >= _constants.kMaxRecoveryAttempts) {
|
|
103
|
+
await store.clear();
|
|
104
|
+
return (0, _paymentResult.paymentFailed)({
|
|
105
|
+
linkToken: record.sessionId,
|
|
106
|
+
errorCode: 'recovery_exhausted',
|
|
107
|
+
message: 'Maximum recovery attempts reached.',
|
|
108
|
+
resolvedAtMs: now()
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Peek first — only consume the buffered URI once we've positively bound it
|
|
113
|
+
// to this record. On mismatch, leave it alone so a genuinely-matching
|
|
114
|
+
// session (checked on a later resume attempt) can still claim it.
|
|
115
|
+
const bufferedUri = (0, _redirectBuffer.peekBufferedRedirect)();
|
|
116
|
+
if (bufferedUri && bufferedUriMatchesRecord(bufferedUri, record)) {
|
|
117
|
+
(0, _redirectBuffer.consumeBufferedRedirect)();
|
|
118
|
+
return terminalFromBufferedUri(record, args.config, store, bufferedUri, args.callbacks);
|
|
119
|
+
}
|
|
120
|
+
const apiClient = createResumeApiClient(args.config);
|
|
121
|
+
try {
|
|
122
|
+
const status = await apiClient.getStatus(record.sessionId);
|
|
123
|
+
await store.save({
|
|
124
|
+
...record,
|
|
125
|
+
recoveryAttempts: record.recoveryAttempts + 1
|
|
126
|
+
});
|
|
127
|
+
switch (status.status) {
|
|
128
|
+
case 'completed':
|
|
129
|
+
await store.clear();
|
|
130
|
+
return (0, _paymentResult.paymentSuccess)({
|
|
131
|
+
linkToken: record.sessionId,
|
|
132
|
+
bankId: record.selectedBankId,
|
|
133
|
+
...(status.linkSessionId ? {
|
|
134
|
+
linkSessionId: status.linkSessionId
|
|
135
|
+
} : {}),
|
|
136
|
+
resolvedAtMs: now()
|
|
137
|
+
});
|
|
138
|
+
case 'failed':
|
|
139
|
+
await store.clear();
|
|
140
|
+
return (0, _paymentResult.paymentFailed)({
|
|
141
|
+
linkToken: record.sessionId,
|
|
142
|
+
errorCode: status.failureCode ?? 'session_failed',
|
|
143
|
+
resolvedAtMs: now()
|
|
144
|
+
});
|
|
145
|
+
case 'cancelled':
|
|
146
|
+
await store.clear();
|
|
147
|
+
return (0, _paymentResult.paymentCancelled)({
|
|
148
|
+
linkToken: record.sessionId,
|
|
149
|
+
bankId: record.selectedBankId,
|
|
150
|
+
resolvedAtMs: now()
|
|
151
|
+
});
|
|
152
|
+
case 'expired':
|
|
153
|
+
await store.clear();
|
|
154
|
+
return (0, _paymentResult.paymentFailed)({
|
|
155
|
+
linkToken: record.sessionId,
|
|
156
|
+
errorCode: 'session_expired',
|
|
157
|
+
resolvedAtMs: now()
|
|
158
|
+
});
|
|
159
|
+
default:
|
|
160
|
+
{
|
|
161
|
+
const controller = createRecoveryController(record, args.config, store, args.callbacks);
|
|
162
|
+
// Hydrate so `state.session` (payment type, mandate details) is
|
|
163
|
+
// available to the recovery UI and threaded into the terminal
|
|
164
|
+
// PaymentResult — without this, resume paths skip the mandate
|
|
165
|
+
// setup-success screen and drop `paymentType` on success.
|
|
166
|
+
await controller.hydrate().catch(() => {
|
|
167
|
+
/* best-effort — recovery still proceeds without session details */
|
|
168
|
+
});
|
|
169
|
+
controller.setAwaitingCallbackState({
|
|
170
|
+
providerName: record.selectedBankId
|
|
171
|
+
});
|
|
172
|
+
deps.openRecoveryFlow({
|
|
173
|
+
controller,
|
|
174
|
+
config: {
|
|
175
|
+
...args.config,
|
|
176
|
+
linkToken: record.sessionId
|
|
177
|
+
},
|
|
178
|
+
...(args.callbacks ? {
|
|
179
|
+
callbacks: args.callbacks
|
|
180
|
+
} : {})
|
|
181
|
+
});
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch {
|
|
186
|
+
const controller = createRecoveryController(record, args.config, store, args.callbacks);
|
|
187
|
+
await controller.hydrate().catch(() => {
|
|
188
|
+
/* best-effort — recovery still proceeds without session details */
|
|
189
|
+
});
|
|
190
|
+
controller.setAwaitingCallbackState({
|
|
191
|
+
providerName: record.selectedBankId
|
|
192
|
+
});
|
|
193
|
+
try {
|
|
194
|
+
await store.save({
|
|
195
|
+
...record,
|
|
196
|
+
recoveryAttempts: record.recoveryAttempts + 1
|
|
197
|
+
});
|
|
198
|
+
} catch {
|
|
199
|
+
/* swallow */
|
|
200
|
+
}
|
|
201
|
+
deps.openRecoveryFlow({
|
|
202
|
+
controller,
|
|
203
|
+
config: {
|
|
204
|
+
...args.config,
|
|
205
|
+
linkToken: record.sessionId
|
|
206
|
+
},
|
|
207
|
+
...(args.callbacks ? {
|
|
208
|
+
callbacks: args.callbacks
|
|
209
|
+
} : {})
|
|
210
|
+
});
|
|
211
|
+
return null;
|
|
212
|
+
} finally {
|
|
213
|
+
apiClient.dispose();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=execute-resume-if-needed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_constants","require","_paymentResult","_spareLinkConfig","_linkApiClient","_paymentFlowController","_paymentResultMapper","_redirectBuffer","MAX_RECOVERABLE_AGE_MS","exports","merchantRefFromUri","uri","value","URL","searchParams","get","length","undefined","bufferedUriMatchesRecord","record","uriMerchantRef","merchantRef","createResumeApiClient","config","LinkApiClient","baseUrl","defaultBaseUrlFor","environment","tenant","tenantCountryCode","fetch","requestTimeoutMs","createRecoveryController","store","callbacks","PaymentFlowController","sessionToken","sessionId","apiClient","pendingSessionStore","onEvent","terminalFromBufferedUri","bufferedUri","controller","handleCallback","result","paymentResultFromFlowState","state","selectedBankId","phase","clear","dispose","executeResumeIfNeeded","args","deps","now","Date","isFlowActive","load","consentAt","paymentFailed","linkToken","errorCode","message","resolvedAtMs","recoveryAttempts","kMaxRecoveryAttempts","peekBufferedRedirect","consumeBufferedRedirect","status","getStatus","save","paymentSuccess","bankId","linkSessionId","failureCode","paymentCancelled","hydrate","catch","setAwaitingCallbackState","providerName","openRecoveryFlow"],"sourceRoot":"../../../../src","sources":["core/services/execute-resume-if-needed.ts"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAEA,IAAAM,eAAA,GAAAN,OAAA;AAEO,MAAMO,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAoBpD,SAASE,kBAAkBA,CAACC,GAAW,EAAsB;EAC3D,IAAI;IACF,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAACF,GAAG,CAAC,CAACG,YAAY,CAACC,GAAG,CAAC,aAAa,CAAC;IAC1D,OAAOH,KAAK,IAAIA,KAAK,CAACI,MAAM,GAAG,CAAC,GAAGJ,KAAK,GAAGK,SAAS;EACtD,CAAC,CAAC,MAAM;IACN,OAAOA,SAAS;EAClB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,wBAAwBA,CAACP,GAAW,EAAEQ,MAA4B,EAAW;EACpF,MAAMC,cAAc,GAAGV,kBAAkB,CAACC,GAAG,CAAC;EAC9C,IAAI,CAACQ,MAAM,CAACE,WAAW,IAAI,CAACD,cAAc,EAAE,OAAO,KAAK;EACxD,OAAOD,MAAM,CAACE,WAAW,KAAKD,cAAc;AAC9C;AAEA,SAASE,qBAAqBA,CAACC,MAA6B,EAAiB;EAC3E,OAAO,IAAIC,4BAAa,CAAC;IACvBC,OAAO,EAAEF,MAAM,CAACE,OAAO,IAAI,IAAAC,kCAAi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,CAAC,CAAC,MAAM;IACN,MAAMS,UAAU,GAAGX,wBAAwB,CAACb,MAAM,EAAEkC,IAAI,CAAC9B,MAAM,EAAEU,KAAK,EAAEoB,IAAI,CAACnB,SAAS,CAAC;IACvF,MAAMS,UAAU,CAACkC,OAAO,CAAC,CAAC,CAACC,KAAK,CAAC,MAAM;MACrC;IAAA,CACD,CAAC;IACFnC,UAAU,CAACoC,wBAAwB,CAAC;MAAEC,YAAY,EAAE7D,MAAM,CAAC6B;IAAe,CAAC,CAAC;IAC5E,IAAI;MACF,MAAMf,KAAK,CAACsC,IAAI,CAAC;QACf,GAAGpD,MAAM;QACT8C,gBAAgB,EAAE9C,MAAM,CAAC8C,gBAAgB,GAAG;MAC9C,CAAC,CAAC;IACJ,CAAC,CAAC,MAAM;MACN;IAAA;IAEFX,IAAI,CAAC2B,gBAAgB,CAAC;MACpBtC,UAAU;MACVpB,MAAM,EAAE;QAAE,GAAG8B,IAAI,CAAC9B,MAAM;QAAEsC,SAAS,EAAE1C,MAAM,CAACkB;MAAU,CAAC;MACvD,IAAIgB,IAAI,CAACnB,SAAS,GAAG;QAAEA,SAAS,EAAEmB,IAAI,CAACnB;MAAU,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,OAAO,IAAI;EACb,CAAC,SAAS;IACRI,SAAS,CAACa,OAAO,CAAC,CAAC;EACrB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildMultiPaymentRules = buildMultiPaymentRules;
|
|
7
|
+
exports.rulesSectionTitle = rulesSectionTitle;
|
|
8
|
+
var _paymentType = require("../models/payment-type.js");
|
|
9
|
+
var _presentationUtils = require("./presentation-utils.js");
|
|
10
|
+
function present(value, fallback = '—') {
|
|
11
|
+
const v = value?.trim();
|
|
12
|
+
return v ? v : fallback;
|
|
13
|
+
}
|
|
14
|
+
function presentInt(value, fallback = '—') {
|
|
15
|
+
if (value === undefined) return fallback;
|
|
16
|
+
return String(value);
|
|
17
|
+
}
|
|
18
|
+
function formatDate(raw) {
|
|
19
|
+
if (!raw?.trim()) return '—';
|
|
20
|
+
const parsed = new Date(raw.trim());
|
|
21
|
+
if (Number.isNaN(parsed.getTime())) return raw.trim();
|
|
22
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
23
|
+
const day = String(parsed.getUTCDate()).padStart(2, '0');
|
|
24
|
+
const month = months[parsed.getUTCMonth()];
|
|
25
|
+
return `${day} ${month} ${parsed.getUTCFullYear()}`;
|
|
26
|
+
}
|
|
27
|
+
function definedSchedule(type, instructions) {
|
|
28
|
+
const isFixed = type === _paymentType.PaymentType.fixedDefinedSchedule;
|
|
29
|
+
const amountLabel = isFixed ? 'Amount' : 'Max Amount';
|
|
30
|
+
const schedule = instructions.paymentSchedule ?? [];
|
|
31
|
+
const rows = [];
|
|
32
|
+
for (const entry of schedule) {
|
|
33
|
+
const amountDto = isFixed ? entry.amount : entry.maxAmount;
|
|
34
|
+
rows.push({
|
|
35
|
+
label: amountLabel,
|
|
36
|
+
value: (0, _presentationUtils.formatAmount)(amountDto)
|
|
37
|
+
});
|
|
38
|
+
rows.push({
|
|
39
|
+
label: 'Date',
|
|
40
|
+
value: formatDate(entry.paymentExecutionDate)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return rows;
|
|
44
|
+
}
|
|
45
|
+
function periodicSchedule(type, instructions) {
|
|
46
|
+
const isFixed = type === _paymentType.PaymentType.fixedPeriodicSchedule;
|
|
47
|
+
const periodic = instructions.periodicSchedule;
|
|
48
|
+
const amountDto = isFixed ? periodic?.amount : periodic?.maxAmount;
|
|
49
|
+
const amountLabel = isFixed ? 'Amount' : 'Max per Payment';
|
|
50
|
+
const rows = [{
|
|
51
|
+
label: amountLabel,
|
|
52
|
+
value: (0, _presentationUtils.formatAmount)(amountDto)
|
|
53
|
+
}, {
|
|
54
|
+
label: 'First Payment Date',
|
|
55
|
+
value: formatDate(periodic?.startDate)
|
|
56
|
+
}, {
|
|
57
|
+
label: 'Payment repeats every',
|
|
58
|
+
value: present(periodic?.frequency)
|
|
59
|
+
}, {
|
|
60
|
+
label: 'Stop payment on',
|
|
61
|
+
value: formatDate(periodic?.endDate)
|
|
62
|
+
}, {
|
|
63
|
+
label: 'Total number of payments',
|
|
64
|
+
value: presentInt(instructions.maxCumulativeNumberOfPayments)
|
|
65
|
+
}];
|
|
66
|
+
if (!isFixed) {
|
|
67
|
+
rows.push({
|
|
68
|
+
label: 'Total Value Allowed',
|
|
69
|
+
value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return rows;
|
|
73
|
+
}
|
|
74
|
+
function fixedOnDemand(instructions) {
|
|
75
|
+
const periodic = instructions.periodicSchedule;
|
|
76
|
+
const frequency = periodic?.frequency;
|
|
77
|
+
return [{
|
|
78
|
+
label: 'Amount',
|
|
79
|
+
value: (0, _presentationUtils.formatAmount)(periodic?.amount)
|
|
80
|
+
}, {
|
|
81
|
+
label: 'Total number of payments allowed',
|
|
82
|
+
value: presentInt(instructions.maxCumulativeNumberOfPayments)
|
|
83
|
+
}, {
|
|
84
|
+
label: 'Total Value Allowed',
|
|
85
|
+
value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
|
|
86
|
+
}, {
|
|
87
|
+
label: 'Limits Every',
|
|
88
|
+
value: present(frequency)
|
|
89
|
+
}, {
|
|
90
|
+
label: `Max Value per ${present(frequency)}`,
|
|
91
|
+
value: (0, _presentationUtils.formatAmount)(periodic?.controls?.maxCumulativeAmountPerPeriod)
|
|
92
|
+
}, {
|
|
93
|
+
label: `Max Payments per ${present(frequency)}`,
|
|
94
|
+
value: presentInt(periodic?.controls?.maxCumulativeNumberOfPaymentsPerPeriod)
|
|
95
|
+
}, {
|
|
96
|
+
label: 'Expiry Date',
|
|
97
|
+
value: formatDate(periodic?.endDate)
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
function variableOnDemand(instructions) {
|
|
101
|
+
const periodic = instructions.periodicSchedule;
|
|
102
|
+
const frequency = periodic?.frequency;
|
|
103
|
+
return [{
|
|
104
|
+
label: 'First Payment Date',
|
|
105
|
+
value: formatDate(periodic?.startDate)
|
|
106
|
+
}, {
|
|
107
|
+
label: 'Expiry Date',
|
|
108
|
+
value: formatDate(periodic?.endDate)
|
|
109
|
+
}, {
|
|
110
|
+
label: 'Max per Payment',
|
|
111
|
+
value: (0, _presentationUtils.formatAmount)(periodic?.maxAmount)
|
|
112
|
+
}, {
|
|
113
|
+
label: 'Total number of payments allowed',
|
|
114
|
+
value: presentInt(instructions.maxCumulativeNumberOfPayments)
|
|
115
|
+
}, {
|
|
116
|
+
label: 'Total Value Allowed',
|
|
117
|
+
value: (0, _presentationUtils.formatAmount)(instructions.maxCumulativeAmount)
|
|
118
|
+
}, {
|
|
119
|
+
label: 'Limits Every',
|
|
120
|
+
value: present(frequency)
|
|
121
|
+
}, {
|
|
122
|
+
label: `Max Value per ${present(frequency)}`,
|
|
123
|
+
value: (0, _presentationUtils.formatAmount)(periodic?.controls?.maxCumulativeAmountPerPeriod)
|
|
124
|
+
}, {
|
|
125
|
+
label: `Max Payments per ${present(frequency)}`,
|
|
126
|
+
value: presentInt(periodic?.controls?.maxCumulativeNumberOfPaymentsPerPeriod)
|
|
127
|
+
}];
|
|
128
|
+
}
|
|
129
|
+
function buildMultiPaymentRules(type, instructions) {
|
|
130
|
+
switch (type) {
|
|
131
|
+
case _paymentType.PaymentType.fixedDefinedSchedule:
|
|
132
|
+
case _paymentType.PaymentType.variableDefinedSchedule:
|
|
133
|
+
return definedSchedule(type, instructions);
|
|
134
|
+
case _paymentType.PaymentType.fixedPeriodicSchedule:
|
|
135
|
+
case _paymentType.PaymentType.variablePeriodicSchedule:
|
|
136
|
+
return periodicSchedule(type, instructions);
|
|
137
|
+
case _paymentType.PaymentType.fixedOnDemand:
|
|
138
|
+
return fixedOnDemand(instructions);
|
|
139
|
+
case _paymentType.PaymentType.variableOnDemand:
|
|
140
|
+
return variableOnDemand(instructions);
|
|
141
|
+
default:
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function rulesSectionTitle(type) {
|
|
146
|
+
if (type === _paymentType.PaymentType.fixedDefinedSchedule || type === _paymentType.PaymentType.variableDefinedSchedule) {
|
|
147
|
+
return 'Payment schedule';
|
|
148
|
+
}
|
|
149
|
+
return 'Payment rules';
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=multi-payment-rules-presenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_paymentType","require","_presentationUtils","present","value","fallback","v","trim","presentInt","undefined","String","formatDate","raw","parsed","Date","Number","isNaN","getTime","months","day","getUTCDate","padStart","month","getUTCMonth","getUTCFullYear","definedSchedule","type","instructions","isFixed","PaymentType","fixedDefinedSchedule","amountLabel","schedule","paymentSchedule","rows","entry","amountDto","amount","maxAmount","push","label","formatAmount","paymentExecutionDate","periodicSchedule","fixedPeriodicSchedule","periodic","startDate","frequency","endDate","maxCumulativeNumberOfPayments","maxCumulativeAmount","fixedOnDemand","controls","maxCumulativeAmountPerPeriod","maxCumulativeNumberOfPaymentsPerPeriod","variableOnDemand","buildMultiPaymentRules","variableDefinedSchedule","variablePeriodicSchedule","rulesSectionTitle"],"sourceRoot":"../../../../src","sources":["core/services/multi-payment-rules-presenter.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAOA,SAASE,OAAOA,CAACC,KAAyB,EAAEC,QAAQ,GAAG,GAAG,EAAU;EAClE,MAAMC,CAAC,GAAGF,KAAK,EAAEG,IAAI,CAAC,CAAC;EACvB,OAAOD,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