@paydock/client-sdk 1.106.1 → 1.107.0-beta
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/README.md +194 -162
- package/bundles/index.cjs +10483 -0
- package/bundles/index.cjs.d.ts +3206 -0
- package/bundles/index.cjs.map +1 -0
- package/bundles/index.mjs +10451 -0
- package/bundles/index.mjs.d.ts +3206 -0
- package/bundles/index.mjs.map +1 -0
- package/{lib → bundles/types}/api/api-base.d.ts +2 -1
- package/bundles/types/api/api-base.d.ts.map +1 -0
- package/{lib → bundles/types}/api/api-charge-internal.d.ts +1 -0
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
- package/{lib → bundles/types}/api/api-charge.d.ts +1 -0
- package/bundles/types/api/api-charge.d.ts.map +1 -0
- package/{lib → bundles/types}/api/api-internal.d.ts +1 -0
- package/bundles/types/api/api-internal.d.ts.map +1 -0
- package/{lib → bundles/types}/api/api-service-internal.d.ts +2 -1
- package/bundles/types/api/api-service-internal.d.ts.map +1 -0
- package/{lib → bundles/types}/api/api.d.ts +1 -0
- package/bundles/types/api/api.d.ts.map +1 -0
- package/bundles/types/api/index.d.ts +2 -0
- package/bundles/types/api/index.d.ts.map +1 -0
- package/{lib → bundles/types}/canvas-3ds/canvas-3ds.d.ts +1 -0
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
- package/{lib → bundles/types}/canvas-3ds/index.d.ts +1 -0
- package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
- package/{lib → bundles/types}/canvas-3ds/services/gpayments-service.d.ts +1 -0
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
- package/{lib → bundles/types}/canvas-3ds/services/index.d.ts +1 -0
- package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
- package/{lib → bundles/types}/canvas-3ds/services/standalone3ds-service.d.ts +1 -0
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -0
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/afterpay/afterpay.runner.d.ts +1 -0
- package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/checkout-button.d.ts +1 -0
- package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/checkout-button.interface.d.ts +1 -0
- package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/checkout-contextual-handler.d.ts +1 -0
- package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/index.d.ts +2 -1
- package/bundles/types/checkout-button/index.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -0
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/paypal/paypal.runner.d.ts +1 -0
- package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/runner/base.runner.d.ts +4 -3
- package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/runner/contextual.runner.d.ts +2 -1
- package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/runner/index.d.ts +1 -0
- package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/runner/popup.runner.d.ts +2 -1
- package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/runner/redirect.runner.d.ts +2 -1
- package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/index.d.ts +4 -0
- package/bundles/types/checkout-button/zipmoney/index.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +2 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +2 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.config.d.ts +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.runner.d.ts +2 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
- package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.types.d.ts +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
- package/{lib → bundles/types}/components/ability-guard.d.ts +1 -0
- package/bundles/types/components/ability-guard.d.ts.map +1 -0
- package/{lib → bundles/types}/components/background.d.ts +1 -0
- package/bundles/types/components/background.d.ts.map +1 -0
- package/{lib → bundles/types}/components/container.d.ts +1 -0
- package/bundles/types/components/container.d.ts.map +1 -0
- package/{lib → bundles/types}/components/dispatcher.d.ts +2 -1
- package/bundles/types/components/dispatcher.d.ts.map +1 -0
- package/{lib → bundles/types}/components/element-style.d.ts +2 -1
- package/bundles/types/components/element-style.d.ts.map +1 -0
- package/{lib → bundles/types}/components/flypay-iframe-event.d.ts +1 -0
- package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
- package/{lib/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +1 -0
- package/bundles/types/components/form-interceptor.d.ts.map +1 -0
- package/{lib → bundles/types}/components/http-core.d.ts +1 -0
- package/bundles/types/components/http-core.d.ts.map +1 -0
- package/{lib → bundles/types}/components/iframe-event.d.ts +2 -0
- package/bundles/types/components/iframe-event.d.ts.map +1 -0
- package/{lib → bundles/types}/components/iframe.d.ts +1 -0
- package/bundles/types/components/iframe.d.ts.map +1 -0
- package/{lib → bundles/types}/components/link.d.ts +2 -1
- package/bundles/types/components/link.d.ts.map +1 -0
- package/{lib → bundles/types}/components/loader.d.ts +1 -0
- package/bundles/types/components/loader.d.ts.map +1 -0
- package/{lib → bundles/types}/components/param.d.ts +8 -7
- package/bundles/types/components/param.d.ts.map +1 -0
- package/{lib → bundles/types}/components/popup.d.ts +1 -0
- package/bundles/types/components/popup.d.ts.map +1 -0
- package/{lib → bundles/types}/components/storage-dispatcher.d.ts +1 -0
- package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
- package/{lib → bundles/types}/components/trigger.d.ts +1 -0
- package/bundles/types/components/trigger.d.ts.map +1 -0
- package/{lib → bundles/types}/components/vault-display-iframe-event.d.ts +1 -0
- package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
- package/{lib → bundles/types}/components/wallet-background.d.ts +3 -1
- package/bundles/types/components/wallet-background.d.ts.map +1 -0
- package/{lib → bundles/types}/components/wallet-trigger.d.ts +1 -0
- package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
- package/bundles/types/configs/env/environment.cba.d.ts +29 -0
- package/bundles/types/configs/env/environment.cba.d.ts.map +1 -0
- package/bundles/types/configs/env/environment.interface.d.ts +12 -0
- package/bundles/types/configs/env/environment.interface.d.ts.map +1 -0
- package/{lib/configs/env/env.d.ts → bundles/types/configs/env/environment.paydock.d.ts} +5 -8
- package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -0
- package/bundles/types/configs/env/index.d.ts +3 -0
- package/bundles/types/configs/env/index.d.ts.map +1 -0
- package/{lib → bundles/types}/configs/sdk.d.ts +3 -2
- package/bundles/types/configs/sdk.d.ts.map +1 -0
- package/{lib → bundles/types}/constants/validators.d.ts +3 -2
- package/bundles/types/constants/validators.d.ts.map +1 -0
- package/{lib → bundles/types}/external-checkout/builder.d.ts +1 -0
- package/bundles/types/external-checkout/builder.d.ts.map +1 -0
- package/{lib → bundles/types}/external-checkout/checker.d.ts +1 -0
- package/bundles/types/external-checkout/checker.d.ts.map +1 -0
- package/bundles/types/external-checkout/index.d.ts +3 -0
- package/bundles/types/external-checkout/index.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/access-token.d.ts +1 -0
- package/bundles/types/helper/access-token.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/browser.d.ts +1 -0
- package/bundles/types/helper/browser.d.ts.map +1 -0
- package/bundles/types/helper/element-id.d.ts +5 -0
- package/bundles/types/helper/element-id.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/event-emitter.d.ts +1 -0
- package/bundles/types/helper/event-emitter.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/event.d.ts +1 -0
- package/bundles/types/helper/event.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/ms.d.ts +1 -0
- package/bundles/types/helper/ms.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/object.d.ts +1 -0
- package/bundles/types/helper/object.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/url.d.ts +1 -0
- package/bundles/types/helper/url.d.ts.map +1 -0
- package/{lib → bundles/types}/helper/uuid.d.ts +1 -0
- package/bundles/types/helper/uuid.d.ts.map +1 -0
- package/bundles/types/index-cba.d.ts +13 -0
- package/bundles/types/index-cba.d.ts.map +1 -0
- package/bundles/types/index.d.ts +14 -0
- package/bundles/types/index.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source/builder.d.ts +1 -0
- package/bundles/types/payment-source/builder.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source/index.d.ts +1 -0
- package/bundles/types/payment-source/index.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source-widget/html-payment-source-widget.d.ts +1 -0
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source-widget/index.d.ts +1 -0
- package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source-widget/interfaces.d.ts +1 -0
- package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
- package/{lib → bundles/types}/payment-source-widget/payment-source-widget.d.ts +1 -0
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
- package/{lib → bundles/types}/secure-remote-commerce/index.d.ts +5 -4
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
- package/{lib → bundles/types}/secure-remote-commerce/interfaces.d.ts +10 -9
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
- package/{lib → bundles/types}/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +5 -4
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
- package/{lib → bundles/types}/secure-remote-commerce/providers/src-provider.d.ts +1 -0
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
- package/{lib → bundles/types}/secure-remote-commerce/secure-remote-commerce.d.ts +4 -3
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
- package/{lib → bundles/types}/vault-display-widget/index.d.ts +1 -0
- package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
- package/{lib → bundles/types}/vault-display-widget/vault-display-widget.d.ts +1 -0
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/afterpay.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/apple.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/flypay-v2.wallet-service.d.ts +2 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/flypay.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/google.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
- package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/index.d.ts +1 -0
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/interfaces.d.ts +1 -0
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/mastercard.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/paypal.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/stripe.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/wallet-buttons.d.ts +1 -0
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +330 -0
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -0
- package/{lib → bundles/types}/wallet-buttons/wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/configuration.d.ts +2 -1
- package/bundles/types/widget/configuration.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/html-multi-widget.d.ts +4 -3
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/html-widget.d.ts +1 -0
- package/bundles/types/widget/html-widget.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/index.d.ts +2 -1
- package/bundles/types/widget/index.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/meta.d.ts +1 -0
- package/bundles/types/widget/meta.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/multi-widget.d.ts +2 -1
- package/bundles/types/widget/multi-widget.d.ts.map +1 -0
- package/{lib → bundles/types}/widget/style.d.ts +1 -0
- package/bundles/types/widget/style.d.ts.map +1 -0
- package/bundles/widget.umd.js +6755 -6894
- package/bundles/widget.umd.js.d.ts +3206 -0
- package/bundles/widget.umd.js.map +1 -0
- package/bundles/widget.umd.js.min.d.ts +3206 -0
- package/bundles/widget.umd.min.js +2 -1
- package/bundles/widget.umd.min.js.map +1 -0
- package/docs/api-canvas3ds.md +158 -0
- package/docs/api-checkout-button.md +912 -0
- package/docs/api-examples.md +65 -0
- package/docs/api-ps-widget.md +585 -0
- package/docs/api-vault-display.md +94 -0
- package/docs/api-widget.md +2499 -0
- package/docs/api-wrapper.md +78 -0
- package/docs/canvas3ds-examples.md +242 -0
- package/docs/cba-header.md +13 -0
- package/docs/cba-license.md +2 -0
- package/docs/checkout-examples.md +248 -0
- package/docs/click-to-pay-examples.md +231 -0
- package/docs/click-to-pay.md +336 -0
- package/docs/header.md +15 -0
- package/docs/html/layout.html +78 -0
- package/docs/html/marked.js +23 -0
- package/docs/html/style.css +365 -0
- package/docs/install/npm.content.md +16 -0
- package/docs/install/npm.example.md +24 -0
- package/docs/install/umd.content.md +20 -0
- package/docs/install/umd.example.md +6 -0
- package/docs/install.md +43 -0
- package/docs/install.readme.t.md +17 -0
- package/docs/install.slate.t.md +17 -0
- package/docs/license.md +2 -0
- package/docs/partials/header.hbs +3 -0
- package/docs/ps-examples.md +129 -0
- package/docs/vault-display-example.md +132 -0
- package/docs/wallet-buttons-examples.md +609 -0
- package/docs/wallet-buttons.md +619 -0
- package/docs/wallet-cba-buttons-examples.md +388 -0
- package/docs/widget-examples.md +134 -0
- package/package.json +164 -42
- package/slate.md +141 -106
- package/.nvmrc +0 -1
- package/api.d.ts +0 -1
- package/api.js +0 -1
- package/canvas3ds.d.ts +0 -1
- package/canvas3ds.js +0 -1
- package/checkout-button.d.ts +0 -1
- package/checkout-button.js +0 -1
- package/inicialization-guide.md +0 -7
- package/lib/api/api-base.js +0 -101
- package/lib/api/api-base.js.map +0 -1
- package/lib/api/api-charge-internal.js +0 -30
- package/lib/api/api-charge-internal.js.map +0 -1
- package/lib/api/api-charge.js +0 -49
- package/lib/api/api-charge.js.map +0 -1
- package/lib/api/api-internal.js +0 -13
- package/lib/api/api-internal.js.map +0 -1
- package/lib/api/api-service-internal.js +0 -19
- package/lib/api/api-service-internal.js.map +0 -1
- package/lib/api/api.js +0 -62
- package/lib/api/api.js.map +0 -1
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +0 -2
- package/lib/api/index.js.map +0 -1
- package/lib/canvas-3ds/canvas-3ds.js +0 -157
- package/lib/canvas-3ds/canvas-3ds.js.map +0 -1
- package/lib/canvas-3ds/index.js +0 -2
- package/lib/canvas-3ds/index.js.map +0 -1
- package/lib/canvas-3ds/services/gpayments-service.js +0 -181
- package/lib/canvas-3ds/services/gpayments-service.js.map +0 -1
- package/lib/canvas-3ds/services/index.js +0 -2
- package/lib/canvas-3ds/services/index.js.map +0 -1
- package/lib/canvas-3ds/services/standalone3ds-service.js +0 -32
- package/lib/canvas-3ds/services/standalone3ds-service.js.map +0 -1
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js +0 -50
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +0 -1
- package/lib/checkout-button/afterpay/afterpay.runner.js +0 -41
- package/lib/checkout-button/afterpay/afterpay.runner.js.map +0 -1
- package/lib/checkout-button/checkout-button.interface.js +0 -45
- package/lib/checkout-button/checkout-button.interface.js.map +0 -1
- package/lib/checkout-button/checkout-button.js +0 -266
- package/lib/checkout-button/checkout-button.js.map +0 -1
- package/lib/checkout-button/checkout-contextual-handler.js +0 -75
- package/lib/checkout-button/checkout-contextual-handler.js.map +0 -1
- package/lib/checkout-button/index.js +0 -85
- package/lib/checkout-button/index.js.map +0 -1
- package/lib/checkout-button/paypal/paypal-checkout-button.js +0 -25
- package/lib/checkout-button/paypal/paypal-checkout-button.js.map +0 -1
- package/lib/checkout-button/paypal/paypal.runner.js +0 -14
- package/lib/checkout-button/paypal/paypal.runner.js.map +0 -1
- package/lib/checkout-button/runner/base.runner.js +0 -13
- package/lib/checkout-button/runner/base.runner.js.map +0 -1
- package/lib/checkout-button/runner/contextual.runner.js +0 -40
- package/lib/checkout-button/runner/contextual.runner.js.map +0 -1
- package/lib/checkout-button/runner/index.js +0 -11
- package/lib/checkout-button/runner/index.js.map +0 -1
- package/lib/checkout-button/runner/popup.runner.js +0 -68
- package/lib/checkout-button/runner/popup.runner.js.map +0 -1
- package/lib/checkout-button/runner/redirect.runner.js +0 -15
- package/lib/checkout-button/runner/redirect.runner.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +0 -64
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +0 -78
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +0 -49
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.config.js +0 -4
- package/lib/checkout-button/zipmoney/zipmoney.config.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.runner.js +0 -23
- package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.types.js +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.types.js.map +0 -1
- package/lib/components/ability-guard.js +0 -44
- package/lib/components/ability-guard.js.map +0 -1
- package/lib/components/background.js +0 -193
- package/lib/components/background.js.map +0 -1
- package/lib/components/container.js +0 -63
- package/lib/components/container.js.map +0 -1
- package/lib/components/dispatcher.js +0 -39
- package/lib/components/dispatcher.js.map +0 -1
- package/lib/components/element-style.js +0 -52
- package/lib/components/element-style.js.map +0 -1
- package/lib/components/flypay-iframe-event.js +0 -28
- package/lib/components/flypay-iframe-event.js.map +0 -1
- package/lib/components/form-Interceptor.js +0 -38
- package/lib/components/form-Interceptor.js.map +0 -1
- package/lib/components/http-core.js +0 -57
- package/lib/components/http-core.js.map +0 -1
- package/lib/components/iframe-event.js +0 -77
- package/lib/components/iframe-event.js.map +0 -1
- package/lib/components/iframe.js +0 -62
- package/lib/components/iframe.js.map +0 -1
- package/lib/components/link.js +0 -60
- package/lib/components/link.js.map +0 -1
- package/lib/components/loader.js +0 -234
- package/lib/components/loader.js.map +0 -1
- package/lib/components/param.js +0 -147
- package/lib/components/param.js.map +0 -1
- package/lib/components/popup.js +0 -104
- package/lib/components/popup.js.map +0 -1
- package/lib/components/storage-dispatcher.js +0 -75
- package/lib/components/storage-dispatcher.js.map +0 -1
- package/lib/components/trigger.js +0 -49
- package/lib/components/trigger.js.map +0 -1
- package/lib/components/vault-display-iframe-event.js +0 -27
- package/lib/components/vault-display-iframe-event.js.map +0 -1
- package/lib/components/wallet-background.js +0 -75
- package/lib/components/wallet-background.js.map +0 -1
- package/lib/components/wallet-trigger.js +0 -27
- package/lib/components/wallet-trigger.js.map +0 -1
- package/lib/configs/env/env.js +0 -117
- package/lib/configs/env/env.js.map +0 -1
- package/lib/configs/sdk.js +0 -16
- package/lib/configs/sdk.js.map +0 -1
- package/lib/constants/validators.js +0 -42
- package/lib/constants/validators.js.map +0 -1
- package/lib/external-checkout/builder.js +0 -45
- package/lib/external-checkout/builder.js.map +0 -1
- package/lib/external-checkout/checker.js +0 -22
- package/lib/external-checkout/checker.js.map +0 -1
- package/lib/external-checkout/index.d.ts +0 -2
- package/lib/external-checkout/index.js +0 -3
- package/lib/external-checkout/index.js.map +0 -1
- package/lib/helper/access-token.js +0 -44
- package/lib/helper/access-token.js.map +0 -1
- package/lib/helper/browser.js +0 -79
- package/lib/helper/browser.js.map +0 -1
- package/lib/helper/event-emitter.js +0 -23
- package/lib/helper/event-emitter.js.map +0 -1
- package/lib/helper/event.js +0 -23
- package/lib/helper/event.js.map +0 -1
- package/lib/helper/ms.js +0 -32
- package/lib/helper/ms.js.map +0 -1
- package/lib/helper/object.js +0 -6
- package/lib/helper/object.js.map +0 -1
- package/lib/helper/url.js +0 -11
- package/lib/helper/url.js.map +0 -1
- package/lib/helper/uuid.js +0 -26
- package/lib/helper/uuid.js.map +0 -1
- package/lib/index.d.ts +0 -15
- package/lib/index.js +0 -15
- package/lib/index.js.map +0 -1
- package/lib/payment-source/builder.js +0 -49
- package/lib/payment-source/builder.js.map +0 -1
- package/lib/payment-source/index.js +0 -2
- package/lib/payment-source/index.js.map +0 -1
- package/lib/payment-source-widget/html-payment-source-widget.js +0 -172
- package/lib/payment-source-widget/html-payment-source-widget.js.map +0 -1
- package/lib/payment-source-widget/index.js +0 -35
- package/lib/payment-source-widget/index.js.map +0 -1
- package/lib/payment-source-widget/interfaces.js +0 -2
- package/lib/payment-source-widget/interfaces.js.map +0 -1
- package/lib/payment-source-widget/payment-source-widget.js +0 -142
- package/lib/payment-source-widget/payment-source-widget.js.map +0 -1
- package/lib/secure-remote-commerce/index.js +0 -103
- package/lib/secure-remote-commerce/index.js.map +0 -1
- package/lib/secure-remote-commerce/interfaces.js +0 -48
- package/lib/secure-remote-commerce/interfaces.js.map +0 -1
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -30
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +0 -40
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +0 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +0 -2
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +0 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +0 -89
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +0 -1
- package/lib/secure-remote-commerce/providers/src-provider.js +0 -1
- package/lib/secure-remote-commerce/providers/src-provider.js.map +0 -1
- package/lib/secure-remote-commerce/secure-remote-commerce.js +0 -155
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +0 -1
- package/lib/vault-display-widget/index.js +0 -14
- package/lib/vault-display-widget/index.js.map +0 -1
- package/lib/vault-display-widget/vault-display-widget.js +0 -99
- package/lib/vault-display-widget/vault-display-widget.js.map +0 -1
- package/lib/wallet-buttons/afterpay.wallet-service.js +0 -152
- package/lib/wallet-buttons/afterpay.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/apple.wallet-service.js +0 -324
- package/lib/wallet-buttons/apple.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +0 -163
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/flypay.wallet-service.js +0 -117
- package/lib/wallet-buttons/flypay.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/google.wallet-service.js +0 -301
- package/lib/wallet-buttons/google.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
- package/lib/wallet-buttons/index.js +0 -128
- package/lib/wallet-buttons/index.js.map +0 -1
- package/lib/wallet-buttons/interfaces.js +0 -1
- package/lib/wallet-buttons/interfaces.js.map +0 -1
- package/lib/wallet-buttons/mastercard.wallet-service.js +0 -27
- package/lib/wallet-buttons/mastercard.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/paypal.wallet-service.js +0 -144
- package/lib/wallet-buttons/paypal.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/stripe.wallet-service.js +0 -100
- package/lib/wallet-buttons/stripe.wallet-service.js.map +0 -1
- package/lib/wallet-buttons/wallet-buttons.js +0 -479
- package/lib/wallet-buttons/wallet-buttons.js.map +0 -1
- package/lib/wallet-buttons/wallet-service.js +0 -60
- package/lib/wallet-buttons/wallet-service.js.map +0 -1
- package/lib/widget/configuration.js +0 -260
- package/lib/widget/configuration.js.map +0 -1
- package/lib/widget/html-multi-widget.js +0 -422
- package/lib/widget/html-multi-widget.js.map +0 -1
- package/lib/widget/html-widget.js +0 -127
- package/lib/widget/html-widget.js.map +0 -1
- package/lib/widget/index.js +0 -132
- package/lib/widget/index.js.map +0 -1
- package/lib/widget/meta.js +0 -8
- package/lib/widget/meta.js.map +0 -1
- package/lib/widget/multi-widget.js +0 -437
- package/lib/widget/multi-widget.js.map +0 -1
- package/lib/widget/style.js +0 -204
- package/lib/widget/style.js.map +0 -1
- package/payment-source-widget.d.ts +0 -1
- package/payment-source-widget.js +0 -1
- package/tslint.json +0 -129
- package/typings/globals/jasmine/index.d.ts +0 -576
- package/typings/globals/jasmine-ajax/index.d.ts +0 -83
- package/typings/globals/jquery/index.d.ts +0 -3759
- package/typings/index.d.ts +0 -3
- package/vault-display-widget.d.ts +0 -1
- package/vault-display-widget.js +0 -1
- package/vendors/zipmoney.d.ts +0 -18
- package/vendors/zipmoney.js +0 -1
- package/widget.d.ts +0 -1
- package/widget.js +0 -1
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CACnI,CAAC;IACN,CAAC;IAEM,IAAI,CAAC,YAAuB,EAAE,MAAyB;QAC1D,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;QAC7B,IAAI,CAAC,OAAO,C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|
-
* @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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,266 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E;;;;;;;;;;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B;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"}
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAmB;QACzB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,WAAM,GAAN,MAAM,CAAiC;QAEjD,IAAI,CAAC,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AAS,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,85 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|