@paydock/client-sdk 1.104.3-beta → 1.105.1
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/.nvmrc +1 -0
- package/README.md +572 -290
- package/api.d.ts +1 -0
- package/api.js +1 -0
- package/bundles/widget.umd.js +9130 -8655
- package/bundles/widget.umd.min.js +1 -2
- package/canvas3ds.d.ts +1 -0
- package/canvas3ds.js +1 -0
- package/checkout-button.d.ts +1 -0
- package/checkout-button.js +1 -0
- package/inicialization-guide.md +7 -0
- package/{bundles/types → lib}/api/api-base.d.ts +1 -2
- package/lib/api/api-base.js +101 -0
- package/lib/api/api-base.js.map +1 -0
- package/{bundles/types → lib}/api/api-charge-internal.d.ts +0 -1
- package/lib/api/api-charge-internal.js +30 -0
- package/lib/api/api-charge-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api-charge.d.ts +0 -1
- package/lib/api/api-charge.js +49 -0
- package/lib/api/api-charge.js.map +1 -0
- package/{bundles/types → lib}/api/api-internal.d.ts +0 -1
- package/lib/api/api-internal.js +13 -0
- package/lib/api/api-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api-service-internal.d.ts +0 -1
- package/lib/api/api-service-internal.js +18 -0
- package/lib/api/api-service-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api.d.ts +1 -2
- package/lib/api/api.js +62 -0
- package/lib/api/api.js.map +1 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +2 -0
- package/lib/api/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/canvas-3ds.d.ts +1 -2
- package/lib/canvas-3ds/canvas-3ds.js +157 -0
- package/lib/canvas-3ds/canvas-3ds.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/index.d.ts +0 -1
- package/lib/canvas-3ds/index.js +2 -0
- package/lib/canvas-3ds/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/gpayments-service.d.ts +0 -1
- package/lib/canvas-3ds/services/gpayments-service.js +181 -0
- package/lib/canvas-3ds/services/gpayments-service.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/index.d.ts +0 -1
- package/lib/canvas-3ds/services/index.js +2 -0
- package/lib/canvas-3ds/services/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/standalone3ds-service.d.ts +0 -1
- package/lib/canvas-3ds/services/standalone3ds-service.js +32 -0
- package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -2
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js +50 -0
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/afterpay/afterpay.runner.d.ts +0 -1
- package/lib/checkout-button/afterpay/afterpay.runner.js +41 -0
- package/lib/checkout-button/afterpay/afterpay.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/checkout-button.d.ts +1 -2
- package/{bundles/types → lib}/checkout-button/checkout-button.interface.d.ts +0 -1
- package/lib/checkout-button/checkout-button.interface.js +45 -0
- package/lib/checkout-button/checkout-button.interface.js.map +1 -0
- package/lib/checkout-button/checkout-button.js +266 -0
- package/lib/checkout-button/checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/checkout-contextual-handler.d.ts +0 -1
- package/lib/checkout-button/checkout-contextual-handler.js +75 -0
- package/lib/checkout-button/checkout-contextual-handler.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/index.d.ts +1 -2
- package/lib/checkout-button/index.js +85 -0
- package/lib/checkout-button/index.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -2
- package/lib/checkout-button/paypal/paypal-checkout-button.js +25 -0
- package/lib/checkout-button/paypal/paypal-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/paypal/paypal.runner.d.ts +0 -1
- package/lib/checkout-button/paypal/paypal.runner.js +14 -0
- package/lib/checkout-button/paypal/paypal.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/base.runner.d.ts +3 -4
- package/lib/checkout-button/runner/base.runner.js +13 -0
- package/lib/checkout-button/runner/base.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/contextual.runner.d.ts +1 -2
- package/lib/checkout-button/runner/contextual.runner.js +40 -0
- package/lib/checkout-button/runner/contextual.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/index.d.ts +0 -1
- package/lib/checkout-button/runner/index.js +11 -0
- package/lib/checkout-button/runner/index.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/popup.runner.d.ts +1 -2
- package/lib/checkout-button/runner/popup.runner.js +68 -0
- package/lib/checkout-button/runner/popup.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/redirect.runner.d.ts +1 -2
- package/lib/checkout-button/runner/redirect.runner.js +15 -0
- package/lib/checkout-button/runner/redirect.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +64 -0
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +78 -0
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +49 -0
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.config.d.ts +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.config.js +4 -0
- package/lib/checkout-button/zipmoney/zipmoney.config.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney.runner.js +23 -0
- package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.types.d.ts +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.types.js +1 -0
- package/lib/checkout-button/zipmoney/zipmoney.types.js.map +1 -0
- package/{bundles/types → lib}/components/ability-guard.d.ts +0 -1
- package/lib/components/ability-guard.js +44 -0
- package/lib/components/ability-guard.js.map +1 -0
- package/{bundles/types → lib}/components/background.d.ts +0 -1
- package/lib/components/background.js +193 -0
- package/lib/components/background.js.map +1 -0
- package/{bundles/types → lib}/components/container.d.ts +1 -1
- package/lib/components/container.js +63 -0
- package/lib/components/container.js.map +1 -0
- package/{bundles/types → lib}/components/dispatcher.d.ts +1 -2
- package/lib/components/dispatcher.js +39 -0
- package/lib/components/dispatcher.js.map +1 -0
- package/{bundles/types → lib}/components/element-style.d.ts +1 -2
- package/lib/components/element-style.js +52 -0
- package/lib/components/element-style.js.map +1 -0
- package/{bundles/types → lib}/components/flypay-iframe-event.d.ts +0 -1
- package/lib/components/flypay-iframe-event.js +28 -0
- package/lib/components/flypay-iframe-event.js.map +1 -0
- package/{bundles/types/components/form-interceptor.d.ts → lib/components/form-Interceptor.d.ts} +0 -1
- package/lib/components/form-Interceptor.js +38 -0
- package/lib/components/form-Interceptor.js.map +1 -0
- package/{bundles/types → lib}/components/http-core.d.ts +0 -1
- package/lib/components/http-core.js +57 -0
- package/lib/components/http-core.js.map +1 -0
- package/{bundles/types → lib}/components/iframe-event.d.ts +15 -13
- package/lib/components/iframe-event.js +75 -0
- package/lib/components/iframe-event.js.map +1 -0
- package/{bundles/types → lib}/components/iframe.d.ts +0 -1
- package/lib/components/iframe.js +62 -0
- package/lib/components/iframe.js.map +1 -0
- package/{bundles/types → lib}/components/link.d.ts +1 -2
- package/lib/components/link.js +59 -0
- package/lib/components/link.js.map +1 -0
- package/{bundles/types → lib}/components/loader.d.ts +0 -1
- package/lib/components/loader.js +234 -0
- package/lib/components/loader.js.map +1 -0
- package/{bundles/types → lib}/components/param.d.ts +9 -12
- package/lib/components/param.js +147 -0
- package/lib/components/param.js.map +1 -0
- package/{bundles/types → lib}/components/popup.d.ts +0 -1
- package/lib/components/popup.js +104 -0
- package/lib/components/popup.js.map +1 -0
- package/{bundles/types → lib}/components/storage-dispatcher.d.ts +0 -1
- package/lib/components/storage-dispatcher.js +75 -0
- package/lib/components/storage-dispatcher.js.map +1 -0
- package/{bundles/types → lib}/components/trigger.d.ts +0 -1
- package/lib/components/trigger.js +49 -0
- package/lib/components/trigger.js.map +1 -0
- package/{bundles/types → lib}/components/vault-display-iframe-event.d.ts +0 -1
- package/lib/components/vault-display-iframe-event.js +27 -0
- package/lib/components/vault-display-iframe-event.js.map +1 -0
- package/{bundles/types → lib}/components/wallet-background.d.ts +2 -2
- package/lib/components/wallet-background.js +63 -0
- package/lib/components/wallet-background.js.map +1 -0
- package/{bundles/types → lib}/components/wallet-trigger.d.ts +0 -1
- package/lib/components/wallet-trigger.js +27 -0
- package/lib/components/wallet-trigger.js.map +1 -0
- package/{bundles/types/configs/env/environment.paydock.d.ts → lib/configs/env/env.d.ts} +8 -5
- package/lib/configs/env/env.js +117 -0
- package/lib/configs/env/env.js.map +1 -0
- package/{bundles/types → lib}/configs/sdk.d.ts +2 -3
- package/lib/configs/sdk.js +16 -0
- package/lib/configs/sdk.js.map +1 -0
- package/lib/constants/validators.d.ts +44 -0
- package/lib/constants/validators.js +42 -0
- package/lib/constants/validators.js.map +1 -0
- package/{bundles/types → lib}/external-checkout/builder.d.ts +0 -1
- package/lib/external-checkout/builder.js +45 -0
- package/lib/external-checkout/builder.js.map +1 -0
- package/{bundles/types → lib}/external-checkout/checker.d.ts +0 -1
- package/lib/external-checkout/checker.js +22 -0
- package/lib/external-checkout/checker.js.map +1 -0
- package/lib/external-checkout/index.d.ts +2 -0
- package/lib/external-checkout/index.js +3 -0
- package/lib/external-checkout/index.js.map +1 -0
- package/{bundles/types → lib}/helper/access-token.d.ts +0 -1
- package/lib/helper/access-token.js +44 -0
- package/lib/helper/access-token.js.map +1 -0
- package/{bundles/types → lib}/helper/browser.d.ts +0 -1
- package/lib/helper/browser.js +79 -0
- package/lib/helper/browser.js.map +1 -0
- package/{bundles/types → lib}/helper/event-emitter.d.ts +0 -1
- package/lib/helper/event-emitter.js +23 -0
- package/lib/helper/event-emitter.js.map +1 -0
- package/{bundles/types → lib}/helper/event.d.ts +0 -1
- package/lib/helper/event.js +23 -0
- package/lib/helper/event.js.map +1 -0
- package/{bundles/types → lib}/helper/ms.d.ts +0 -1
- package/lib/helper/ms.js +32 -0
- package/lib/helper/ms.js.map +1 -0
- package/{bundles/types → lib}/helper/object.d.ts +0 -1
- package/lib/helper/object.js +6 -0
- package/lib/helper/object.js.map +1 -0
- package/{bundles/types → lib}/helper/url.d.ts +0 -1
- package/lib/helper/url.js +11 -0
- package/lib/helper/url.js.map +1 -0
- package/{bundles/types → lib}/helper/uuid.d.ts +0 -1
- package/lib/helper/uuid.js +26 -0
- package/lib/helper/uuid.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source/builder.d.ts +0 -1
- package/lib/payment-source/builder.js +49 -0
- package/lib/payment-source/builder.js.map +1 -0
- package/{bundles/types → lib}/payment-source/index.d.ts +0 -1
- package/lib/payment-source/index.js +2 -0
- package/lib/payment-source/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/html-payment-source-widget.d.ts +17 -14
- package/lib/payment-source-widget/html-payment-source-widget.js +172 -0
- package/lib/payment-source-widget/html-payment-source-widget.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/index.d.ts +0 -1
- package/lib/payment-source-widget/index.js +35 -0
- package/lib/payment-source-widget/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/interfaces.d.ts +0 -1
- package/lib/payment-source-widget/interfaces.js +2 -0
- package/lib/payment-source-widget/interfaces.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/payment-source-widget.d.ts +1 -2
- package/lib/payment-source-widget/payment-source-widget.js +142 -0
- package/lib/payment-source-widget/payment-source-widget.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/index.d.ts +0 -1
- package/lib/secure-remote-commerce/index.js +2 -0
- package/lib/secure-remote-commerce/index.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/interfaces.d.ts +5 -6
- package/lib/secure-remote-commerce/interfaces.js +28 -0
- package/lib/secure-remote-commerce/interfaces.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/src-provider.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/src-provider.js +1 -0
- package/lib/secure-remote-commerce/providers/src-provider.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/helper.js +36 -0
- package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/index.js +2 -0
- package/lib/secure-remote-commerce/providers/visa-src/index.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/visa-src.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +113 -0
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +10 -0
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/secure-remote-commerce.d.ts +1 -2
- package/lib/secure-remote-commerce/secure-remote-commerce.js +239 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -0
- package/{bundles/types → lib}/vault-display-widget/index.d.ts +0 -1
- package/lib/vault-display-widget/index.js +14 -0
- package/lib/vault-display-widget/index.js.map +1 -0
- package/{bundles/types → lib}/vault-display-widget/vault-display-widget.d.ts +1 -2
- package/lib/vault-display-widget/vault-display-widget.js +99 -0
- package/lib/vault-display-widget/vault-display-widget.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/afterpay.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/afterpay.wallet-service.js +152 -0
- package/lib/wallet-buttons/afterpay.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/apple.wallet-service.d.ts +2 -1
- package/lib/wallet-buttons/apple.wallet-service.js +324 -0
- package/lib/wallet-buttons/apple.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/flypay-v2.wallet-service.d.ts +9 -2
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +165 -0
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/flypay.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/flypay.wallet-service.js +117 -0
- package/lib/wallet-buttons/flypay.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/google.wallet-service.d.ts +3 -1
- package/lib/wallet-buttons/google.wallet-service.js +301 -0
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +3 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js +151 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +1 -0
- package/lib/wallet-buttons/index.d.ts +127 -0
- package/lib/wallet-buttons/index.js +128 -0
- package/lib/wallet-buttons/index.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/interfaces.d.ts +3 -1
- package/lib/wallet-buttons/interfaces.js +1 -0
- package/lib/wallet-buttons/interfaces.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/mastercard.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/mastercard.wallet-service.js +27 -0
- package/lib/wallet-buttons/mastercard.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/paypal.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/paypal.wallet-service.js +144 -0
- package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/stripe.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/stripe.wallet-service.js +100 -0
- package/lib/wallet-buttons/stripe.wallet-service.js.map +1 -0
- package/{bundles/types/wallet-buttons/wallet-cba-buttons.d.ts → lib/wallet-buttons/wallet-buttons.d.ts} +92 -115
- package/lib/wallet-buttons/wallet-buttons.js +479 -0
- package/lib/wallet-buttons/wallet-buttons.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/wallet-service.d.ts +7 -1
- package/lib/wallet-buttons/wallet-service.js +60 -0
- package/lib/wallet-buttons/wallet-service.js.map +1 -0
- package/{bundles/types → lib}/widget/configuration.d.ts +2 -3
- package/lib/widget/configuration.js +260 -0
- package/lib/widget/configuration.js.map +1 -0
- package/lib/widget/html-multi-widget.d.ts +336 -0
- package/lib/widget/html-multi-widget.js +422 -0
- package/lib/widget/html-multi-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/html-widget.d.ts +1 -2
- package/lib/widget/html-widget.js +127 -0
- package/lib/widget/html-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/index.d.ts +1 -2
- package/lib/widget/index.js +132 -0
- package/lib/widget/index.js.map +1 -0
- package/{bundles/types → lib}/widget/meta.d.ts +0 -1
- package/lib/widget/meta.js +8 -0
- package/lib/widget/meta.js.map +1 -0
- package/{bundles/types → lib}/widget/multi-widget.d.ts +1 -2
- package/lib/widget/multi-widget.js +437 -0
- package/lib/widget/multi-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/style.d.ts +0 -1
- package/lib/widget/style.js +204 -0
- package/lib/widget/style.js.map +1 -0
- package/package.json +42 -164
- package/payment-source-widget.d.ts +1 -0
- package/payment-source-widget.js +1 -0
- package/slate.md +136 -107
- package/tslint.json +129 -0
- package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +43 -0
- package/typings/globals/jasmine/index.d.ts +576 -0
- package/typings/globals/jasmine-ajax/index.d.ts +83 -0
- package/typings/globals/jquery/index.d.ts +3759 -0
- package/typings/index.d.ts +4 -0
- package/vault-display-widget.d.ts +1 -0
- package/vault-display-widget.js +1 -0
- package/vendors/zipmoney.d.ts +18 -0
- package/vendors/zipmoney.js +2 -0
- package/widget.d.ts +1 -0
- package/widget.js +1 -0
- package/bundles/index.cjs +0 -10674
- package/bundles/index.cjs.d.ts +0 -3163
- package/bundles/index.cjs.map +0 -1
- package/bundles/index.mjs +0 -10642
- package/bundles/index.mjs.d.ts +0 -3163
- package/bundles/index.mjs.map +0 -1
- package/bundles/types/api/api-base.d.ts.map +0 -1
- package/bundles/types/api/api-charge-internal.d.ts.map +0 -1
- package/bundles/types/api/api-charge.d.ts.map +0 -1
- package/bundles/types/api/api-internal.d.ts.map +0 -1
- package/bundles/types/api/api-service-internal.d.ts.map +0 -1
- package/bundles/types/api/api.d.ts.map +0 -1
- package/bundles/types/api/index.d.ts +0 -2
- package/bundles/types/api/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +0 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +0 -1
- package/bundles/types/checkout-button/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/base.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/index.d.ts +0 -4
- package/bundles/types/checkout-button/zipmoney/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +0 -1
- package/bundles/types/components/ability-guard.d.ts.map +0 -1
- package/bundles/types/components/background.d.ts.map +0 -1
- package/bundles/types/components/container.d.ts.map +0 -1
- package/bundles/types/components/dispatcher.d.ts.map +0 -1
- package/bundles/types/components/element-style.d.ts.map +0 -1
- package/bundles/types/components/flypay-iframe-event.d.ts.map +0 -1
- package/bundles/types/components/form-interceptor.d.ts.map +0 -1
- package/bundles/types/components/http-core.d.ts.map +0 -1
- package/bundles/types/components/iframe-event.d.ts.map +0 -1
- package/bundles/types/components/iframe.d.ts.map +0 -1
- package/bundles/types/components/link.d.ts.map +0 -1
- package/bundles/types/components/loader.d.ts.map +0 -1
- package/bundles/types/components/param.d.ts.map +0 -1
- package/bundles/types/components/popup.d.ts.map +0 -1
- package/bundles/types/components/storage-dispatcher.d.ts.map +0 -1
- package/bundles/types/components/trigger.d.ts.map +0 -1
- package/bundles/types/components/vault-display-iframe-event.d.ts.map +0 -1
- package/bundles/types/components/wallet-background.d.ts.map +0 -1
- package/bundles/types/components/wallet-trigger.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.cba.d.ts +0 -29
- package/bundles/types/configs/env/environment.cba.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.interface.d.ts +0 -12
- package/bundles/types/configs/env/environment.interface.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.paydock.d.ts.map +0 -1
- package/bundles/types/configs/env/index.d.ts +0 -3
- package/bundles/types/configs/env/index.d.ts.map +0 -1
- package/bundles/types/configs/sdk.d.ts.map +0 -1
- package/bundles/types/external-checkout/builder.d.ts.map +0 -1
- package/bundles/types/external-checkout/checker.d.ts.map +0 -1
- package/bundles/types/external-checkout/index.d.ts +0 -3
- package/bundles/types/external-checkout/index.d.ts.map +0 -1
- package/bundles/types/helper/access-token.d.ts.map +0 -1
- package/bundles/types/helper/browser.d.ts.map +0 -1
- package/bundles/types/helper/event-emitter.d.ts.map +0 -1
- package/bundles/types/helper/event.d.ts.map +0 -1
- package/bundles/types/helper/ms.d.ts.map +0 -1
- package/bundles/types/helper/object.d.ts.map +0 -1
- package/bundles/types/helper/url.d.ts.map +0 -1
- package/bundles/types/helper/uuid.d.ts.map +0 -1
- package/bundles/types/index-cba.d.ts +0 -13
- package/bundles/types/index-cba.d.ts.map +0 -1
- package/bundles/types/index.d.ts +0 -14
- package/bundles/types/index.d.ts.map +0 -1
- package/bundles/types/payment-source/builder.d.ts.map +0 -1
- package/bundles/types/payment-source/index.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/index.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/interfaces.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +0 -1
- package/bundles/types/vault-display-widget/index.d.ts.map +0 -1
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/index-cba.d.ts +0 -2
- package/bundles/types/wallet-buttons/index-cba.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/index.d.ts +0 -2
- package/bundles/types/wallet-buttons/index.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +0 -366
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-service.d.ts.map +0 -1
- package/bundles/types/widget/configuration.d.ts.map +0 -1
- package/bundles/types/widget/html-multi-widget.d.ts +0 -266
- package/bundles/types/widget/html-multi-widget.d.ts.map +0 -1
- package/bundles/types/widget/html-widget.d.ts.map +0 -1
- package/bundles/types/widget/index.d.ts.map +0 -1
- package/bundles/types/widget/meta.d.ts.map +0 -1
- package/bundles/types/widget/multi-widget.d.ts.map +0 -1
- package/bundles/types/widget/style.d.ts.map +0 -1
- package/bundles/widget.umd.js.d.ts +0 -3163
- package/bundles/widget.umd.js.map +0 -1
- package/bundles/widget.umd.js.min.d.ts +0 -3163
- package/bundles/widget.umd.min.js.map +0 -1
- package/docs/api-canvas3ds.md +0 -158
- package/docs/api-checkout-button.md +0 -912
- package/docs/api-examples.md +0 -65
- package/docs/api-ps-widget.md +0 -585
- package/docs/api-vault-display.md +0 -94
- package/docs/api-widget.md +0 -2444
- package/docs/api-wrapper.md +0 -78
- package/docs/canvas3ds-examples.md +0 -242
- package/docs/cba-header.md +0 -13
- package/docs/cba-license.md +0 -2
- package/docs/checkout-examples.md +0 -248
- package/docs/header.md +0 -15
- package/docs/html/layout.html +0 -78
- package/docs/html/marked.js +0 -23
- package/docs/html/style.css +0 -365
- package/docs/install/npm.content.md +0 -16
- package/docs/install/npm.example.md +0 -24
- package/docs/install/umd.content.md +0 -20
- package/docs/install/umd.example.md +0 -6
- package/docs/install.md +0 -43
- package/docs/install.readme.t.md +0 -17
- package/docs/install.slate.t.md +0 -17
- package/docs/license.md +0 -2
- package/docs/partials/header.hbs +0 -3
- package/docs/ps-examples.md +0 -129
- package/docs/secure-remote-commerce-examples.md +0 -258
- package/docs/secure-remote-commerce.md +0 -265
- package/docs/vault-display-example.md +0 -132
- package/docs/wallet-buttons-examples.md +0 -580
- package/docs/wallet-buttons.md +0 -424
- package/docs/wallet-cba-buttons-examples.md +0 -388
- package/docs/widget-examples.md +0 -134
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { Container } from '../components/container';
|
|
2
|
+
import { ExternalCheckoutBuilder } from '../external-checkout/index';
|
|
3
|
+
import { CHECKOUT_BUTTON_EVENT, CHECKOUT_MODE, GATEWAY_TYPE, CHECKOUT_BTN_LOG_PREFIX } from './checkout-button.interface';
|
|
4
|
+
import { DEFAULT_ENV } from '../configs/env/env';
|
|
5
|
+
import { Background } from '../components/background';
|
|
6
|
+
import { Event } from '../helper/event';
|
|
7
|
+
import { EventEmitter } from '../helper/event-emitter';
|
|
8
|
+
import { isContextualRunner, isRedirectRunner } from './runner';
|
|
9
|
+
import { ZipmoneyContextualRunner } from './zipmoney/zipmoney-contextual.runner';
|
|
10
|
+
import { ZipmoneyRedirectRunner } from './zipmoney/zipmoney-redirect.runner';
|
|
11
|
+
import { PaypalRunner } from './paypal/paypal.runner';
|
|
12
|
+
import { AfterpayRunner } from './afterpay/afterpay.runner';
|
|
13
|
+
import { CheckoutContextualHandler } from './checkout-contextual-handler';
|
|
14
|
+
/**
|
|
15
|
+
* Class CheckoutButton transform usual button into checkout
|
|
16
|
+
*
|
|
17
|
+
* @constructor
|
|
18
|
+
*
|
|
19
|
+
* @param {string} selector - Selector of html element.
|
|
20
|
+
* @param {string} aceessToken - PayDock access token or users public key
|
|
21
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
22
|
+
* @param {string} [type=PaypalClassic] - Type of gateway (PaypalClassic, Zipmoney)
|
|
23
|
+
* @example
|
|
24
|
+
* var widget = new CheckoutButton('#button', 'accessToken','gatewayId');
|
|
25
|
+
*/
|
|
26
|
+
class CheckoutButton {
|
|
27
|
+
/** @constructs */ // constructs added for correct parse classes jsdoc2md
|
|
28
|
+
constructor(selector, accessToken, gatewayId = 'default', gatewayType = GATEWAY_TYPE.PAYPAL, mode = CHECKOUT_MODE.CONTEXTUAL) {
|
|
29
|
+
this.accessToken = accessToken;
|
|
30
|
+
this.gatewayId = gatewayId;
|
|
31
|
+
this.gatewayType = gatewayType;
|
|
32
|
+
this.mode = mode;
|
|
33
|
+
this.window = window;
|
|
34
|
+
this.meta = {};
|
|
35
|
+
this.env = DEFAULT_ENV;
|
|
36
|
+
this.eventEmitter = new EventEmitter();
|
|
37
|
+
this.container = new Container(selector);
|
|
38
|
+
this.initCheckout(this.container);
|
|
39
|
+
this.chooseRunner(gatewayType, mode);
|
|
40
|
+
}
|
|
41
|
+
chooseRunner(gatewayType, mode) {
|
|
42
|
+
const Runner = this.getRunnerByMode(gatewayType, mode);
|
|
43
|
+
this.runner = new Runner(this.accessToken);
|
|
44
|
+
if (isContextualRunner(this.runner)) {
|
|
45
|
+
this.background = new Background();
|
|
46
|
+
this.checkoutHandler = new CheckoutContextualHandler(this.background, this.runner, this.eventEmitter, { accessToken: this.accessToken, gatewayId: this.gatewayId });
|
|
47
|
+
this.checkoutHandler.init(this.env);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.background = undefined;
|
|
51
|
+
this.checkoutHandler = undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
buildAdditionalParams() {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
initCheckout(container) {
|
|
58
|
+
container.on('click', (event) => {
|
|
59
|
+
if (isContextualRunner(this.runner)) {
|
|
60
|
+
if (this.runner.isRunning())
|
|
61
|
+
return;
|
|
62
|
+
else
|
|
63
|
+
this.runner.run();
|
|
64
|
+
}
|
|
65
|
+
else if (isRedirectRunner(this.runner)) {
|
|
66
|
+
if (!this.runner.getRedirectUrl())
|
|
67
|
+
throw Error(`${CHECKOUT_BTN_LOG_PREFIX} The merchant redirect URL should is required in the '${this.mode}' mode.`);
|
|
68
|
+
}
|
|
69
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.CLICK);
|
|
70
|
+
let externalCheckout = new ExternalCheckoutBuilder(this.gatewayId, this.runner.getSuccessRedirectUri(), this.runner.getErrorRedirectUri());
|
|
71
|
+
externalCheckout.setMeta(this.meta);
|
|
72
|
+
externalCheckout.setEnv(this.env);
|
|
73
|
+
externalCheckout.send(this.accessToken, (checkout) => {
|
|
74
|
+
const buttonEvent = isContextualRunner(this.runner) ? CHECKOUT_BUTTON_EVENT.POPUP_REDIRECT : CHECKOUT_BUTTON_EVENT.REDIRECT;
|
|
75
|
+
this.eventEmitter.emit(buttonEvent);
|
|
76
|
+
this.runner.next(checkout, this.buildAdditionalParams());
|
|
77
|
+
}, (error, code) => {
|
|
78
|
+
console.error(`${CHECKOUT_BTN_LOG_PREFIX} ${error}`);
|
|
79
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.ERROR, { error, code });
|
|
80
|
+
this.runner.error(error, code, (close) => {
|
|
81
|
+
if (close)
|
|
82
|
+
this.close();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* This callback will be called for each event in payment source widget
|
|
89
|
+
*
|
|
90
|
+
* @callback listener
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* Listen to events of widget
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
*
|
|
97
|
+
* widget.on('click', function () {
|
|
98
|
+
*
|
|
99
|
+
* });
|
|
100
|
+
* @param {string} eventName - Available event names [CHECKOUT_BUTTON_EVENT]{@link CHECKOUT_BUTTON_EVENT}
|
|
101
|
+
* @param {listener} cb
|
|
102
|
+
*/
|
|
103
|
+
on(name, handler) {
|
|
104
|
+
this.eventEmitter.subscribe(name, handler);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Close popup window forcibly.
|
|
108
|
+
* Only for 'contextual' mode.
|
|
109
|
+
*
|
|
110
|
+
*/
|
|
111
|
+
close() {
|
|
112
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.CONTEXTUAL))
|
|
113
|
+
this.runner.stop();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* After finish event of checkout button, data (dataType) will be insert to input (selector)
|
|
117
|
+
*
|
|
118
|
+
* @param {string} selector - css selector . [] #
|
|
119
|
+
* @param {string} dataType - data type of IEventCheckoutFinishData [IEventCheckoutFinishData]{@link #IEventCheckoutFinishData}.
|
|
120
|
+
*/
|
|
121
|
+
onFinishInsert(selector, dataType) {
|
|
122
|
+
this.on(CHECKOUT_BUTTON_EVENT.FINISH, (event) => {
|
|
123
|
+
Event.insertToInput(selector, dataType, event);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Method for setting meta information for checkout page
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* button.setMeta({
|
|
131
|
+
brand_name: 'paydock',
|
|
132
|
+
reference: '15',
|
|
133
|
+
email: 'wault@paydock.com'
|
|
134
|
+
});
|
|
135
|
+
*
|
|
136
|
+
* @param {(IPayPalMeta|IAfterpayMeta|IZipmoneyMeta)} meta - Data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta}
|
|
137
|
+
*/
|
|
138
|
+
setMeta(meta) {
|
|
139
|
+
this.meta = Object.assign(this.meta, meta);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Method for setting backdrop description.
|
|
143
|
+
* Only for 'contextual' mode.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* button.setBackdropDescription('Custom description');
|
|
147
|
+
*
|
|
148
|
+
* @param {string} text - description which can be shown in overlay of back side checkout page
|
|
149
|
+
*/
|
|
150
|
+
setBackdropDescription(text) {
|
|
151
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.CONTEXTUAL))
|
|
152
|
+
this.runner.setBackgroundDescription(text);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Method for setting backdrop title.
|
|
156
|
+
* Only for 'contextual' mode.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* button.setBackdropTitle('Custom title');
|
|
160
|
+
*
|
|
161
|
+
* @param {text} string - title which can be shown in overlay of back side checkout page
|
|
162
|
+
*/
|
|
163
|
+
setBackdropTitle(text) {
|
|
164
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.CONTEXTUAL))
|
|
165
|
+
this.runner.setBackgroundTitle(text);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Method for setting suspended redirect uri. Redirect after referred checkout.
|
|
169
|
+
* Only for 'contextual' mode.
|
|
170
|
+
*
|
|
171
|
+
* @param {uri} string - uri for redirect (by default)
|
|
172
|
+
*/
|
|
173
|
+
setSuspendedRedirectUri(uri) {
|
|
174
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.CONTEXTUAL))
|
|
175
|
+
this.runner.setSuspendedRedirectUri(uri);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Method for setting the merchant redirect URL.
|
|
179
|
+
* Merchant's customers redirect after successfull checkout.
|
|
180
|
+
* Only for 'redirect' mode.
|
|
181
|
+
*
|
|
182
|
+
* @param {url} string - redirect url
|
|
183
|
+
*/
|
|
184
|
+
setRedirectUrl(url) {
|
|
185
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.REDIRECT))
|
|
186
|
+
this.runner.setRedirectUrl(url);
|
|
187
|
+
}
|
|
188
|
+
getSuccessRedirectUri() {
|
|
189
|
+
return this.runner.getSuccessRedirectUri();
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Method for disable backdrop on the page.
|
|
193
|
+
* Only for 'contextual' mode.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* button.turnOffBackdrop();
|
|
197
|
+
*
|
|
198
|
+
*/
|
|
199
|
+
turnOffBackdrop() {
|
|
200
|
+
this.turnOffControlBackdrop();
|
|
201
|
+
this.turnOffLoaderBackdrop();
|
|
202
|
+
}
|
|
203
|
+
turnOffControlBackdrop() {
|
|
204
|
+
if (this.assertMethodSupport(this.runner, CHECKOUT_MODE.CONTEXTUAL))
|
|
205
|
+
this.runner.turnOffBackdrop();
|
|
206
|
+
}
|
|
207
|
+
turnOffLoaderBackdrop() {
|
|
208
|
+
var _a;
|
|
209
|
+
(_a = this.background) === null || _a === void 0 ? void 0 : _a.turnOffLoader();
|
|
210
|
+
}
|
|
211
|
+
setEnv(env, alias) {
|
|
212
|
+
var _a;
|
|
213
|
+
this.env = env;
|
|
214
|
+
this.alias = alias;
|
|
215
|
+
(_a = this.checkoutHandler) === null || _a === void 0 ? void 0 : _a.setEnv(env);
|
|
216
|
+
this.runner.setEnv(env, alias);
|
|
217
|
+
}
|
|
218
|
+
getEnv() {
|
|
219
|
+
return this.env;
|
|
220
|
+
}
|
|
221
|
+
getRunnerByMode(gatewayType, mode) {
|
|
222
|
+
if (gatewayType === GATEWAY_TYPE.PAYPAL) {
|
|
223
|
+
if (mode === CHECKOUT_MODE.REDIRECT)
|
|
224
|
+
throw Error(`${CHECKOUT_BTN_LOG_PREFIX} Gateway '${gatewayType}' do not support '${mode}' mode`);
|
|
225
|
+
return PaypalRunner;
|
|
226
|
+
}
|
|
227
|
+
else if (gatewayType === GATEWAY_TYPE.AFTERPAY) {
|
|
228
|
+
if (mode === CHECKOUT_MODE.REDIRECT)
|
|
229
|
+
throw Error(`${CHECKOUT_BTN_LOG_PREFIX} Gateway '${gatewayType}' do not support '${mode}' mode`);
|
|
230
|
+
return AfterpayRunner;
|
|
231
|
+
}
|
|
232
|
+
else if (gatewayType === GATEWAY_TYPE.ZIPMONEY) {
|
|
233
|
+
return mode === CHECKOUT_MODE.CONTEXTUAL ? ZipmoneyContextualRunner : ZipmoneyRedirectRunner;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
throw Error(`${CHECKOUT_BTN_LOG_PREFIX} Unsupported gateway.`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
assertMethodSupport(runner, mode) {
|
|
240
|
+
const warnMessage = `${CHECKOUT_BTN_LOG_PREFIX} The method is not supported in the '${mode}' mode.`;
|
|
241
|
+
switch (mode) {
|
|
242
|
+
case CHECKOUT_MODE.CONTEXTUAL:
|
|
243
|
+
if (isContextualRunner(runner))
|
|
244
|
+
return true;
|
|
245
|
+
else
|
|
246
|
+
console.warn(warnMessage);
|
|
247
|
+
break;
|
|
248
|
+
case CHECKOUT_MODE.REDIRECT:
|
|
249
|
+
if (isRedirectRunner(runner))
|
|
250
|
+
return true;
|
|
251
|
+
else
|
|
252
|
+
console.warn(warnMessage);
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* @interface IEventCheckoutFinishData
|
|
262
|
+
*
|
|
263
|
+
* @param {string} [payment_source_token]
|
|
264
|
+
*/
|
|
265
|
+
export { CheckoutButton };
|
|
266
|
+
//# sourceMappingURL=../../src/lib/checkout-button/checkout-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-button.js","sourceRoot":"","sources":["../../checkout-button/checkout-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAa,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAA4B,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACpJ,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EAAwD,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACtH,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,C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C;SAChG;aAAM;YACH,MAAM,KAAK,CAAC,GAAG,uBAAuB,uBAAuB,CAAC,CAAC;SAClE;IACL,CAAC;IAIO,mBAAmB,CAAC,MAA2C,EAAE,IAAmB;QACxF,MAAM,WAAW,GAAG,GAAG,uBAAuB,wCAAwC,IAAI,SAAS,CAAA;QAEnG,QAAQ,IAAI,EAAE;YACV,KAAK,aAAa,CAAC,UAAU;gBACzB,IAAI,kBAAkB,CAAC,MAAM,CAAC;oBAC1B,OAAO,IAAI,CAAC;;oBAEZ,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC9B,MAAM;YAEV,KAAK,aAAa,CAAC,QAAQ;gBACvB,IAAI,gBAAgB,CAAC,MAAM,CAAC;oBACxB,OAAO,IAAI,CAAC;;oBAEZ,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC9B,MAAM;YAEV;gBACI,MAAM;SACb;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAED;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { PaymentSourceBuilder, TYPE as TOKEN_TYPE } from '../payment-source/index';
|
|
2
|
+
import { ExternalCheckoutChecker } from '../external-checkout/index';
|
|
3
|
+
import { RUNNER_EVENT } from './runner';
|
|
4
|
+
import { CHECKOUT_BTN_LOG_PREFIX, CHECKOUT_BUTTON_EVENT } from './checkout-button.interface';
|
|
5
|
+
export class CheckoutContextualHandler {
|
|
6
|
+
constructor(background, runner, eventEmitter, params) {
|
|
7
|
+
this.background = background;
|
|
8
|
+
this.runner = runner;
|
|
9
|
+
this.eventEmitter = eventEmitter;
|
|
10
|
+
this.params = params;
|
|
11
|
+
this.runner.onStop(() => {
|
|
12
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.CLOSE);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
init(env) {
|
|
16
|
+
this.setEnv(env);
|
|
17
|
+
this.runner.onCheckout(RUNNER_EVENT.SUCCESS, (checkout) => {
|
|
18
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.ACCEPTED, {});
|
|
19
|
+
this.background.initLoader();
|
|
20
|
+
this.runner.stop();
|
|
21
|
+
this.checkToken(checkout.token, () => {
|
|
22
|
+
this.createOneTimeToken(checkout.token);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
this.runner.onCheckout(RUNNER_EVENT.ERROR, () => {
|
|
26
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.ERROR);
|
|
27
|
+
console.error(`${CHECKOUT_BTN_LOG_PREFIX} Error from checkout server.`);
|
|
28
|
+
this.runner.stop();
|
|
29
|
+
});
|
|
30
|
+
this.runner.onCheckout(RUNNER_EVENT.REFERRED, () => {
|
|
31
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.REFERRED);
|
|
32
|
+
this.runner.stop();
|
|
33
|
+
});
|
|
34
|
+
this.runner.onCheckout(RUNNER_EVENT.DECLINED, () => {
|
|
35
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.DECLINED);
|
|
36
|
+
this.runner.stop();
|
|
37
|
+
});
|
|
38
|
+
this.eventEmitter.subscribe(CHECKOUT_BUTTON_EVENT.ERROR, () => {
|
|
39
|
+
this.runner.stop();
|
|
40
|
+
});
|
|
41
|
+
this.eventEmitter.subscribe(CHECKOUT_BUTTON_EVENT.FINISH, (data) => {
|
|
42
|
+
this.background.clear();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
setEnv(env) {
|
|
46
|
+
this.env = env;
|
|
47
|
+
}
|
|
48
|
+
checkToken(token, cb) {
|
|
49
|
+
let checker = new ExternalCheckoutChecker(token);
|
|
50
|
+
checker.setEnv(this.env);
|
|
51
|
+
checker.send(this.params.accessToken, (details) => {
|
|
52
|
+
this.details = details;
|
|
53
|
+
cb();
|
|
54
|
+
}, () => {
|
|
55
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.ERROR, {});
|
|
56
|
+
console.error(`${CHECKOUT_BTN_LOG_PREFIX} Error during creating payment source token.`);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
createOneTimeToken(token) {
|
|
60
|
+
let paymentSourceToken = new PaymentSourceBuilder(this.params.gatewayId, token, TOKEN_TYPE.CHECKOUT_TOKEN);
|
|
61
|
+
paymentSourceToken.setEnv(this.env);
|
|
62
|
+
paymentSourceToken.send(this.params.accessToken, (token) => {
|
|
63
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.FINISH, {
|
|
64
|
+
payment_source_token: token,
|
|
65
|
+
checkout_email: this.details.checkout_email,
|
|
66
|
+
checkout_holder: this.details.checkout_holder,
|
|
67
|
+
gateway_type: this.details.gateway_type,
|
|
68
|
+
});
|
|
69
|
+
}, () => {
|
|
70
|
+
this.eventEmitter.emit(CHECKOUT_BUTTON_EVENT.ERROR, {});
|
|
71
|
+
console.error(`${CHECKOUT_BTN_LOG_PREFIX} Error during creating payment source token.`);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=../../src/lib/checkout-button/checkout-contextual-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-contextual-handler.js","sourceRoot":"","sources":["../../checkout-button/checkout-contextual-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAuB,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAA4B,MAAM,6BAA6B,CAAC;AAOvH,MAAM,OAAO,yBAAyB;IAIlC,YACc,UAAsB,EACtB,MAAyB,EACzB,YAA0B,EAC1B,MAAuC;QAHvC,eAAU,GAAV,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,CAAC,CACJ,CAAC;IACN,CAAC;IAES,kBAAkB,CAAC,KAAa;QACtC,IAAI,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;QAC3G,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpC,kBAAkB,CAAC,IAAI,CACnB,IAAI,CAAC,MAAM,CAAC,WAAW,EACvB,CAAC,KAAa,EAAE,EAAE;YACd,IAAI,CAAC,YAAY,CAAC,IAAI,CAA2B,qBAAqB,CAAC,MAAM,EAAE;gBAC3E,oBAAoB,EAAE,KAAK;gBAC3B,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc;gBAC3C,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe;gBAC7C,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY;aAC1C,CAAC,CAAC;QACP,CAAC,EACD,GAAG,EAAE;YACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAS,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAChE,OAAO,CAAC,KAAK,CAAC,GAAG,uBAAuB,8CAA8C,CAAC,CAAC;QAC5F,CAAC,CACJ,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CHECKOUT_BUTTON_EVENT,
|
|
1
|
+
export { CHECKOUT_BUTTON_EVENT, IEventCheckoutFinishData } from './checkout-button.interface';
|
|
2
2
|
export { ZipmoneyCheckoutButton } from './zipmoney/zipmoney-checkout-button';
|
|
3
3
|
export { AfterpayCheckoutButton } from './afterpay/afterpay-checkout-button';
|
|
4
4
|
export { PaypalCheckoutButton } from './paypal/paypal-checkout-button';
|
|
@@ -82,4 +82,3 @@ export { PaypalCheckoutButton } from './paypal/paypal-checkout-button';
|
|
|
82
82
|
* @param {string} [address_country]
|
|
83
83
|
* @param {string} [phone]
|
|
84
84
|
*/
|
|
85
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export { CHECKOUT_BUTTON_EVENT } from './checkout-button.interface';
|
|
2
|
+
export { ZipmoneyCheckoutButton } from './zipmoney/zipmoney-checkout-button';
|
|
3
|
+
export { AfterpayCheckoutButton } from './afterpay/afterpay-checkout-button';
|
|
4
|
+
export { PaypalCheckoutButton } from './paypal/paypal-checkout-button';
|
|
5
|
+
/**
|
|
6
|
+
* Interface for PayPal checkout meta information
|
|
7
|
+
* @interface IPayPalMeta
|
|
8
|
+
*
|
|
9
|
+
* @param {string} [brand_name] A label that overrides the business name in the PayPal account on the PayPal hosted checkout pages
|
|
10
|
+
* @param {string} [cart_border_color] The HTML hex code for your principal identifying color
|
|
11
|
+
* @param {string} [reference] Merchant Customer Service number displayed on the PayPal pages
|
|
12
|
+
* @param {string} [email] The consumer’s email
|
|
13
|
+
* @param {string} [hdr_img] URL for the image you want to appear at the top left of the payment page
|
|
14
|
+
* @param {string} [logo_img] A URL to your logo image
|
|
15
|
+
* @param {string} [pay_flow_color] Sets the background color for the payment page. By default, the color is white.
|
|
16
|
+
* @param {string} [first_name] The consumer’s given names
|
|
17
|
+
* @param {string} [last_name] The consumer’s surname
|
|
18
|
+
* @param {string} [address_line] Street address
|
|
19
|
+
* @param {string} [address_line2] Second line of the address
|
|
20
|
+
* @param {string} [address_city] City
|
|
21
|
+
* @param {string} [address_state] State
|
|
22
|
+
* @param {string} [address_postcode] Postcode
|
|
23
|
+
* @param {string} [address_country] Country
|
|
24
|
+
* @param {string} [phone] The consumer’s phone number in E.164 international notation (Example: +12345678901)
|
|
25
|
+
* @param {boolean} [hide_shipping_address] Determines whether PayPal displays shipping address fields on the PayPal pages
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Interface for ZipMoney checkout meta information
|
|
29
|
+
* @interface IZipmoneyMeta
|
|
30
|
+
|
|
31
|
+
* @param {string} first_name First name for the customer
|
|
32
|
+
* @param {string} last_name Last name for the customer
|
|
33
|
+
* @param {string} [phone] The consumer’s phone number in E.164 international notation (Example: +12345678901)
|
|
34
|
+
* @param {boolean} [tokenize] Controls whether to tokenize the zip pay / zip money account, defaults to ‘false’
|
|
35
|
+
* @param {string} email The consumer’s email
|
|
36
|
+
* @param {string} [gender] Gender name for the customer
|
|
37
|
+
* @param {string} [date_of_birth] Date of birth name for the customer
|
|
38
|
+
* @param {number} charge.amount Amount to be paid
|
|
39
|
+
* @param {string} [charge.currency] Currency code
|
|
40
|
+
* @param {string} [charge.reference] Reference
|
|
41
|
+
* @param {array} charge.items Collections of orders
|
|
42
|
+
* @param {string} charge.items[].name Name of the item
|
|
43
|
+
* @param {number} charge.items[].amount Amount of the item
|
|
44
|
+
* @param {integer} charge.items[].quantity Quantity of the item
|
|
45
|
+
* @param {string} [charge.items[].type] type of the item, values can be: ‘sku’, ‘tax’, ‘shipping’, ‘discount’
|
|
46
|
+
* @param {string} [charge.items[].reference] reference of the item
|
|
47
|
+
* @param {string} [charge.items[].item_uri] url of the item in your store
|
|
48
|
+
* @param {string} [charge.items[].image_url] url of the image in your store
|
|
49
|
+
* @param {string} [charge.shipping_type] Shipping type, values can be: ‘pickup’, ‘delivery’, defaults to ‘delivery’
|
|
50
|
+
* @param {string} [charge.shipping_address] Object with shipping address details
|
|
51
|
+
* @param {string} [charge.shipping_address.first_name] Shipping first name
|
|
52
|
+
* @param {string} [charge.shipping_address.last_name] Shipping last name
|
|
53
|
+
* @param {string} charge.shipping_address.line1 Shipping address line 1
|
|
54
|
+
* @param {string} charge.shipping_address.line2 Shipping address line 2
|
|
55
|
+
* @param {string} charge.shipping_address.city Shipping city
|
|
56
|
+
* @param {string} charge.shipping_address.state Shipping state
|
|
57
|
+
* @param {string} charge.shipping_address.postcode Shipping postcode
|
|
58
|
+
* @param {string} charge.shipping_address.country Shipping country
|
|
59
|
+
* @param {string} charge.billing_address Object with billing address details
|
|
60
|
+
* @param {string} [charge.billing_address.first_name] Billing first name
|
|
61
|
+
* @param {string} [charge.billing_address.last_name] Billing last name
|
|
62
|
+
* @param {string} charge.billing_address.line1 Billing address line 1
|
|
63
|
+
* @param {string} [charge.billing_address.line2] Billing address line 1
|
|
64
|
+
* @param {string} charge.billing_address.city Billing city
|
|
65
|
+
* @param {string} charge.billing_address.state Billing state
|
|
66
|
+
* @param {string} charge.billing_address.postcode Billing postcode
|
|
67
|
+
* @param {string} charge.billing_address.country Billing country
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Interface for Afterpay checkout meta information
|
|
71
|
+
* @interface IAfterpayMeta
|
|
72
|
+
* @param {number} [amount]
|
|
73
|
+
* @param {number} [currency]
|
|
74
|
+
* @param {string} [first_name]
|
|
75
|
+
* @param {string} [last_name]
|
|
76
|
+
* @param {string} [email]
|
|
77
|
+
* @param {string} [address_line]
|
|
78
|
+
* @param {string} [address_line2]
|
|
79
|
+
* @param {string} [address_city]
|
|
80
|
+
* @param {string} [address_state]
|
|
81
|
+
* @param {string} [address_postcode]
|
|
82
|
+
* @param {string} [address_country]
|
|
83
|
+
* @param {string} [phone]
|
|
84
|
+
*/
|
|
85
|
+
//# sourceMappingURL=../../src/lib/checkout-button/index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../checkout-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA4B,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -15,7 +15,6 @@ import { CheckoutButton } from '../checkout-button';
|
|
|
15
15
|
declare class PaypalCheckoutButton extends CheckoutButton {
|
|
16
16
|
protected publicKey: string;
|
|
17
17
|
protected gatewayId: string;
|
|
18
|
-
constructor(selector: string, publicKey: string, gatewayId?: string);
|
|
18
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
|
|
19
19
|
}
|
|
20
20
|
export { PaypalCheckoutButton };
|
|
21
|
-
//# sourceMappingURL=paypal-checkout-button.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CheckoutButton } from '../checkout-button';
|
|
2
|
+
import { GATEWAY_TYPE } from '../checkout-button.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Class PaypalCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
|
|
5
|
+
*
|
|
6
|
+
* @extends CheckoutButton
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
*
|
|
10
|
+
* @param {string} selector - Selector of html element.
|
|
11
|
+
* @param {string} publicKey - PayDock users public key
|
|
12
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
13
|
+
* @example
|
|
14
|
+
* var widget = new PaypalCheckoutButton('#button', 'publicKey','gatewayId');
|
|
15
|
+
*/
|
|
16
|
+
class PaypalCheckoutButton extends CheckoutButton {
|
|
17
|
+
/** @constructs */ // constructs added for correct parse classes jsdoc2md
|
|
18
|
+
constructor(selector, publicKey, gatewayId = 'default') {
|
|
19
|
+
super(selector, publicKey, gatewayId, GATEWAY_TYPE.PAYPAL);
|
|
20
|
+
this.publicKey = publicKey;
|
|
21
|
+
this.gatewayId = gatewayId;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { PaypalCheckoutButton };
|
|
25
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/paypal/paypal-checkout-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal-checkout-button.js","sourceRoot":"","sources":["../../../checkout-button/paypal/paypal-checkout-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,oBAAqB,SAAQ,cAAc;IAC7C,kBAAkB,CAAC,sDAAsD;IACzE,YAAY,QAAgB,EAAY,SAAiB,EAAY,YAAoB,SAAS;QAC9F,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QADvB,cAAS,GAAT,SAAS,CAAQ;QAAY,cAAS,GAAT,SAAS,CAAoB;IAElG,CAAC;CACJ;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PopupRunner } from '../runner';
|
|
2
|
+
import { Url } from '../../helper/url';
|
|
3
|
+
const REDIRECT_URI_SUCCESS = '/checkout/success';
|
|
4
|
+
const REDIRECT_URI_ERROR = '/checkout/error';
|
|
5
|
+
export class PaypalRunner extends PopupRunner {
|
|
6
|
+
getSuccessRedirectUri() {
|
|
7
|
+
return (this.widgetEnv.getConf().url +
|
|
8
|
+
Url.extendSearchParams(REDIRECT_URI_SUCCESS, 'merchant', encodeURIComponent(window.location.href)));
|
|
9
|
+
}
|
|
10
|
+
getErrorRedirectUri() {
|
|
11
|
+
return (this.widgetEnv.getConf().url + Url.extendSearchParams(REDIRECT_URI_ERROR, 'merchant', encodeURIComponent(window.location.href)));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/paypal/paypal.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal.runner.js","sourceRoot":"","sources":["../../../checkout-button/paypal/paypal.runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACjD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAClC,qBAAqB;QACxB,OAAO,CACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG;YAC5B,GAAG,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACrG,CAAC;IACN,CAAC;IAEM,mBAAmB;QACtB,OAAO,CACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAClI,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ICheckout } from '../../external-checkout';
|
|
2
|
-
import { Env } from '../../configs/env';
|
|
3
|
-
export type AdditionalParams = Record<string, string | number | boolean>;
|
|
4
|
-
export type Constructable<T = BaseRunner> = new (...args: any[]) => T;
|
|
2
|
+
import { Env } from '../../configs/env/env';
|
|
3
|
+
export declare type AdditionalParams = Record<string, string | number | boolean>;
|
|
4
|
+
export declare type Constructable<T = BaseRunner> = new (...args: any[]) => T;
|
|
5
5
|
export interface IRunner {
|
|
6
6
|
next(checkoutData: ICheckout, params?: AdditionalParams): void;
|
|
7
7
|
error(error: string, code: string, cb: (close: boolean) => void): void;
|
|
@@ -15,4 +15,3 @@ export declare abstract class BaseRunner implements Partial<IRunner> {
|
|
|
15
15
|
error(error: string, code: string, callback: any): void;
|
|
16
16
|
setEnv(env: string, alias?: string): void;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=base.runner.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Env, WIDGET_URL } from '../../configs/env/env';
|
|
2
|
+
export class BaseRunner {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.widgetEnv = new Env(WIDGET_URL);
|
|
5
|
+
}
|
|
6
|
+
error(error, code, callback) {
|
|
7
|
+
callback(true);
|
|
8
|
+
}
|
|
9
|
+
setEnv(env, alias) {
|
|
10
|
+
this.widgetEnv.setEnv(env, alias);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/runner/base.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.runner.js","sourceRoot":"","sources":["../../../checkout-button/runner/base.runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAkBxD,MAAM,OAAgB,UAAU;IAG5B;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,KAAa,EAAE,IAAY,EAAE,QAAQ;QAC9C,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ"}
|
|
@@ -31,8 +31,7 @@ export declare function ContextualRunner<BR extends Constructable>(Runner?: BR):
|
|
|
31
31
|
setBackgroundTitle(text: string): void;
|
|
32
32
|
setBackgroundDescription(text: string): void;
|
|
33
33
|
turnOffBackdrop(): void;
|
|
34
|
-
widgetEnv: import("../../configs/env").Env;
|
|
34
|
+
widgetEnv: import("../../configs/env/env").Env;
|
|
35
35
|
setEnv(env: string, alias?: string): void;
|
|
36
36
|
};
|
|
37
37
|
} & BR;
|
|
38
|
-
//# sourceMappingURL=contextual.runner.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Background, TRIGGER as BACKGROUND_TRIGGER } from '../../components/background';
|
|
2
|
+
import { BaseRunner } from './base.runner';
|
|
3
|
+
export var RUNNER_EVENT;
|
|
4
|
+
(function (RUNNER_EVENT) {
|
|
5
|
+
RUNNER_EVENT["SUCCESS"] = "success";
|
|
6
|
+
RUNNER_EVENT["DECLINED"] = "declined";
|
|
7
|
+
RUNNER_EVENT["CLOSE"] = "close";
|
|
8
|
+
RUNNER_EVENT["REFERRED"] = "referred";
|
|
9
|
+
RUNNER_EVENT["ERROR"] = "error";
|
|
10
|
+
})(RUNNER_EVENT || (RUNNER_EVENT = {}));
|
|
11
|
+
;
|
|
12
|
+
export function ContextualRunner(Runner = BaseRunner) {
|
|
13
|
+
return class extends Runner {
|
|
14
|
+
constructor(...args) {
|
|
15
|
+
super(...args);
|
|
16
|
+
this.background = new Background();
|
|
17
|
+
this.background.onTrigger(BACKGROUND_TRIGGER.FOCUS, () => this.continue());
|
|
18
|
+
this.background.onTrigger(BACKGROUND_TRIGGER.CLOSE, () => this.stop());
|
|
19
|
+
}
|
|
20
|
+
continue() { }
|
|
21
|
+
stop() { }
|
|
22
|
+
error(error, code, callback) {
|
|
23
|
+
callback(true);
|
|
24
|
+
}
|
|
25
|
+
setSuspendedRedirectUri(uri) {
|
|
26
|
+
this.suspendedRedirectUri = uri;
|
|
27
|
+
}
|
|
28
|
+
setBackgroundTitle(text) {
|
|
29
|
+
this.background.setBackdropTitle(text);
|
|
30
|
+
}
|
|
31
|
+
setBackgroundDescription(text) {
|
|
32
|
+
this.background.setBackdropDescription(text);
|
|
33
|
+
}
|
|
34
|
+
turnOffBackdrop() {
|
|
35
|
+
this.background.turnOffControl();
|
|
36
|
+
this.background.turnOffLoader();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/runner/contextual.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AY;YACxC,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC;QAEM,eAAe;YAClB,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;YACjC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;QACpC,CAAC;KACJ,CAAA;AACL,CAAC"}
|
|
@@ -6,4 +6,3 @@ export * from './popup.runner';
|
|
|
6
6
|
export * from './redirect.runner';
|
|
7
7
|
export declare function isContextualRunner(runner: IContextualRunner | IRedirectRunner): runner is IContextualRunner;
|
|
8
8
|
export declare function isRedirectRunner(runner: IContextualRunner | IRedirectRunner): runner is IRedirectRunner;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './base.runner';
|
|
2
|
+
export * from './contextual.runner';
|
|
3
|
+
export * from './popup.runner';
|
|
4
|
+
export * from './redirect.runner';
|
|
5
|
+
export function isContextualRunner(runner) {
|
|
6
|
+
return 'run' in runner;
|
|
7
|
+
}
|
|
8
|
+
export function isRedirectRunner(runner) {
|
|
9
|
+
return 'setRedirectUrl' in runner;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/runner/index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../checkout-button/runner/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAElC,MAAM,UAAU,kBAAkB,CAAC,MAA2C;IAC1E,OAAO,KAAK,IAAI,MAAM,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAA2C;IACxE,OAAO,gBAAgB,IAAI,MAAM,CAAC;AACtC,CAAC"}
|