@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,181 @@
|
|
|
1
|
+
import { Container } from "../../components/container";
|
|
2
|
+
import { IFrame } from "../../components/iframe";
|
|
3
|
+
import { EVENT, IFrameEvent } from "../../components/iframe-event";
|
|
4
|
+
const hiddenStyle = {
|
|
5
|
+
visibility: "hidden",
|
|
6
|
+
border: "0",
|
|
7
|
+
width: "0",
|
|
8
|
+
height: "0",
|
|
9
|
+
};
|
|
10
|
+
export var PROCESS_STANDALONE_3DS_STATUS;
|
|
11
|
+
(function (PROCESS_STANDALONE_3DS_STATUS) {
|
|
12
|
+
PROCESS_STANDALONE_3DS_STATUS["SUCCESS"] = "success";
|
|
13
|
+
PROCESS_STANDALONE_3DS_STATUS["ERROR"] = "error";
|
|
14
|
+
PROCESS_STANDALONE_3DS_STATUS["PENDING"] = "pending";
|
|
15
|
+
})(PROCESS_STANDALONE_3DS_STATUS || (PROCESS_STANDALONE_3DS_STATUS = {}));
|
|
16
|
+
export const GPAYMENTS_EVENT = {
|
|
17
|
+
AUTH_SUCCESS: 'chargeAuthSuccess',
|
|
18
|
+
AUTH_ERROR: 'chargeAuthReject',
|
|
19
|
+
DECOUPLED: 'chargeAuthDecoupled',
|
|
20
|
+
CHALLENGE: 'chargeAuthChallenge',
|
|
21
|
+
INFO: 'chargeAuthInfo',
|
|
22
|
+
ERROR: 'error',
|
|
23
|
+
};
|
|
24
|
+
const AUTH_STATUS = {
|
|
25
|
+
REJECTED: 'rejected',
|
|
26
|
+
};
|
|
27
|
+
export class GPaymentsService {
|
|
28
|
+
constructor(container, api, eventEmitter) {
|
|
29
|
+
this.container = container;
|
|
30
|
+
this.api = api;
|
|
31
|
+
this.eventEmitter = eventEmitter;
|
|
32
|
+
this.resultRead = false;
|
|
33
|
+
this.iFrameEvent = new IFrameEvent(window);
|
|
34
|
+
}
|
|
35
|
+
load({ initialization_url, secondary_url, charge_3ds_id }, title) {
|
|
36
|
+
try {
|
|
37
|
+
this.setupIFrameEvents(charge_3ds_id);
|
|
38
|
+
this.initializeIFrames(initialization_url, secondary_url, title);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, this.parseError(err, charge_3ds_id));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
initializeIFrames(initializationUrl, secondaryUrl, title, hideAuthorization = true) {
|
|
45
|
+
const container = this.container.getElement();
|
|
46
|
+
if (!container)
|
|
47
|
+
return;
|
|
48
|
+
let divAuthorization = document.createElement("div");
|
|
49
|
+
divAuthorization.setAttribute("id", "paydock_authorization_iframe");
|
|
50
|
+
container.appendChild(divAuthorization);
|
|
51
|
+
this.browserAndChallengeContainer = new Container("#paydock_authorization_iframe");
|
|
52
|
+
this.iFrameAuthorization = new IFrame(this.browserAndChallengeContainer);
|
|
53
|
+
this.iFrameAuthorization.load(initializationUrl, { title });
|
|
54
|
+
if (secondaryUrl) {
|
|
55
|
+
let divSecondaryURL = document.createElement("div");
|
|
56
|
+
divSecondaryURL.setAttribute("id", "paydock_secondary_iframe");
|
|
57
|
+
container.appendChild(divSecondaryURL);
|
|
58
|
+
this.monitoringContainer = new Container("#paydock_secondary_iframe");
|
|
59
|
+
this.iFrameSecondaryUrl = new IFrame(this.monitoringContainer);
|
|
60
|
+
this.iFrameSecondaryUrl.load(secondaryUrl, { title });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.iFrameSecondaryUrl = undefined;
|
|
64
|
+
}
|
|
65
|
+
this.hideIframes(hideAuthorization);
|
|
66
|
+
}
|
|
67
|
+
hideIframes(hideAuthorization = true) {
|
|
68
|
+
var _a;
|
|
69
|
+
for (const prop in hiddenStyle) {
|
|
70
|
+
if (!hiddenStyle.hasOwnProperty(prop))
|
|
71
|
+
continue;
|
|
72
|
+
if (hideAuthorization)
|
|
73
|
+
this.iFrameAuthorization.setStyle(prop, hiddenStyle[prop]);
|
|
74
|
+
(_a = this.iFrameSecondaryUrl) === null || _a === void 0 ? void 0 : _a.setStyle(prop, hiddenStyle[prop]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
setupIFrameEvents(widgetId) {
|
|
78
|
+
this.iFrameEvent.on(EVENT.CHARGE_AUTH, widgetId, (data) => {
|
|
79
|
+
if (data.status === "MethodSkipped" /* SKIPPED */ || data.status === "MethodFinished" /* FINISHED */) {
|
|
80
|
+
if (data.info)
|
|
81
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.INFO, { info: data.info });
|
|
82
|
+
this.performAuthentication(data);
|
|
83
|
+
}
|
|
84
|
+
else if (data.status === "AuthTimedOut" /* TIMEOUT */ || data.status === "invalid_event" /* INVALID */)
|
|
85
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, this.parseHandleResponse({ status: data.status }, data.charge_3ds_id));
|
|
86
|
+
});
|
|
87
|
+
this.iFrameEvent.on(EVENT.CHARGE_AUTH_SUCCESS, widgetId, (data) => {
|
|
88
|
+
this.processResult(data.charge_3ds_id);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
parseResultData({ status }, charge3dsId) {
|
|
92
|
+
return {
|
|
93
|
+
status,
|
|
94
|
+
charge_3ds_id: charge3dsId,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
parseHandleResponse({ status, result }, charge3dsId) {
|
|
98
|
+
return {
|
|
99
|
+
status,
|
|
100
|
+
charge_3ds_id: charge3dsId,
|
|
101
|
+
result: {
|
|
102
|
+
description: result === null || result === void 0 ? void 0 : result.description,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
parseError(data, charge3dsId) {
|
|
107
|
+
return { charge_3ds_id: charge3dsId, error: data };
|
|
108
|
+
}
|
|
109
|
+
processResult(charge3dsId) {
|
|
110
|
+
if (this.resultRead)
|
|
111
|
+
return;
|
|
112
|
+
this.resultRead = true;
|
|
113
|
+
this.api.charge().standalone3dsHandle().then((result) => {
|
|
114
|
+
var _a;
|
|
115
|
+
this.iFrameAuthorization.remove();
|
|
116
|
+
(_a = this.iFrameSecondaryUrl) === null || _a === void 0 ? void 0 : _a.remove();
|
|
117
|
+
if (result.status === PROCESS_STANDALONE_3DS_STATUS.SUCCESS)
|
|
118
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, this.parseResultData(result, charge3dsId));
|
|
119
|
+
else
|
|
120
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, this.parseResultData(result, charge3dsId));
|
|
121
|
+
}, (err) => {
|
|
122
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, this.parseError(err, charge3dsId));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
externalAPI(method, url) {
|
|
126
|
+
let request = new XMLHttpRequest();
|
|
127
|
+
request.open(method, url, true);
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
|
+
request.onload = () => {
|
|
130
|
+
try {
|
|
131
|
+
const body = JSON.parse(request.responseText);
|
|
132
|
+
resolve(body);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
reject(error);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
request.send();
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
doPolling(url, charge3dsId) {
|
|
142
|
+
this.externalAPI("GET", url).then((data) => {
|
|
143
|
+
if (!data.event || data.event === "AuthResultNotReady")
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
this.doPolling(url, charge3dsId);
|
|
146
|
+
}, 2000);
|
|
147
|
+
else if (data.event === 'AuthResultReady')
|
|
148
|
+
this.processResult(charge3dsId);
|
|
149
|
+
else
|
|
150
|
+
throw new Error("Event not supported");
|
|
151
|
+
}).catch((err) => this.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, this.parseError(err, charge3dsId)));
|
|
152
|
+
}
|
|
153
|
+
performAuthentication({ charge_3ds_id }) {
|
|
154
|
+
var _a;
|
|
155
|
+
this.iFrameAuthorization.remove();
|
|
156
|
+
(_a = this.iFrameSecondaryUrl) === null || _a === void 0 ? void 0 : _a.remove();
|
|
157
|
+
this.api.charge().standalone3dsProcess({ charge_3ds_id }).then((authenticationResult) => {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
if (authenticationResult.status === "success" /* SUCCESS */)
|
|
160
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, this.parseHandleResponse(authenticationResult, charge_3ds_id));
|
|
161
|
+
else if (authenticationResult.status === "pending" /* PENDING */) {
|
|
162
|
+
if ((_a = authenticationResult === null || authenticationResult === void 0 ? void 0 : authenticationResult.result) === null || _a === void 0 ? void 0 : _a.challenge) {
|
|
163
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.CHALLENGE, this.parseHandleResponse(authenticationResult, charge_3ds_id));
|
|
164
|
+
this.initializeIFrames(authenticationResult.result.challenge_url, undefined, 'Authentication Challenge', false);
|
|
165
|
+
if (authenticationResult.result.secondary_url)
|
|
166
|
+
this.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
|
|
167
|
+
}
|
|
168
|
+
else if ((_b = authenticationResult === null || authenticationResult === void 0 ? void 0 : authenticationResult.result) === null || _b === void 0 ? void 0 : _b.decoupled_challenge) {
|
|
169
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.DECOUPLED, this.parseHandleResponse(authenticationResult, charge_3ds_id));
|
|
170
|
+
if (authenticationResult.result.secondary_url)
|
|
171
|
+
this.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
return this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, this.parseHandleResponse(authenticationResult, charge_3ds_id));
|
|
176
|
+
}, (err) => {
|
|
177
|
+
this.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, this.parseError(err, charge_3ds_id));
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=../../../src/lib/canvas-3ds/services/gpayments-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpayments-service.js","sourceRoot":"","sources":["../../../canvas-3ds/services/gpayments-service.ts"],"names":[],"mappings":"AACA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oBAAoB,CAAE,MAAM,0CAAE,mBAAmB,EAAE;oBAC1D,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC;oBACjH,IAAI,oBAAoB,CAAC,MAAM,CAAC,aAAa;wBACzC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;iBAChF;aACJ;;gBACG,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC;QACjI,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;YACP,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../canvas-3ds/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GPaymentsService } from "./gpayments-service";
|
|
2
|
+
import { AccessToken } from "../../helper/access-token";
|
|
3
|
+
import { ApiInternal, API_AUTH_TYPE } from "../../api/api-internal";
|
|
4
|
+
import { DEFAULT_ENV } from '../../configs/env/env';
|
|
5
|
+
const STANDALONE_3DS_GATEWAYS = {
|
|
6
|
+
GPAYMENTS: "GPayments",
|
|
7
|
+
};
|
|
8
|
+
export class Standalone3dsService {
|
|
9
|
+
constructor(container, eventEmitter) {
|
|
10
|
+
this.env = DEFAULT_ENV;
|
|
11
|
+
this.container = container;
|
|
12
|
+
this.eventEmitter = eventEmitter;
|
|
13
|
+
}
|
|
14
|
+
load(token, options) {
|
|
15
|
+
const parsedToken = AccessToken.validateJWT(token);
|
|
16
|
+
if (!parsedToken)
|
|
17
|
+
throw new Error("Invalid charge token");
|
|
18
|
+
const tokenData = AccessToken.extractData(parsedToken.body);
|
|
19
|
+
const api = new ApiInternal(token, API_AUTH_TYPE.TOKEN);
|
|
20
|
+
api.setEnv(this.env, this.alias);
|
|
21
|
+
switch (tokenData.service_type) {
|
|
22
|
+
case STANDALONE_3DS_GATEWAYS.GPAYMENTS:
|
|
23
|
+
new GPaymentsService(this.container, api, this.eventEmitter).load(tokenData, options.title);
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
setEnv(env, alias) {
|
|
28
|
+
this.env = env;
|
|
29
|
+
this.alias = alias;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=../../../src/lib/canvas-3ds/services/standalone3ds-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone3ds-service.js","sourceRoot":"","sources":["../../../canvas-3ds/services/standalone3ds-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAO,MAAM,uBAAuB,CAAC;AAGzD,MAAM,uBAAuB,GAAG;IAC5B,SAAS,EAAE,WAAW;CACzB,CAAC;AAWF,MAAM,OAAO,oBAAoB;IAM7B,YAAY,SAAoB,EAAE,YAAY;QAHpC,QAAG,GAAG,WAAW,CAAC;QAIxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAEM,IAAI,CAAC,KAAa,EAAE,OAA0B;QACjD,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1D,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW,CAAsB,WAAW,CAAC,IAAI,CAAC,CAAC;QACjF,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,QAAQ,SAAS,CAAC,YAAY,EAAE;YAC5B,KAAK,uBAAuB,CAAC,SAAS;gBAClC,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC3F,MAAM;SACb;IACL,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ"}
|
|
@@ -17,7 +17,7 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
|
|
|
17
17
|
protected accessToken: string;
|
|
18
18
|
protected gatewayId: string;
|
|
19
19
|
protected showETP: boolean;
|
|
20
|
-
constructor(selector: string, accessToken: string, gatewayId?: string);
|
|
20
|
+
/** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
|
|
21
21
|
/**
|
|
22
22
|
* Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
|
|
23
23
|
*
|
|
@@ -33,4 +33,3 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
|
|
|
33
33
|
protected buildAdditionalParams(): AdditionalParams;
|
|
34
34
|
}
|
|
35
35
|
export { AfterpayCheckoutButton };
|
|
36
|
-
//# sourceMappingURL=afterpay-checkout-button.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CheckoutButton } from '../checkout-button';
|
|
2
|
+
import { GATEWAY_TYPE } from '../checkout-button.interface';
|
|
3
|
+
import { Browser } from '../../helper/browser';
|
|
4
|
+
/**
|
|
5
|
+
* Class AfterpayCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
|
|
6
|
+
*
|
|
7
|
+
* @extends CheckoutButton
|
|
8
|
+
*
|
|
9
|
+
* @constructor
|
|
10
|
+
*
|
|
11
|
+
* @param {string} selector - Selector of html element.
|
|
12
|
+
* @param {string} accessToken - PayDock access-token or users public key
|
|
13
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
14
|
+
* @example
|
|
15
|
+
* var widget = new AfterpayCheckoutButton('#button', 'access-token','gatewayId');
|
|
16
|
+
*/
|
|
17
|
+
class AfterpayCheckoutButton extends CheckoutButton {
|
|
18
|
+
/** @constructs */ // constructs added for correct parse classes jsdoc2md
|
|
19
|
+
constructor(selector, accessToken, gatewayId = 'default') {
|
|
20
|
+
super(selector, accessToken, gatewayId, GATEWAY_TYPE.AFTERPAY);
|
|
21
|
+
this.accessToken = accessToken;
|
|
22
|
+
this.gatewayId = gatewayId;
|
|
23
|
+
this.showETP = false;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
|
|
27
|
+
*
|
|
28
|
+
* This popup with a warning about "Enhanced Tracking Protection" limitations
|
|
29
|
+
* would be shown in the Mozilla Firefox browser version 100+
|
|
30
|
+
*
|
|
31
|
+
* By default, the popup would not be shown, until
|
|
32
|
+
* the flag would be set to `true`
|
|
33
|
+
|
|
34
|
+
* @param {doShow} boolean - flag which toggle the popup visibility
|
|
35
|
+
*/
|
|
36
|
+
showEnhancedTrackingProtectionPopup(doShow) {
|
|
37
|
+
const { name, version } = Browser.getBrowserInfo();
|
|
38
|
+
if (doShow && name === 'Firefox' && +version >= 100)
|
|
39
|
+
this.showETP = true;
|
|
40
|
+
}
|
|
41
|
+
buildAdditionalParams() {
|
|
42
|
+
const params = super.buildAdditionalParams();
|
|
43
|
+
if (this.showETP) {
|
|
44
|
+
params.show_etp = true;
|
|
45
|
+
}
|
|
46
|
+
return params;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export { AfterpayCheckoutButton };
|
|
50
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/afterpay/afterpay-checkout-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"afterpay-checkout-button.js","sourceRoot":"","sources":["../../../checkout-button/afterpay/afterpay-checkout-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,MAAM,sBAAuB,SAAQ,cAAc;IAG/C,kBAAkB,CAAC,sDAAsD;IACzE,YAAY,QAAgB,EAAY,WAAmB,EAAY,YAAoB,SAAS;QAChG,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAD3B,gBAAW,GAAX,WAAW,CAAQ;QAAY,cAAS,GAAT,SAAS,CAAoB;QAH1F,YAAO,GAAG,KAAK,CAAC;IAK1B,CAAC;IAED;;;;;;;;;;OAUG;IACI,mCAAmC,CAAC,MAAe;QACtD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QACnD,IAAI,MAAM,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,OAAO,IAAI,GAAG;YAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IAC5B,CAAC;IAES,qBAAqB;QAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;SAC1B;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PopupRunner } from '../runner';
|
|
2
|
+
import { Browser } from '../../helper/browser';
|
|
3
|
+
import { Url } from '../../helper/url';
|
|
4
|
+
const REDIRECT_URI_SUCCESS = '/checkout/afterpay/merchant/{{merchant}}/success';
|
|
5
|
+
const REDIRECT_URI_ERROR = '/checkout/afterpay/merchant/{{merchant}}/error';
|
|
6
|
+
const CHECKOUT_URL = '/checkout/afterpay/init';
|
|
7
|
+
export class AfterpayRunner extends PopupRunner {
|
|
8
|
+
getSuccessRedirectUri() {
|
|
9
|
+
return (this.widgetEnv.getConf().url +
|
|
10
|
+
REDIRECT_URI_SUCCESS.replace('{{merchant}}', encodeURIComponent(window.btoa(window.location.href))));
|
|
11
|
+
}
|
|
12
|
+
getErrorRedirectUri() {
|
|
13
|
+
return (this.widgetEnv.getConf().url + REDIRECT_URI_ERROR.replace('{{merchant}}', encodeURIComponent(window.btoa(window.location.href))));
|
|
14
|
+
}
|
|
15
|
+
next(checkoutData, params) {
|
|
16
|
+
this.checkout = checkoutData;
|
|
17
|
+
if (!Browser.isSupportPopUp())
|
|
18
|
+
window.localStorage.setItem('paydock_checkout_token', JSON.stringify(this.checkout));
|
|
19
|
+
this.popup.redirect(this.getRedirectUrl(this.checkout, params));
|
|
20
|
+
}
|
|
21
|
+
error(error, code, callback) {
|
|
22
|
+
if (!code || (code && code !== 'invalid_amount'))
|
|
23
|
+
return callback(true);
|
|
24
|
+
this.popup.initError(error);
|
|
25
|
+
return callback(false);
|
|
26
|
+
}
|
|
27
|
+
run() {
|
|
28
|
+
if (this.isRunning())
|
|
29
|
+
return;
|
|
30
|
+
this.popup.setConfigs({
|
|
31
|
+
width: 420,
|
|
32
|
+
height: 715,
|
|
33
|
+
});
|
|
34
|
+
this.popup.init();
|
|
35
|
+
this.background.initControl();
|
|
36
|
+
}
|
|
37
|
+
getRedirectUrl(checkout, params) {
|
|
38
|
+
return (this.widgetEnv.getConf().url + CHECKOUT_URL + '?' + Url.serialize(Object.assign(Object.assign({}, params), { token: checkout.reference_id, env: checkout.mode === 'live' ? 'live' : 'test' })));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=../../../src/lib/checkout-button/afterpay/afterpay.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"afterpay.runner.js","sourceRoot":"","sources":["../../../checkout-button/afterpay/afterpay.runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,MAAM,oBAAoB,GAAG,kDAAkD,CAAC;AAChF,MAAM,kBAAkB,GAAG,gDAAgD,CAAC;AAC5E,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAE/C,MAAM,OAAO,cAAe,SAAQ,WAAW;IACpC,qBAAqB;QACxB,OAAO,CACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG;YAC5B,oBAAoB,CAAC,OAAO,CAAC,cAAc,EAAE,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CACtG,CAAC;IACN,CAAC;IAEM,mBAAmB;QACtB,OAAO,CACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,kBAAkB,CAAC,OAAO,CAAC,cAAc,EAAE,kBAAkB,CAAC,MAAM,CAAC,IA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EAAE,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,IACjD,CACL,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -31,7 +31,7 @@ declare class CheckoutButton {
|
|
|
31
31
|
protected checkoutHandler?: CheckoutContextualHandler;
|
|
32
32
|
protected env: string;
|
|
33
33
|
protected alias?: string;
|
|
34
|
-
constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
|
|
34
|
+
/** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
|
|
35
35
|
protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
|
|
36
36
|
protected buildAdditionalParams(): AdditionalParams;
|
|
37
37
|
protected initCheckout(container: Container): void;
|
|
@@ -136,4 +136,3 @@ declare class CheckoutButton {
|
|
|
136
136
|
* @param {string} [payment_source_token]
|
|
137
137
|
*/
|
|
138
138
|
export { CheckoutButton };
|
|
139
|
-
//# sourceMappingURL=checkout-button.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {object}
|
|
3
|
+
* @param {string} CLICK=click
|
|
4
|
+
* @param {string} POPUP_REDIRECT=popup_redirect
|
|
5
|
+
* @param {string} ERROR=error
|
|
6
|
+
* @param {string} ACCEPTED=accepted
|
|
7
|
+
* @param {string} FINISH=finish
|
|
8
|
+
* @param {string} CLOSE=close
|
|
9
|
+
*/
|
|
10
|
+
export const CHECKOUT_BUTTON_EVENT = {
|
|
11
|
+
CLICK: 'click',
|
|
12
|
+
POPUP_REDIRECT: 'popupRedirect',
|
|
13
|
+
REDIRECT: 'redirect',
|
|
14
|
+
ERROR: 'error',
|
|
15
|
+
REFERRED: 'referred',
|
|
16
|
+
DECLINED: 'declined',
|
|
17
|
+
CANCELLED: 'cancelled',
|
|
18
|
+
ACCEPTED: 'accepted',
|
|
19
|
+
FINISH: 'finish',
|
|
20
|
+
CLOSE: 'close',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @type {object}
|
|
24
|
+
* @param {string} CONTEXTUAL=contextual
|
|
25
|
+
* @param {string} REDIRECT=redirect
|
|
26
|
+
*/
|
|
27
|
+
export var CHECKOUT_MODE;
|
|
28
|
+
(function (CHECKOUT_MODE) {
|
|
29
|
+
CHECKOUT_MODE["CONTEXTUAL"] = "contextual";
|
|
30
|
+
CHECKOUT_MODE["REDIRECT"] = "redirect";
|
|
31
|
+
})(CHECKOUT_MODE || (CHECKOUT_MODE = {}));
|
|
32
|
+
/**
|
|
33
|
+
* @type {object}
|
|
34
|
+
* @param {string} ZIPMONEY=Zipmoney
|
|
35
|
+
* @param {string} PAYPAL=PaypalClassic
|
|
36
|
+
* @param {string} AFTERPAY=Afterpay
|
|
37
|
+
*/
|
|
38
|
+
export var GATEWAY_TYPE;
|
|
39
|
+
(function (GATEWAY_TYPE) {
|
|
40
|
+
GATEWAY_TYPE["ZIPMONEY"] = "Zipmoney";
|
|
41
|
+
GATEWAY_TYPE["PAYPAL"] = "PaypalClassic";
|
|
42
|
+
GATEWAY_TYPE["AFTERPAY"] = "Afterpay";
|
|
43
|
+
})(GATEWAY_TYPE || (GATEWAY_TYPE = {}));
|
|
44
|
+
export const CHECKOUT_BTN_LOG_PREFIX = '[Paydock:CheckoutButton]';
|
|
45
|
+
//# sourceMappingURL=../../src/lib/checkout-button/checkout-button.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-button.interface.js","sourceRoot":"","sources":["../../checkout-button/checkout-button.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,eAAe;IAC/B,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;AACzB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,wCAAwB,CAAA;IACxB,qCAAqB,CAAA;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AASD,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC"}
|