@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
|
@@ -0,0 +1,3206 @@
|
|
|
1
|
+
declare class ApiCharge {
|
|
2
|
+
protected api: Api;
|
|
3
|
+
constructor(api: Api);
|
|
4
|
+
/**
|
|
5
|
+
* Current method allows to work with charge related endpoints
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* api.charge().preAuth('payload', cb);
|
|
9
|
+
*
|
|
10
|
+
* @param {object} payload - Payload for pre authorization.
|
|
11
|
+
* @param {number} payload.amount - Charge amount.
|
|
12
|
+
* @param {string} payload.currency - Charge currency.
|
|
13
|
+
* @param {string} payload.token - Payment source token.
|
|
14
|
+
* @param {string} [payload._3ds.redirect_url] - Redirect url after 3d secure processing.
|
|
15
|
+
* @param {listener} [cb]
|
|
16
|
+
*/
|
|
17
|
+
preAuth(payload: PreAuthBody, cb?: (data: any) => void): void | Promise<PreAuthResponse>;
|
|
18
|
+
}
|
|
19
|
+
interface PreAuthResponse {
|
|
20
|
+
_3ds: {
|
|
21
|
+
token: string;
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
status: string;
|
|
25
|
+
}
|
|
26
|
+
interface PreAuthBody {
|
|
27
|
+
token: string;
|
|
28
|
+
amount: string | number;
|
|
29
|
+
currency: string;
|
|
30
|
+
_3ds?: {
|
|
31
|
+
redirect_url?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare type Configs = IConf[];
|
|
36
|
+
interface IConf {
|
|
37
|
+
env: string;
|
|
38
|
+
url: string;
|
|
39
|
+
}
|
|
40
|
+
interface IEnvironment {
|
|
41
|
+
getConf(): IConf;
|
|
42
|
+
getEnv(): string;
|
|
43
|
+
setEnv(env: string, alias?: string): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class Env implements IEnvironment {
|
|
47
|
+
private alias;
|
|
48
|
+
private configs;
|
|
49
|
+
private env;
|
|
50
|
+
constructor(configs: Configs, defaultEnv?: string);
|
|
51
|
+
setEnv(env: string, alias?: string): void;
|
|
52
|
+
getEnv(): string;
|
|
53
|
+
getConf(): IConf;
|
|
54
|
+
private isValidMode;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare enum API_AUTH_TYPE {
|
|
58
|
+
PUBLIC_KEY = 0,
|
|
59
|
+
TOKEN = 1
|
|
60
|
+
}
|
|
61
|
+
declare class ApiBase {
|
|
62
|
+
protected env: Env;
|
|
63
|
+
auth: string;
|
|
64
|
+
authType: API_AUTH_TYPE;
|
|
65
|
+
constructor(auth: string, authType?: API_AUTH_TYPE);
|
|
66
|
+
/**
|
|
67
|
+
* Current method can change environment. By default environment = sandbox.
|
|
68
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* widget.setEnv('production');
|
|
72
|
+
* @param {string} env - sandbox, production
|
|
73
|
+
* @param {string} [alias] - Own domain alias
|
|
74
|
+
*/
|
|
75
|
+
setEnv(env: string, alias?: string): ApiBase;
|
|
76
|
+
setAuthType(): API_AUTH_TYPE;
|
|
77
|
+
getClient(method: 'GET' | 'POST', link: string): {
|
|
78
|
+
config: XMLHttpRequest;
|
|
79
|
+
send: (body: any, cb?: (data: any) => void, errorCb?: (data: any) => void) => void;
|
|
80
|
+
};
|
|
81
|
+
getClientPromise<Req extends object, Res>(method: 'GET' | 'POST', link: string): {
|
|
82
|
+
config: XMLHttpRequest;
|
|
83
|
+
send: (body: Req) => Promise<Res>;
|
|
84
|
+
};
|
|
85
|
+
parser({ text, status }: {
|
|
86
|
+
text: string;
|
|
87
|
+
status: number;
|
|
88
|
+
}, cb: any, errorCb: any): any;
|
|
89
|
+
parserPromise<Res>({ text, status }: {
|
|
90
|
+
text: string;
|
|
91
|
+
status: number;
|
|
92
|
+
}): Promise<Res>;
|
|
93
|
+
setAuthHeader(request: XMLHttpRequest): void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface BrowserDetails {
|
|
97
|
+
name: string;
|
|
98
|
+
java_enabled: string;
|
|
99
|
+
language: string;
|
|
100
|
+
screen_height: string;
|
|
101
|
+
screen_width: string;
|
|
102
|
+
time_zone: string;
|
|
103
|
+
color_depth: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Interface for browser details response.
|
|
107
|
+
* @interface BrowserDetails
|
|
108
|
+
*
|
|
109
|
+
* @param {string} [name]
|
|
110
|
+
* @param {string} [java_enabled]
|
|
111
|
+
* @param {string} [language]
|
|
112
|
+
* @param {string} [screen_height]
|
|
113
|
+
* @param {string} [screen_width]
|
|
114
|
+
* @param {string} [time_zone]
|
|
115
|
+
* @param {string} [color_depth]
|
|
116
|
+
* */
|
|
117
|
+
/**
|
|
118
|
+
* Class Api include method for working with paydock api
|
|
119
|
+
* @constructor
|
|
120
|
+
*
|
|
121
|
+
* @param {string} publicKey - PayDock users public key
|
|
122
|
+
* @example
|
|
123
|
+
* var api = new Api('publicKey');
|
|
124
|
+
*
|
|
125
|
+
*
|
|
126
|
+
**/
|
|
127
|
+
declare class Api extends ApiBase {
|
|
128
|
+
publicKey: String;
|
|
129
|
+
/** @constructs */ constructor(publicKey: string);
|
|
130
|
+
/**
|
|
131
|
+
* Method for getting browser details
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* api.getBrowserDetails();
|
|
135
|
+
*
|
|
136
|
+
* @return {BrowserDetails} Browser details object
|
|
137
|
+
*/
|
|
138
|
+
getBrowserDetails(): BrowserDetails;
|
|
139
|
+
/**
|
|
140
|
+
* Current method allows to work with charge related endpoints
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* api.charge();
|
|
144
|
+
*/
|
|
145
|
+
charge(): ApiCharge;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* List of available form field validators dedicated to cards and their definition
|
|
150
|
+
*
|
|
151
|
+
* @const CARD_VALIDATORS
|
|
152
|
+
*
|
|
153
|
+
* @type {Record<string, string>}
|
|
154
|
+
*
|
|
155
|
+
* @param {string} CVV=cardCvvValidation
|
|
156
|
+
* Asserts that CVV contains zero or more digits and is a number
|
|
157
|
+
* @param {string} EXPIRY_DATE=expireDateValidation
|
|
158
|
+
* Asserts value is a date in the future with format MM/YY
|
|
159
|
+
* @param {string} HOLDER_NAME=cardHoldernameValidation
|
|
160
|
+
* Asserts value is a name that respects the
|
|
161
|
+
ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en)
|
|
162
|
+
* @param {string} NUMBER=cardNumberValidation
|
|
163
|
+
Asserts the value matches a known card scheme and as a the correct length.
|
|
164
|
+
E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card
|
|
165
|
+
* @param {string} PIN=cardPinValidation
|
|
166
|
+
Asserts the value is a number with exactly 4 digits
|
|
167
|
+
*/
|
|
168
|
+
declare const CARD_VALIDATORS: {
|
|
169
|
+
readonly CVV: "cardCvvValidator";
|
|
170
|
+
readonly EXPIRY_DATE: "expireDateValidation";
|
|
171
|
+
readonly HOLDER_NAME: "cardHoldernameValidator";
|
|
172
|
+
readonly NUMBER: "cardNumberValidator";
|
|
173
|
+
readonly PIN: "cardPinValidator";
|
|
174
|
+
};
|
|
175
|
+
type CardValidatorValue = typeof CARD_VALIDATORS[keyof typeof CARD_VALIDATORS];
|
|
176
|
+
/**
|
|
177
|
+
* List of available generic form field validators and their definition
|
|
178
|
+
*
|
|
179
|
+
* @const GENERIC_VALIDATORS
|
|
180
|
+
*
|
|
181
|
+
* @type {Record<string, string>}
|
|
182
|
+
*
|
|
183
|
+
* @param {string} REQUIRED=required
|
|
184
|
+
* Asserts the input or form field has a value defined truthy value
|
|
185
|
+
*/
|
|
186
|
+
declare const GENERIC_VALIDATORS: {
|
|
187
|
+
readonly REQUIRED: "required";
|
|
188
|
+
};
|
|
189
|
+
type GenericValidatorValue = typeof GENERIC_VALIDATORS[keyof typeof GENERIC_VALIDATORS];
|
|
190
|
+
|
|
191
|
+
declare const FORM_FIELD: {
|
|
192
|
+
CARD_NAME: string;
|
|
193
|
+
CARD_NUMBER: string;
|
|
194
|
+
EXPIRE_MONTH: string;
|
|
195
|
+
EXPIRE_YEAR: string;
|
|
196
|
+
CARD_CCV: string;
|
|
197
|
+
CARD_PIN: string;
|
|
198
|
+
ACCOUNT_NAME: string;
|
|
199
|
+
ACCOUNT_BSB: string;
|
|
200
|
+
ACCOUNT_NUMBER: string;
|
|
201
|
+
ACCOUNT_ROUTING: string;
|
|
202
|
+
ACCOUNT_HOLDER_TYPE: string;
|
|
203
|
+
ACCOUNT_BANK_NAME: string;
|
|
204
|
+
ACCOUNT_TYPE: string;
|
|
205
|
+
FIRST_NAME: string;
|
|
206
|
+
LAST_NAME: string;
|
|
207
|
+
EMAIL: string;
|
|
208
|
+
PHONE: string;
|
|
209
|
+
PHONE2: string;
|
|
210
|
+
ADDRESS_LINE1: string;
|
|
211
|
+
ADDRESS_LINE2: string;
|
|
212
|
+
ADDRESS_STATE: string;
|
|
213
|
+
ADDRESS_COUNTRY: string;
|
|
214
|
+
ADDRESS_CITY: string;
|
|
215
|
+
ADDRESS_POSTCODE: string;
|
|
216
|
+
ADDRESS_COMPANY: string;
|
|
217
|
+
};
|
|
218
|
+
declare const STYLE: {
|
|
219
|
+
BACKGROUND_COLOR: string;
|
|
220
|
+
BACKGROUND_ACTIVE_COLOR: string;
|
|
221
|
+
TEXT_COLOR: string;
|
|
222
|
+
BORDER_COLOR: string;
|
|
223
|
+
ICON_SIZE: string;
|
|
224
|
+
BUTTON_COLOR: string;
|
|
225
|
+
ERROR_COLOR: string;
|
|
226
|
+
SUCCESS_COLOR: string;
|
|
227
|
+
FONT_SIZE: string;
|
|
228
|
+
FONT_FAMILY: string;
|
|
229
|
+
};
|
|
230
|
+
declare const VAULT_DISPLAY_STYLE: {
|
|
231
|
+
BACKGROUND_COLOR: string;
|
|
232
|
+
TEXT_COLOR: string;
|
|
233
|
+
BORDER_COLOR: string;
|
|
234
|
+
BUTTON_COLOR: string;
|
|
235
|
+
FONT_SIZE: string;
|
|
236
|
+
FONT_FAMILY: string;
|
|
237
|
+
};
|
|
238
|
+
declare const TEXT: {
|
|
239
|
+
TITLE: string;
|
|
240
|
+
TITLE_H1: string;
|
|
241
|
+
TITLE_H2: string;
|
|
242
|
+
TITLE_H3: string;
|
|
243
|
+
TITLE_H4: string;
|
|
244
|
+
TITLE_H5: string;
|
|
245
|
+
TITLE_H6: string;
|
|
246
|
+
FINISH: string;
|
|
247
|
+
TITLE_DESCRIPTION: string;
|
|
248
|
+
SUBMIT_BUTTON: string;
|
|
249
|
+
SUBMIT_BUTTON_PROCESSING: string;
|
|
250
|
+
};
|
|
251
|
+
declare const ELEMENT: {
|
|
252
|
+
SUBMIT_BUTTON: string;
|
|
253
|
+
TABS: string;
|
|
254
|
+
};
|
|
255
|
+
declare const SUPPORTED_CARD_TYPES: {
|
|
256
|
+
AMEX: string;
|
|
257
|
+
AUSBC: string;
|
|
258
|
+
DINERS: string;
|
|
259
|
+
DISCOVER: string;
|
|
260
|
+
JAPCB: string;
|
|
261
|
+
LASER: string;
|
|
262
|
+
MASTERCARD: string;
|
|
263
|
+
SOLO: string;
|
|
264
|
+
VISA: string;
|
|
265
|
+
VISA_WHITE: string;
|
|
266
|
+
};
|
|
267
|
+
interface IIcons {
|
|
268
|
+
paypal_checkout_button?: string;
|
|
269
|
+
afterpay_checkout_button?: string;
|
|
270
|
+
zipmoney_checkout_button?: string;
|
|
271
|
+
}
|
|
272
|
+
interface IFormPropertyOption {
|
|
273
|
+
card_name?: string;
|
|
274
|
+
card_number?: string;
|
|
275
|
+
expire_month?: string;
|
|
276
|
+
expire_year?: string;
|
|
277
|
+
card_ccv?: string;
|
|
278
|
+
card_pin?: string;
|
|
279
|
+
account_name?: string;
|
|
280
|
+
account_bsb?: string;
|
|
281
|
+
account_number?: string;
|
|
282
|
+
account_routing?: string;
|
|
283
|
+
account_holder_type?: string;
|
|
284
|
+
account_bank_name?: string;
|
|
285
|
+
first_name?: string;
|
|
286
|
+
last_name?: string;
|
|
287
|
+
email?: string;
|
|
288
|
+
phone?: string;
|
|
289
|
+
phone2?: string;
|
|
290
|
+
address_line1?: string;
|
|
291
|
+
address_line2?: string;
|
|
292
|
+
address_state?: string;
|
|
293
|
+
address_country?: string;
|
|
294
|
+
address_city?: string;
|
|
295
|
+
address_postcode?: string;
|
|
296
|
+
address_company?: string;
|
|
297
|
+
}
|
|
298
|
+
interface IFormValues extends IFormPropertyOption {
|
|
299
|
+
}
|
|
300
|
+
interface IFormLabels extends IFormPropertyOption {
|
|
301
|
+
}
|
|
302
|
+
interface IFormPlaceholders extends IFormPropertyOption {
|
|
303
|
+
}
|
|
304
|
+
interface IFormElement {
|
|
305
|
+
field: string;
|
|
306
|
+
label?: string;
|
|
307
|
+
placeholder?: string;
|
|
308
|
+
value?: string;
|
|
309
|
+
}
|
|
310
|
+
type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
|
|
311
|
+
type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
|
|
312
|
+
interface IFormValidation {
|
|
313
|
+
form_valid?: boolean;
|
|
314
|
+
invalid_fields?: string[];
|
|
315
|
+
invalid_showed_fields?: string[];
|
|
316
|
+
validators?: ValidatorFieldsMap;
|
|
317
|
+
}
|
|
318
|
+
interface IStyles$1 {
|
|
319
|
+
background_color?: string;
|
|
320
|
+
background_active_color?: string;
|
|
321
|
+
text_color?: string;
|
|
322
|
+
border_color?: string;
|
|
323
|
+
button_color?: string;
|
|
324
|
+
icon_size?: string;
|
|
325
|
+
error_color?: string;
|
|
326
|
+
success_color?: string;
|
|
327
|
+
font_size?: string;
|
|
328
|
+
font_family?: string;
|
|
329
|
+
}
|
|
330
|
+
interface ITexts {
|
|
331
|
+
title?: string;
|
|
332
|
+
title_h1?: string;
|
|
333
|
+
title_h2?: string;
|
|
334
|
+
title_h3?: string;
|
|
335
|
+
title_h4?: string;
|
|
336
|
+
title_h5?: string;
|
|
337
|
+
title_h6?: string;
|
|
338
|
+
finish_text?: string;
|
|
339
|
+
title_description?: string;
|
|
340
|
+
submit_button?: string;
|
|
341
|
+
submit_button_processing?: string;
|
|
342
|
+
}
|
|
343
|
+
interface ICommonParams {
|
|
344
|
+
sdk_version?: string;
|
|
345
|
+
sdk_type?: string;
|
|
346
|
+
}
|
|
347
|
+
interface ISRCParams extends ICommonParams {
|
|
348
|
+
public_key?: string;
|
|
349
|
+
service_id?: string;
|
|
350
|
+
meta?: string;
|
|
351
|
+
}
|
|
352
|
+
interface IWalletParams extends IStyles$1, ITexts, ICommonParams {
|
|
353
|
+
token: string;
|
|
354
|
+
credentials: string;
|
|
355
|
+
currency: string;
|
|
356
|
+
amount: number;
|
|
357
|
+
gateway_mode: string;
|
|
358
|
+
}
|
|
359
|
+
interface IParams extends IStyles$1, ITexts, ICommonParams {
|
|
360
|
+
access_token?: string;
|
|
361
|
+
public_key?: string;
|
|
362
|
+
token?: string;
|
|
363
|
+
configuration_token?: string;
|
|
364
|
+
configuration_tokens?: string;
|
|
365
|
+
ref_id?: string;
|
|
366
|
+
supported_card_types?: string;
|
|
367
|
+
validate_card_types?: boolean;
|
|
368
|
+
fields_validation?: boolean;
|
|
369
|
+
hidden_elements?: string;
|
|
370
|
+
icons?: string;
|
|
371
|
+
form_values?: string;
|
|
372
|
+
form_labels?: string;
|
|
373
|
+
form_placeholders?: string;
|
|
374
|
+
query_token?: string;
|
|
375
|
+
limit?: number;
|
|
376
|
+
widget_id?: string;
|
|
377
|
+
gateway_id?: string;
|
|
378
|
+
gateway_ids?: string;
|
|
379
|
+
payment_source_types?: string;
|
|
380
|
+
element_styles?: string;
|
|
381
|
+
use_country_phone_mask?: boolean;
|
|
382
|
+
phone_mask_preferred_countries?: string;
|
|
383
|
+
phone_mask_default_country?: string;
|
|
384
|
+
phone_mask_only_countries?: string;
|
|
385
|
+
language?: string;
|
|
386
|
+
vault_display_token?: string;
|
|
387
|
+
}
|
|
388
|
+
interface ICountryPhoneMask {
|
|
389
|
+
preferred_countries?: string[];
|
|
390
|
+
default_country?: string;
|
|
391
|
+
only_countries?: string[];
|
|
392
|
+
}
|
|
393
|
+
interface IPayPalMeta {
|
|
394
|
+
brand_name?: string;
|
|
395
|
+
cart_border_color?: string;
|
|
396
|
+
reference?: string;
|
|
397
|
+
email?: string;
|
|
398
|
+
hdr_img?: string;
|
|
399
|
+
logo_img?: string;
|
|
400
|
+
pay_flow_color?: string;
|
|
401
|
+
first_name?: string;
|
|
402
|
+
last_name?: string;
|
|
403
|
+
address_line?: string;
|
|
404
|
+
address_line2?: string;
|
|
405
|
+
address_city?: string;
|
|
406
|
+
address_state?: string;
|
|
407
|
+
address_postcode?: string;
|
|
408
|
+
address_country?: string;
|
|
409
|
+
phone?: string;
|
|
410
|
+
hide_shipping_address?: boolean;
|
|
411
|
+
}
|
|
412
|
+
interface IBamboraMeta {
|
|
413
|
+
customer_storage_number?: string;
|
|
414
|
+
tokenise_algorithm?: number;
|
|
415
|
+
}
|
|
416
|
+
interface IZipmoneyMeta {
|
|
417
|
+
first_name: string;
|
|
418
|
+
last_name: string;
|
|
419
|
+
phone?: string;
|
|
420
|
+
tokenize?: boolean;
|
|
421
|
+
email: string;
|
|
422
|
+
gender?: string;
|
|
423
|
+
date_of_birth?: string;
|
|
424
|
+
charge: {
|
|
425
|
+
amount: number;
|
|
426
|
+
currency?: string;
|
|
427
|
+
reference?: string;
|
|
428
|
+
shipping_type?: string;
|
|
429
|
+
items: Array<{
|
|
430
|
+
name: string;
|
|
431
|
+
amount: number;
|
|
432
|
+
quantity: number;
|
|
433
|
+
type?: string;
|
|
434
|
+
reference?: string;
|
|
435
|
+
item_uri?: string;
|
|
436
|
+
image_url?: string;
|
|
437
|
+
}>;
|
|
438
|
+
shipping_address?: {
|
|
439
|
+
first_name?: string;
|
|
440
|
+
last_name?: string;
|
|
441
|
+
line1: string;
|
|
442
|
+
line2?: string;
|
|
443
|
+
country: string;
|
|
444
|
+
postcode: string;
|
|
445
|
+
city: string;
|
|
446
|
+
state: string;
|
|
447
|
+
};
|
|
448
|
+
billing_address: {
|
|
449
|
+
first_name?: string;
|
|
450
|
+
last_name?: string;
|
|
451
|
+
line1: string;
|
|
452
|
+
line2?: string;
|
|
453
|
+
country: string;
|
|
454
|
+
postcode: string;
|
|
455
|
+
city: string;
|
|
456
|
+
state: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
statistics: {
|
|
460
|
+
account_created?: string;
|
|
461
|
+
sales_total_number?: number;
|
|
462
|
+
sales_total_amount?: number;
|
|
463
|
+
sales_avg_value?: number;
|
|
464
|
+
sales_max_value?: number;
|
|
465
|
+
refunds_total_amount?: number;
|
|
466
|
+
previous_chargeback?: boolean;
|
|
467
|
+
currency?: string;
|
|
468
|
+
last_login?: string;
|
|
469
|
+
};
|
|
470
|
+
hide_shipping_address?: boolean;
|
|
471
|
+
}
|
|
472
|
+
interface IAfterpayMeta {
|
|
473
|
+
amount: number;
|
|
474
|
+
currency: string;
|
|
475
|
+
email: string;
|
|
476
|
+
first_name: string;
|
|
477
|
+
last_name: string;
|
|
478
|
+
address_line: string;
|
|
479
|
+
address_line2: string;
|
|
480
|
+
address_city: string;
|
|
481
|
+
address_state: string;
|
|
482
|
+
address_postcode: string;
|
|
483
|
+
address_country: string;
|
|
484
|
+
phone: string;
|
|
485
|
+
}
|
|
486
|
+
interface VaultDisplayStyle {
|
|
487
|
+
background_color?: string;
|
|
488
|
+
text_color?: string;
|
|
489
|
+
border_color?: string;
|
|
490
|
+
button_color?: string;
|
|
491
|
+
font_size?: string;
|
|
492
|
+
font_family?: string;
|
|
493
|
+
}
|
|
494
|
+
interface IApplePayShippingOption {
|
|
495
|
+
id: string;
|
|
496
|
+
label: string;
|
|
497
|
+
detail: string;
|
|
498
|
+
amount: string;
|
|
499
|
+
type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
|
|
500
|
+
}
|
|
501
|
+
interface IGooglePayShippingOption {
|
|
502
|
+
id: string;
|
|
503
|
+
label: string;
|
|
504
|
+
detail?: string;
|
|
505
|
+
type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
|
|
506
|
+
}
|
|
507
|
+
interface IPayPalShippingOption {
|
|
508
|
+
id: string;
|
|
509
|
+
label: string;
|
|
510
|
+
amount: string;
|
|
511
|
+
currency: string;
|
|
512
|
+
type: 'SHIPPING' | 'PICKUP';
|
|
513
|
+
}
|
|
514
|
+
type IShippingOption = IApplePayShippingOption | IGooglePayShippingOption | IPayPalShippingOption;
|
|
515
|
+
declare enum WALLET_TYPE {
|
|
516
|
+
GOOGLE = "google",
|
|
517
|
+
APPLE = "apple",
|
|
518
|
+
FLYPAY = "flypay",
|
|
519
|
+
FLYPAY_V2 = "flypayV2",
|
|
520
|
+
PAYPAL = "paypal",
|
|
521
|
+
AFTERPAY = "afterpay"
|
|
522
|
+
}
|
|
523
|
+
interface ApplePayStyles {
|
|
524
|
+
button_type?: string;
|
|
525
|
+
}
|
|
526
|
+
interface GooglePayStyles {
|
|
527
|
+
button_type?: 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'pay' | 'plain' | 'subscribe';
|
|
528
|
+
button_size_mode?: 'static' | 'fill';
|
|
529
|
+
button_color?: 'default' | 'black' | 'white';
|
|
530
|
+
}
|
|
531
|
+
interface AfterpayStyles {
|
|
532
|
+
button_type?: 'black' | 'mint' | 'white';
|
|
533
|
+
height?: string;
|
|
534
|
+
}
|
|
535
|
+
type WalletStyles = {
|
|
536
|
+
apple?: ApplePayStyles;
|
|
537
|
+
google?: GooglePayStyles;
|
|
538
|
+
afterpay?: AfterpayStyles;
|
|
539
|
+
} | object;
|
|
540
|
+
type WalletRawDataInitialization = {
|
|
541
|
+
apple?: ApplePayRawDataInitialization;
|
|
542
|
+
google?: GooglePayRawDataInitialization;
|
|
543
|
+
} | object;
|
|
544
|
+
type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
|
|
545
|
+
type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
|
|
546
|
+
interface IWalletMeta {
|
|
547
|
+
amount_label?: string;
|
|
548
|
+
country?: string;
|
|
549
|
+
pay_later?: boolean;
|
|
550
|
+
standalone?: boolean;
|
|
551
|
+
show_billing_address?: boolean;
|
|
552
|
+
request_payer_name?: boolean;
|
|
553
|
+
request_payer_email?: boolean;
|
|
554
|
+
request_payer_phone?: boolean;
|
|
555
|
+
request_shipping?: boolean;
|
|
556
|
+
shipping_options?: IShippingOption[];
|
|
557
|
+
merchant_name?: string;
|
|
558
|
+
raw_data_initialization?: WalletRawDataInitialization;
|
|
559
|
+
access_token?: string;
|
|
560
|
+
refresh_token?: string;
|
|
561
|
+
style?: WalletStyles;
|
|
562
|
+
wallets?: WALLET_TYPE[];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
declare class Link {
|
|
566
|
+
protected env: Env;
|
|
567
|
+
protected linkResource: string;
|
|
568
|
+
protected params: IParams;
|
|
569
|
+
protected widgetId: string;
|
|
570
|
+
constructor(linkResource: string);
|
|
571
|
+
getNetUrl(): string;
|
|
572
|
+
getUrl(): string;
|
|
573
|
+
setParams(params: IParams | IWalletParams | ISRCParams): void;
|
|
574
|
+
concatParams(params: IParams): void;
|
|
575
|
+
getParams(): IParams;
|
|
576
|
+
setEnv(env: string, alias?: string): void;
|
|
577
|
+
getEnv(): string;
|
|
578
|
+
getBaseUrl(): string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
declare class Container {
|
|
582
|
+
protected selector: string;
|
|
583
|
+
constructor(selector: string);
|
|
584
|
+
isExist(): boolean;
|
|
585
|
+
getStyles<T>(allowValue: string[]): T | {};
|
|
586
|
+
on(name: any, cb: (event: MouseEvent) => void): void;
|
|
587
|
+
getAttr<T>(allowValue: string[]): T | {};
|
|
588
|
+
getElement(): Element;
|
|
589
|
+
getSelector(): string;
|
|
590
|
+
private convertConfigs;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
declare class IFrame {
|
|
594
|
+
protected container: Container;
|
|
595
|
+
constructor(container: Container);
|
|
596
|
+
load(link: string, options?: {
|
|
597
|
+
title?: string;
|
|
598
|
+
}): void;
|
|
599
|
+
loadFromHtml(content: string, options?: {
|
|
600
|
+
title?: string;
|
|
601
|
+
}): void;
|
|
602
|
+
remove(): void;
|
|
603
|
+
show(): void;
|
|
604
|
+
hide(saveSize?: boolean): void;
|
|
605
|
+
isExist(): boolean;
|
|
606
|
+
getElement(): HTMLIFrameElement;
|
|
607
|
+
setStyle(property: string, value: string): void;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Contains basic information associated with the event.
|
|
612
|
+
*
|
|
613
|
+
* Including event (name), source of the message, purpose and a unique identifier
|
|
614
|
+
* for the event.
|
|
615
|
+
*
|
|
616
|
+
* @interface IEventData
|
|
617
|
+
*
|
|
618
|
+
* @param {string} event The name of the event.
|
|
619
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
620
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
621
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
622
|
+
*/
|
|
623
|
+
interface IEventData$1 {
|
|
624
|
+
event: string;
|
|
625
|
+
message_source: string;
|
|
626
|
+
purpose: string;
|
|
627
|
+
widget_id: string;
|
|
628
|
+
data?: any;
|
|
629
|
+
ref_id?: string;
|
|
630
|
+
}
|
|
631
|
+
declare const EVENT: {
|
|
632
|
+
AFTER_LOAD: string;
|
|
633
|
+
SUBMIT: string;
|
|
634
|
+
FINISH: string;
|
|
635
|
+
VALIDATION_ERROR: string;
|
|
636
|
+
SYSTEM_ERROR: string;
|
|
637
|
+
/** @deprecated */
|
|
638
|
+
CHECKOUT_SUCCESS: string;
|
|
639
|
+
CHECKOUT_READY: string;
|
|
640
|
+
CHECKOUT_ERROR: string;
|
|
641
|
+
CHECKOUT_COMPLETED: string;
|
|
642
|
+
CHECKOUT_POPUP_OPEN: string;
|
|
643
|
+
CHECKOUT_POPUP_CLOSE: string;
|
|
644
|
+
VALIDATION: string;
|
|
645
|
+
SELECT: string;
|
|
646
|
+
UNSELECT: string;
|
|
647
|
+
NEXT: string;
|
|
648
|
+
PREV: string;
|
|
649
|
+
META_CHANGE: string;
|
|
650
|
+
RESIZE: string;
|
|
651
|
+
CHARGE_AUTH_SUCCESS: string;
|
|
652
|
+
CHARGE_AUTH_REJECT: string;
|
|
653
|
+
CHARGE_AUTH_CANCELLED: string;
|
|
654
|
+
ADDITIONAL_DATA_SUCCESS: string;
|
|
655
|
+
ADDITIONAL_DATA_REJECT: string;
|
|
656
|
+
CHARGE_AUTH: string;
|
|
657
|
+
DISPATCH_SUCCESS: string;
|
|
658
|
+
DISPATCH_ERROR: string;
|
|
659
|
+
};
|
|
660
|
+
interface Listener {
|
|
661
|
+
event: string;
|
|
662
|
+
listener: (event: any) => void;
|
|
663
|
+
widget_id: string;
|
|
664
|
+
}
|
|
665
|
+
declare type Listeners = Listener[];
|
|
666
|
+
declare class IFrameEvent {
|
|
667
|
+
protected listeners: Listeners;
|
|
668
|
+
constructor(subject: Window | null);
|
|
669
|
+
emit(data: IEventData$1): void;
|
|
670
|
+
on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
|
|
671
|
+
clear(): void;
|
|
672
|
+
private subscribe;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* List of available payment source types
|
|
677
|
+
*
|
|
678
|
+
* @type {object}
|
|
679
|
+
* @param {string} CARD=card
|
|
680
|
+
* @param {string} BANK_ACCOUNT=bank_account
|
|
681
|
+
* @param {string} CHECKOUT=checkout
|
|
682
|
+
*/
|
|
683
|
+
declare const PAYMENT_TYPE: {
|
|
684
|
+
CARD: string;
|
|
685
|
+
GIFT_CARD: string;
|
|
686
|
+
BANK_ACCOUNT: string;
|
|
687
|
+
CHECKOUT: string;
|
|
688
|
+
};
|
|
689
|
+
/**
|
|
690
|
+
* Purposes
|
|
691
|
+
* @type {object}
|
|
692
|
+
* @param {string} PAYMENT_SOURCE=payment_source
|
|
693
|
+
* @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
|
|
694
|
+
* @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
|
|
695
|
+
* */
|
|
696
|
+
declare const PURPOSE: {
|
|
697
|
+
PAYMENT_SOURCE: string;
|
|
698
|
+
CARD_PAYMENT_SOURCE_WITH_CVV: string;
|
|
699
|
+
CARD_PAYMENT_SOURCE_WITHOUT_CVV: string;
|
|
700
|
+
};
|
|
701
|
+
interface IGeneral {
|
|
702
|
+
purpose: string;
|
|
703
|
+
predefined_fields: IPredefinedFields;
|
|
704
|
+
defined_form_fields?: string[];
|
|
705
|
+
webhook_destination?: string;
|
|
706
|
+
success_redirect_url?: string;
|
|
707
|
+
error_redirect_url?: string;
|
|
708
|
+
meta?: IPayPalMeta;
|
|
709
|
+
label?: string;
|
|
710
|
+
dynamic_fields_position?: boolean;
|
|
711
|
+
}
|
|
712
|
+
interface IPredefinedFields {
|
|
713
|
+
gateway_id: string;
|
|
714
|
+
type?: string;
|
|
715
|
+
card_scheme?: string;
|
|
716
|
+
card_processing_network?: string;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Class Configuration include methods for creating configuration token
|
|
720
|
+
* @constructor
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* var config = new Configuration('gatewayId'); // short
|
|
724
|
+
*
|
|
725
|
+
* var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
|
|
726
|
+
*
|
|
727
|
+
* var config = new Configuration('not_configured'); // without gateway
|
|
728
|
+
*
|
|
729
|
+
* @param {string} [gatewayID=default] - gateway ID. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
|
|
730
|
+
* @param {string} paymentType - Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
|
|
731
|
+
* @param {string} purpose - Param which describes payment purpose. By default uses Available parameters [PURPOSE]{@link PURPOSE}
|
|
732
|
+
*/
|
|
733
|
+
declare class Configuration {
|
|
734
|
+
private configs;
|
|
735
|
+
private env;
|
|
736
|
+
static createEachToken(accessToken: string, configs: Configuration[], cb: (tokens: string[]) => void, errorCb?: (errors: string[]) => void): void;
|
|
737
|
+
private static finishCreatingEachToken;
|
|
738
|
+
/** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: string);
|
|
739
|
+
/**
|
|
740
|
+
* Destination, where customer will receive all successful responses.
|
|
741
|
+
* Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* config.setWebHookDestination('http://google.com');
|
|
745
|
+
*
|
|
746
|
+
* @param {string} url - Your endpoint for post request.
|
|
747
|
+
*/
|
|
748
|
+
setWebHookDestination(url: string): void;
|
|
749
|
+
/**
|
|
750
|
+
* URL to which the Customer will be redirected to after the success finish
|
|
751
|
+
*
|
|
752
|
+
* @example
|
|
753
|
+
* config.setSuccessRedirectUrl('google.com/search?q=success');
|
|
754
|
+
*
|
|
755
|
+
* @param {string} url
|
|
756
|
+
*/
|
|
757
|
+
setSuccessRedirectUrl(url: string): void;
|
|
758
|
+
/**
|
|
759
|
+
* URL to which the Customer will be redirected to if an error is triggered in the process of operation
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* config.setErrorRedirectUrl('google.com/search?q=error');
|
|
763
|
+
*
|
|
764
|
+
* @param {string} url
|
|
765
|
+
*/
|
|
766
|
+
setErrorRedirectUrl(url: string): void;
|
|
767
|
+
/**
|
|
768
|
+
* Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
|
|
769
|
+
*
|
|
770
|
+
* @example
|
|
771
|
+
* config.setFormFields(['phone', 'email', 'first_name*']);
|
|
772
|
+
*
|
|
773
|
+
* @param {string[]} fields - name of fields which can be shown in a widget.
|
|
774
|
+
* If after a name of a field, you put “*”, this field will be required on client-side.
|
|
775
|
+
* (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
|
|
776
|
+
*/
|
|
777
|
+
setFormFields(fields: string[]): void;
|
|
778
|
+
/**
|
|
779
|
+
* Method for setting meta information for checkout page
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
* config.setMeta({
|
|
783
|
+
brand_name: 'paydock',
|
|
784
|
+
reference: '15',
|
|
785
|
+
email: 'wault@paydock.com'
|
|
786
|
+
});
|
|
787
|
+
*
|
|
788
|
+
* @param {IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta} object -
|
|
789
|
+
* data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta} [IBamboraMeta]{@link IBamboraMeta}
|
|
790
|
+
*/
|
|
791
|
+
setMeta(meta: IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta): void;
|
|
792
|
+
/**
|
|
793
|
+
* Current method can change environment. By default environment = sandbox.
|
|
794
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
795
|
+
*
|
|
796
|
+
* @example
|
|
797
|
+
* config.setEnv('production');
|
|
798
|
+
* @param {string} env - sandbox, production
|
|
799
|
+
* @param {string} [alias] - Own domain alias
|
|
800
|
+
*/
|
|
801
|
+
setEnv(env: string, alias?: string): void;
|
|
802
|
+
/**
|
|
803
|
+
* Title for tab which can be set instead of default
|
|
804
|
+
*
|
|
805
|
+
* @example
|
|
806
|
+
* config.setLabel('custom label');
|
|
807
|
+
*
|
|
808
|
+
* @param {string} label - Text label for tab
|
|
809
|
+
*/
|
|
810
|
+
setLabel(label: string): void;
|
|
811
|
+
getEnv(): string;
|
|
812
|
+
/**
|
|
813
|
+
* createToken - method which exactly create payment one time token
|
|
814
|
+
*
|
|
815
|
+
* @example
|
|
816
|
+
* config.createToken('582035346f65cdd57ee81192d6e5w65w4e5',
|
|
817
|
+
* function (data) {
|
|
818
|
+
* console.log(data);
|
|
819
|
+
* }, function (error) {
|
|
820
|
+
* console.log(error);
|
|
821
|
+
* });
|
|
822
|
+
*
|
|
823
|
+
* @param {string} accessToken - Customer access token or public key which provided for each client
|
|
824
|
+
* @param {createToken~requestCallback} cb - The callback that handles the success response.
|
|
825
|
+
* @param {createToken~requestCallback} errorCb - The callback that handles the failed response.
|
|
826
|
+
*/
|
|
827
|
+
createToken(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
|
|
828
|
+
private send;
|
|
829
|
+
getConfigs(): IGeneral;
|
|
830
|
+
private getUrl;
|
|
831
|
+
setGiftCardSchemeData(giftCardScheme: any, processingNetwork: any): void;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
declare class EventEmitter {
|
|
835
|
+
private events;
|
|
836
|
+
emit<T>(eventName: string, data?: T): void;
|
|
837
|
+
subscribe<T>(eventName: string, handler: (data: T) => void): () => void;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
declare class Standalone3dsService {
|
|
841
|
+
protected container: Container;
|
|
842
|
+
protected eventEmitter: EventEmitter;
|
|
843
|
+
protected env: string;
|
|
844
|
+
protected alias: string;
|
|
845
|
+
constructor(container: Container, eventEmitter: any);
|
|
846
|
+
load(token: string, options: {
|
|
847
|
+
title: string;
|
|
848
|
+
}): void;
|
|
849
|
+
setEnv(env: string, alias?: string): void;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* List of available token's content formats
|
|
854
|
+
* @enum TOKEN_FORMAT
|
|
855
|
+
*
|
|
856
|
+
* @type {object}
|
|
857
|
+
* @param {string} HTML=html
|
|
858
|
+
*/
|
|
859
|
+
declare enum TOKEN_FORMAT {
|
|
860
|
+
HTML = "html",
|
|
861
|
+
URL = "url",
|
|
862
|
+
STANDALONE_3DS = "standalone_3ds"
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* List of available event's name
|
|
866
|
+
* @const EVENT
|
|
867
|
+
*
|
|
868
|
+
* @type {object}
|
|
869
|
+
* @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
|
|
870
|
+
* @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
|
|
871
|
+
* @param {string} ADDITIONAL_DATA_SUCCESS=additionalDataCollectSuccess
|
|
872
|
+
* @param {string} ADDITIONAL_DATA_REJECT=additionalDataCollectReject
|
|
873
|
+
* @param {string} CHARGE_AUTH=chargeAuth
|
|
874
|
+
*/
|
|
875
|
+
/**
|
|
876
|
+
* List of available event's name for Standalone 3ds flow
|
|
877
|
+
* @const STANDALONE_3DS_EVENT
|
|
878
|
+
*
|
|
879
|
+
* @type {object}
|
|
880
|
+
* @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
|
|
881
|
+
* @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
|
|
882
|
+
* @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
|
|
883
|
+
* @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
|
|
884
|
+
* @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
|
|
885
|
+
* @param {string} ERROR=error
|
|
886
|
+
*/
|
|
887
|
+
/**
|
|
888
|
+
* Class Canvas3ds include method for working on html
|
|
889
|
+
* @constructor
|
|
890
|
+
*
|
|
891
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
892
|
+
* @param {string} token - Pre authorized token
|
|
893
|
+
* @example
|
|
894
|
+
* var widget = new Canvas3ds('#widget', 'token');
|
|
895
|
+
*
|
|
896
|
+
*
|
|
897
|
+
*/
|
|
898
|
+
declare class Canvas3ds {
|
|
899
|
+
protected link: Link;
|
|
900
|
+
protected configs: Configuration[];
|
|
901
|
+
protected publicKey: string;
|
|
902
|
+
protected token: {
|
|
903
|
+
content: string;
|
|
904
|
+
format: TOKEN_FORMAT;
|
|
905
|
+
charge_3ds_id: string;
|
|
906
|
+
};
|
|
907
|
+
protected standalone3dsService: Standalone3dsService;
|
|
908
|
+
protected container: Container;
|
|
909
|
+
protected iFrame: IFrame;
|
|
910
|
+
protected event: IFrameEvent;
|
|
911
|
+
protected eventEmitter: EventEmitter;
|
|
912
|
+
/** @constructs */ constructor(selector: string, token: string);
|
|
913
|
+
protected static extractToken(token: string): {
|
|
914
|
+
content: string;
|
|
915
|
+
format: TOKEN_FORMAT;
|
|
916
|
+
charge_3ds_id: string;
|
|
917
|
+
};
|
|
918
|
+
/**
|
|
919
|
+
* The final method to beginning, the load process of widget to html
|
|
920
|
+
*
|
|
921
|
+
*/
|
|
922
|
+
load(): void;
|
|
923
|
+
/**
|
|
924
|
+
* Current method can change environment. By default environment = sandbox.
|
|
925
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* widget.setEnv('production');
|
|
929
|
+
* @param {string} env - sandbox, production
|
|
930
|
+
* @param {string} [alias] - Own domain alias
|
|
931
|
+
*/
|
|
932
|
+
setEnv(env: string, alias?: string): void;
|
|
933
|
+
getEnv(): string;
|
|
934
|
+
on(eventName: string): Promise<IEventData$1>;
|
|
935
|
+
on(eventName: string, cb: (data: IEventData$1) => void): any;
|
|
936
|
+
/**
|
|
937
|
+
* Using this method you can hide widget after load
|
|
938
|
+
* @param {boolean} [saveSize=false] - using this param you can save iframe's size
|
|
939
|
+
*/
|
|
940
|
+
hide(saveSize: boolean): void;
|
|
941
|
+
/**
|
|
942
|
+
* Using this method you can show widget after using hide method
|
|
943
|
+
*
|
|
944
|
+
*/
|
|
945
|
+
show(): void;
|
|
946
|
+
/**
|
|
947
|
+
* Using this method you can reload widget
|
|
948
|
+
*
|
|
949
|
+
*/
|
|
950
|
+
reload(): void;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* @type {object}
|
|
955
|
+
* @param {string} CLICK=click
|
|
956
|
+
* @param {string} POPUP_REDIRECT=popup_redirect
|
|
957
|
+
* @param {string} ERROR=error
|
|
958
|
+
* @param {string} ACCEPTED=accepted
|
|
959
|
+
* @param {string} FINISH=finish
|
|
960
|
+
* @param {string} CLOSE=close
|
|
961
|
+
*/
|
|
962
|
+
declare const CHECKOUT_BUTTON_EVENT: {
|
|
963
|
+
CLICK: string;
|
|
964
|
+
POPUP_REDIRECT: string;
|
|
965
|
+
REDIRECT: string;
|
|
966
|
+
ERROR: string;
|
|
967
|
+
REFERRED: string;
|
|
968
|
+
DECLINED: string;
|
|
969
|
+
CANCELLED: string;
|
|
970
|
+
ACCEPTED: string;
|
|
971
|
+
FINISH: string;
|
|
972
|
+
CLOSE: string;
|
|
973
|
+
};
|
|
974
|
+
/**
|
|
975
|
+
* @type {object}
|
|
976
|
+
* @param {string} CONTEXTUAL=contextual
|
|
977
|
+
* @param {string} REDIRECT=redirect
|
|
978
|
+
*/
|
|
979
|
+
declare enum CHECKOUT_MODE {
|
|
980
|
+
CONTEXTUAL = "contextual",
|
|
981
|
+
REDIRECT = "redirect"
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* @type {object}
|
|
985
|
+
* @param {string} ZIPMONEY=Zipmoney
|
|
986
|
+
* @param {string} PAYPAL=PaypalClassic
|
|
987
|
+
* @param {string} AFTERPAY=Afterpay
|
|
988
|
+
*/
|
|
989
|
+
declare enum GATEWAY_TYPE {
|
|
990
|
+
ZIPMONEY = "Zipmoney",
|
|
991
|
+
PAYPAL = "PaypalClassic",
|
|
992
|
+
AFTERPAY = "Afterpay"
|
|
993
|
+
}
|
|
994
|
+
interface IEventCheckoutFinishData {
|
|
995
|
+
payment_source_token: string;
|
|
996
|
+
checkout_email: string;
|
|
997
|
+
checkout_holder: string;
|
|
998
|
+
gateway_type: string;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Class Background create overlay for checkout
|
|
1003
|
+
*
|
|
1004
|
+
* @example
|
|
1005
|
+
* var overlay = new Background();
|
|
1006
|
+
*/
|
|
1007
|
+
declare class Background {
|
|
1008
|
+
protected description: string;
|
|
1009
|
+
protected title: string;
|
|
1010
|
+
protected overlay: HTMLElement;
|
|
1011
|
+
protected style: HTMLStyleElement;
|
|
1012
|
+
protected eventEmitter: EventEmitter;
|
|
1013
|
+
protected showControl: boolean;
|
|
1014
|
+
protected showLoader: boolean;
|
|
1015
|
+
constructor();
|
|
1016
|
+
initControl(): void;
|
|
1017
|
+
initLoader(): void;
|
|
1018
|
+
private eventHandler;
|
|
1019
|
+
clear(): void;
|
|
1020
|
+
private createLoader;
|
|
1021
|
+
protected createTemplate(): void;
|
|
1022
|
+
private createStyles;
|
|
1023
|
+
setBackdropDescription(text: string): void;
|
|
1024
|
+
setBackdropTitle(text: string): void;
|
|
1025
|
+
onTrigger(triggerName: string, cb: () => void): void;
|
|
1026
|
+
isInit(): boolean;
|
|
1027
|
+
hideContinueControl(): void;
|
|
1028
|
+
turnOffControl(): void;
|
|
1029
|
+
turnOffLoader(): void;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
declare type SuccessCb = (data: any, status: number) => void;
|
|
1033
|
+
declare type ErrorCb = (err: any, status: number) => void;
|
|
1034
|
+
declare abstract class HttpCore {
|
|
1035
|
+
private env;
|
|
1036
|
+
constructor();
|
|
1037
|
+
setEnv(env: string, alias?: string): void;
|
|
1038
|
+
getEnv(): string;
|
|
1039
|
+
protected getUrl(): string;
|
|
1040
|
+
protected create(accessToken: string, data: any, cb: SuccessCb, errorCb: ErrorCb): void;
|
|
1041
|
+
protected get(accessToken: string, cb: SuccessCb, errorCb: ErrorCb): void;
|
|
1042
|
+
protected parser(text: any, status: number, cb: SuccessCb, errorCb: ErrorCb): void;
|
|
1043
|
+
protected abstract getLink(): string;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
interface IBody$1 {
|
|
1047
|
+
gateway_id: string;
|
|
1048
|
+
success_redirect_url: string;
|
|
1049
|
+
error_redirect_url: string;
|
|
1050
|
+
redirect_url: string;
|
|
1051
|
+
meta: IPayPalMeta;
|
|
1052
|
+
description?: string;
|
|
1053
|
+
}
|
|
1054
|
+
interface ICheckout {
|
|
1055
|
+
gateway_id: string;
|
|
1056
|
+
checkout_type: string;
|
|
1057
|
+
gateway_type: string;
|
|
1058
|
+
link: string;
|
|
1059
|
+
reference_id: string;
|
|
1060
|
+
token: string;
|
|
1061
|
+
mode?: string;
|
|
1062
|
+
}
|
|
1063
|
+
declare class Builder$1 extends HttpCore {
|
|
1064
|
+
private body;
|
|
1065
|
+
constructor(gatewayID: string, successRedirectUrl: string, errorRedirectUrl: string);
|
|
1066
|
+
protected getLink(): string;
|
|
1067
|
+
setDescriptions(text: string): void;
|
|
1068
|
+
setMeta(meta: IPayPalMeta): void;
|
|
1069
|
+
getConfigs(): IBody$1;
|
|
1070
|
+
send(publicKey: string, cb: (checkout: ICheckout) => void, errorCb?: (error: any, code: string) => void): void;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
interface IDetails {
|
|
1074
|
+
checkout_email: string;
|
|
1075
|
+
checkout_holder: string;
|
|
1076
|
+
status: string;
|
|
1077
|
+
gateway_type: string;
|
|
1078
|
+
}
|
|
1079
|
+
declare class Checker extends HttpCore {
|
|
1080
|
+
token: string;
|
|
1081
|
+
constructor(token: string);
|
|
1082
|
+
protected getLink(): string;
|
|
1083
|
+
send(accessToken: string, cb: (details: IDetails) => void, errorCb?: (error: any) => void): void;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
type AdditionalParams = Record<string, string | number | boolean>;
|
|
1087
|
+
interface IRunner {
|
|
1088
|
+
next(checkoutData: ICheckout, params?: AdditionalParams): void;
|
|
1089
|
+
error(error: string, code: string, cb: (close: boolean) => void): void;
|
|
1090
|
+
getSuccessRedirectUri(): string;
|
|
1091
|
+
getErrorRedirectUri(): string;
|
|
1092
|
+
setEnv(env: string, alias?: string): void;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
interface IContextualRunner extends IRunner {
|
|
1096
|
+
run(): void;
|
|
1097
|
+
isRunning(): boolean;
|
|
1098
|
+
continue(): void;
|
|
1099
|
+
stop(): void;
|
|
1100
|
+
onStop(cb: () => void): void;
|
|
1101
|
+
onCheckout(event: string, cb: (checkout: ICheckout) => void): void;
|
|
1102
|
+
setBackgroundTitle(text: string): void;
|
|
1103
|
+
setBackgroundDescription(text: string): void;
|
|
1104
|
+
turnOffBackdrop(): void;
|
|
1105
|
+
setSuspendedRedirectUri(uri: string): void;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
interface IRedirectRunner extends IRunner {
|
|
1109
|
+
setRedirectUrl(url: string): void;
|
|
1110
|
+
getRedirectUrl(): string;
|
|
1111
|
+
getProxyRedirectUrl(): string;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
interface CheckoutContextualHandlerParams {
|
|
1115
|
+
accessToken: string;
|
|
1116
|
+
gatewayId: string;
|
|
1117
|
+
}
|
|
1118
|
+
declare class CheckoutContextualHandler {
|
|
1119
|
+
protected background: Background;
|
|
1120
|
+
protected runner: IContextualRunner;
|
|
1121
|
+
protected eventEmitter: EventEmitter;
|
|
1122
|
+
protected params: CheckoutContextualHandlerParams;
|
|
1123
|
+
protected env: string;
|
|
1124
|
+
protected details: IDetails;
|
|
1125
|
+
constructor(background: Background, runner: IContextualRunner, eventEmitter: EventEmitter, params: CheckoutContextualHandlerParams);
|
|
1126
|
+
init(env: string): void;
|
|
1127
|
+
setEnv(env: string): void;
|
|
1128
|
+
protected checkToken(token: string, cb: () => void): void;
|
|
1129
|
+
protected createOneTimeToken(token: string): void;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Class CheckoutButton transform usual button into checkout
|
|
1134
|
+
*
|
|
1135
|
+
* @constructor
|
|
1136
|
+
*
|
|
1137
|
+
* @param {string} selector - Selector of html element.
|
|
1138
|
+
* @param {string} aceessToken - PayDock access token or users public key
|
|
1139
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
1140
|
+
* @param {string} [type=PaypalClassic] - Type of gateway (PaypalClassic, Zipmoney)
|
|
1141
|
+
* @example
|
|
1142
|
+
* var widget = new CheckoutButton('#button', 'accessToken','gatewayId');
|
|
1143
|
+
*/
|
|
1144
|
+
declare class CheckoutButton {
|
|
1145
|
+
protected accessToken: string;
|
|
1146
|
+
protected gatewayId: string;
|
|
1147
|
+
protected gatewayType: GATEWAY_TYPE;
|
|
1148
|
+
protected mode: CHECKOUT_MODE;
|
|
1149
|
+
protected window: Window;
|
|
1150
|
+
protected eventEmitter: EventEmitter;
|
|
1151
|
+
protected container: Container;
|
|
1152
|
+
protected meta: IPayPalMeta;
|
|
1153
|
+
protected runner: IContextualRunner | IRedirectRunner;
|
|
1154
|
+
protected background?: Background;
|
|
1155
|
+
protected checkoutHandler?: CheckoutContextualHandler;
|
|
1156
|
+
protected env: string;
|
|
1157
|
+
protected alias?: string;
|
|
1158
|
+
/** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
|
|
1159
|
+
protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
|
|
1160
|
+
protected buildAdditionalParams(): AdditionalParams;
|
|
1161
|
+
protected initCheckout(container: Container): void;
|
|
1162
|
+
/**
|
|
1163
|
+
* This callback will be called for each event in payment source widget
|
|
1164
|
+
*
|
|
1165
|
+
* @callback listener
|
|
1166
|
+
*/
|
|
1167
|
+
/**
|
|
1168
|
+
* Listen to events of widget
|
|
1169
|
+
*
|
|
1170
|
+
* @example
|
|
1171
|
+
*
|
|
1172
|
+
* widget.on('click', function () {
|
|
1173
|
+
*
|
|
1174
|
+
* });
|
|
1175
|
+
* @param {string} eventName - Available event names [CHECKOUT_BUTTON_EVENT]{@link CHECKOUT_BUTTON_EVENT}
|
|
1176
|
+
* @param {listener} cb
|
|
1177
|
+
*/
|
|
1178
|
+
on<T = object>(name: string, handler: (data: T) => void): void;
|
|
1179
|
+
/**
|
|
1180
|
+
* Close popup window forcibly.
|
|
1181
|
+
* Only for 'contextual' mode.
|
|
1182
|
+
*
|
|
1183
|
+
*/
|
|
1184
|
+
close(): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* After finish event of checkout button, data (dataType) will be insert to input (selector)
|
|
1187
|
+
*
|
|
1188
|
+
* @param {string} selector - css selector . [] #
|
|
1189
|
+
* @param {string} dataType - data type of IEventCheckoutFinishData [IEventCheckoutFinishData]{@link #IEventCheckoutFinishData}.
|
|
1190
|
+
*/
|
|
1191
|
+
onFinishInsert(selector: string, dataType: string): void;
|
|
1192
|
+
/**
|
|
1193
|
+
* Method for setting meta information for checkout page
|
|
1194
|
+
*
|
|
1195
|
+
* @example
|
|
1196
|
+
* button.setMeta({
|
|
1197
|
+
brand_name: 'paydock',
|
|
1198
|
+
reference: '15',
|
|
1199
|
+
email: 'wault@paydock.com'
|
|
1200
|
+
});
|
|
1201
|
+
*
|
|
1202
|
+
* @param {(IPayPalMeta|IAfterpayMeta|IZipmoneyMeta)} meta - Data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta}
|
|
1203
|
+
*/
|
|
1204
|
+
setMeta(meta: IPayPalMeta | IAfterpayMeta | IZipmoneyMeta): void;
|
|
1205
|
+
/**
|
|
1206
|
+
* Method for setting backdrop description.
|
|
1207
|
+
* Only for 'contextual' mode.
|
|
1208
|
+
*
|
|
1209
|
+
* @example
|
|
1210
|
+
* button.setBackdropDescription('Custom description');
|
|
1211
|
+
*
|
|
1212
|
+
* @param {string} text - description which can be shown in overlay of back side checkout page
|
|
1213
|
+
*/
|
|
1214
|
+
setBackdropDescription(text: string): void;
|
|
1215
|
+
/**
|
|
1216
|
+
* Method for setting backdrop title.
|
|
1217
|
+
* Only for 'contextual' mode.
|
|
1218
|
+
*
|
|
1219
|
+
* @example
|
|
1220
|
+
* button.setBackdropTitle('Custom title');
|
|
1221
|
+
*
|
|
1222
|
+
* @param {text} string - title which can be shown in overlay of back side checkout page
|
|
1223
|
+
*/
|
|
1224
|
+
setBackdropTitle(text: string): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Method for setting suspended redirect uri. Redirect after referred checkout.
|
|
1227
|
+
* Only for 'contextual' mode.
|
|
1228
|
+
*
|
|
1229
|
+
* @param {uri} string - uri for redirect (by default)
|
|
1230
|
+
*/
|
|
1231
|
+
setSuspendedRedirectUri(uri: string): void;
|
|
1232
|
+
/**
|
|
1233
|
+
* Method for setting the merchant redirect URL.
|
|
1234
|
+
* Merchant's customers redirect after successfull checkout.
|
|
1235
|
+
* Only for 'redirect' mode.
|
|
1236
|
+
*
|
|
1237
|
+
* @param {url} string - redirect url
|
|
1238
|
+
*/
|
|
1239
|
+
setRedirectUrl(url: string): void;
|
|
1240
|
+
getSuccessRedirectUri(): string;
|
|
1241
|
+
/**
|
|
1242
|
+
* Method for disable backdrop on the page.
|
|
1243
|
+
* Only for 'contextual' mode.
|
|
1244
|
+
*
|
|
1245
|
+
* @example
|
|
1246
|
+
* button.turnOffBackdrop();
|
|
1247
|
+
*
|
|
1248
|
+
*/
|
|
1249
|
+
turnOffBackdrop(): void;
|
|
1250
|
+
protected turnOffControlBackdrop(): void;
|
|
1251
|
+
protected turnOffLoaderBackdrop(): void;
|
|
1252
|
+
setEnv(env: string, alias?: string): void;
|
|
1253
|
+
getEnv(): string;
|
|
1254
|
+
private getRunnerByMode;
|
|
1255
|
+
private assertMethodSupport;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
interface ZipmoneyRunnerParams extends AdditionalParams {
|
|
1259
|
+
gateway_id: string;
|
|
1260
|
+
public_key: string;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Class ZipmoneyCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
|
|
1265
|
+
*
|
|
1266
|
+
* @extends CheckoutButton
|
|
1267
|
+
*
|
|
1268
|
+
* @constructor
|
|
1269
|
+
*
|
|
1270
|
+
* @param {string} selector - Selector of html element.
|
|
1271
|
+
* @param {string} publicKey - PayDock users public key
|
|
1272
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
1273
|
+
* @param {string} [gatewayId=default] - Checkout mode, it could be set to 'contextual' or 'redirect'. By default it 'contextual'
|
|
1274
|
+
* @example
|
|
1275
|
+
* var widget = new ZipmoneyCheckoutButton('#button', 'publicKey','gatewayId');
|
|
1276
|
+
*/
|
|
1277
|
+
declare class ZipmoneyCheckoutButton extends CheckoutButton {
|
|
1278
|
+
protected publicKey: string;
|
|
1279
|
+
protected gatewayId: string;
|
|
1280
|
+
protected mode: CHECKOUT_MODE;
|
|
1281
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
|
|
1282
|
+
/**
|
|
1283
|
+
* Method for setting suspended redirect uri. Redirect after referred checkout
|
|
1284
|
+
*
|
|
1285
|
+
* The URI is used for a redirect after the checkout is complete.
|
|
1286
|
+
* This can be provided, even if using in-context checkout (sdk). By default, the standard styled page will be used.
|
|
1287
|
+
* If using in-context (sdk) we will not automatically redirect to this URI.
|
|
1288
|
+
*
|
|
1289
|
+
|
|
1290
|
+
* @param {uri} string - uri for suspended redirect (by default)
|
|
1291
|
+
*/
|
|
1292
|
+
setSuspendedRedirectUri(uri: string): void;
|
|
1293
|
+
/**
|
|
1294
|
+
* Method for setting the merchant redirect URL.
|
|
1295
|
+
* The merchant's customers would be redirected to the specified URL
|
|
1296
|
+
* at the end of ZipMoney checkout flow.
|
|
1297
|
+
*
|
|
1298
|
+
* Once the redirect URL would be set, the checkout flow would be immediately switched
|
|
1299
|
+
* from 'contextual' mode to the 'redirect' mode.
|
|
1300
|
+
* The merchant's customer would be automatically redirected to this URL after the checkout is complete.
|
|
1301
|
+
*
|
|
1302
|
+
* @param {url} string - URL for redirect
|
|
1303
|
+
*/
|
|
1304
|
+
setRedirectUrl(url: string): void;
|
|
1305
|
+
protected buildAdditionalParams(): ZipmoneyRunnerParams;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Class AfterpayCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
|
|
1310
|
+
*
|
|
1311
|
+
* @extends CheckoutButton
|
|
1312
|
+
*
|
|
1313
|
+
* @constructor
|
|
1314
|
+
*
|
|
1315
|
+
* @param {string} selector - Selector of html element.
|
|
1316
|
+
* @param {string} accessToken - PayDock access-token or users public key
|
|
1317
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
1318
|
+
* @example
|
|
1319
|
+
* var widget = new AfterpayCheckoutButton('#button', 'access-token','gatewayId');
|
|
1320
|
+
*/
|
|
1321
|
+
declare class AfterpayCheckoutButton extends CheckoutButton {
|
|
1322
|
+
protected accessToken: string;
|
|
1323
|
+
protected gatewayId: string;
|
|
1324
|
+
protected showETP: boolean;
|
|
1325
|
+
/** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
|
|
1326
|
+
/**
|
|
1327
|
+
* Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
|
|
1328
|
+
*
|
|
1329
|
+
* This popup with a warning about "Enhanced Tracking Protection" limitations
|
|
1330
|
+
* would be shown in the Mozilla Firefox browser version 100+
|
|
1331
|
+
*
|
|
1332
|
+
* By default, the popup would not be shown, until
|
|
1333
|
+
* the flag would be set to `true`
|
|
1334
|
+
|
|
1335
|
+
* @param {doShow} boolean - flag which toggle the popup visibility
|
|
1336
|
+
*/
|
|
1337
|
+
showEnhancedTrackingProtectionPopup(doShow: boolean): void;
|
|
1338
|
+
protected buildAdditionalParams(): AdditionalParams;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Class PaypalCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
|
|
1343
|
+
*
|
|
1344
|
+
* @extends CheckoutButton
|
|
1345
|
+
*
|
|
1346
|
+
* @constructor
|
|
1347
|
+
*
|
|
1348
|
+
* @param {string} selector - Selector of html element.
|
|
1349
|
+
* @param {string} publicKey - PayDock users public key
|
|
1350
|
+
* @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
|
|
1351
|
+
* @example
|
|
1352
|
+
* var widget = new PaypalCheckoutButton('#button', 'publicKey','gatewayId');
|
|
1353
|
+
*/
|
|
1354
|
+
declare class PaypalCheckoutButton extends CheckoutButton {
|
|
1355
|
+
protected publicKey: string;
|
|
1356
|
+
protected gatewayId: string;
|
|
1357
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
*
|
|
1362
|
+
* Class PaymentSourceWidget include method for for creating iframe url
|
|
1363
|
+
* @constructor
|
|
1364
|
+
*
|
|
1365
|
+
* @param {string} publicKey - PayDock users public key
|
|
1366
|
+
* @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true)
|
|
1367
|
+
* @param {boolean} [useReference=false]
|
|
1368
|
+
*
|
|
1369
|
+
* @example
|
|
1370
|
+
* var widget = new PaymentSourceWidget('publicKey','customerId');
|
|
1371
|
+
* // or
|
|
1372
|
+
* var widget = new PaymentSourceWidget('publicKey', customerReference, true);
|
|
1373
|
+
*/
|
|
1374
|
+
declare class PaymentSourceWidget {
|
|
1375
|
+
protected link: Link;
|
|
1376
|
+
protected configs: Configuration[];
|
|
1377
|
+
protected configTokens: string[];
|
|
1378
|
+
protected publicKey: string;
|
|
1379
|
+
/** @constructs */ constructor(accessToken: string, queryToken: string);
|
|
1380
|
+
/**
|
|
1381
|
+
* Object contain styles for widget
|
|
1382
|
+
*
|
|
1383
|
+
* @example
|
|
1384
|
+
* widget.setStyles({
|
|
1385
|
+
* background_color: 'rgb(0, 0, 0)',
|
|
1386
|
+
* border_color: 'yellow',
|
|
1387
|
+
* text_color: '#FFFFAA',
|
|
1388
|
+
* icon_size: 'small',
|
|
1389
|
+
* font_size: '20px'
|
|
1390
|
+
* });
|
|
1391
|
+
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
|
|
1392
|
+
*/
|
|
1393
|
+
setStyles(styles: IStyles$1): void;
|
|
1394
|
+
setStyle(param: string, value: string): void;
|
|
1395
|
+
/**
|
|
1396
|
+
* Current method can set custom ID to identify the data in the future
|
|
1397
|
+
*
|
|
1398
|
+
* @example
|
|
1399
|
+
* widget.setRefId('id');
|
|
1400
|
+
*
|
|
1401
|
+
* @param {string} refId - custom id
|
|
1402
|
+
*/
|
|
1403
|
+
setRefId(refId: string): void;
|
|
1404
|
+
/**
|
|
1405
|
+
* Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next.
|
|
1406
|
+
*
|
|
1407
|
+
* @param {string} count - payment source count
|
|
1408
|
+
*/
|
|
1409
|
+
setLimit(count: number): void;
|
|
1410
|
+
/**
|
|
1411
|
+
* Current method can change environment. By default environment = sandbox
|
|
1412
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
1413
|
+
*
|
|
1414
|
+
* @example
|
|
1415
|
+
* widget.setEnv('production');
|
|
1416
|
+
* @param {string} env - sandbox, production
|
|
1417
|
+
* @param {string} [alias] - Own domain alias
|
|
1418
|
+
*/
|
|
1419
|
+
setEnv(env: string, alias?: string): void;
|
|
1420
|
+
getEnv(): void;
|
|
1421
|
+
/**
|
|
1422
|
+
* Method for getting iframe's url
|
|
1423
|
+
*/
|
|
1424
|
+
getIFrameUrl(): string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Show payment source inside widget only with requested gateway ids
|
|
1427
|
+
*
|
|
1428
|
+
*
|
|
1429
|
+
* @param {string[]} ids - List of gateway_id
|
|
1430
|
+
*/
|
|
1431
|
+
filterByGatewayIds(ids: string[]): void;
|
|
1432
|
+
/**
|
|
1433
|
+
*
|
|
1434
|
+
* Show payment source inside widget only with requested payment source types
|
|
1435
|
+
*
|
|
1436
|
+
* @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
|
|
1437
|
+
*/
|
|
1438
|
+
filterByTypes(types: string[]): void;
|
|
1439
|
+
/**
|
|
1440
|
+
* Method for setting a custom language code
|
|
1441
|
+
*
|
|
1442
|
+
* @example
|
|
1443
|
+
* config.setLanguage('en');
|
|
1444
|
+
* @param {string} code - ISO 639-1
|
|
1445
|
+
*/
|
|
1446
|
+
setLanguage(code: any): void;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
interface IEventSelectData extends IEventData$1 {
|
|
1450
|
+
customer_id: string;
|
|
1451
|
+
payment_source_id: string;
|
|
1452
|
+
gateway_id: string;
|
|
1453
|
+
primary: boolean;
|
|
1454
|
+
card_number_last4?: string;
|
|
1455
|
+
card_scheme?: string;
|
|
1456
|
+
checkout_email?: string;
|
|
1457
|
+
gateway_type?: string;
|
|
1458
|
+
payment_source_type: string;
|
|
1459
|
+
account_name?: string;
|
|
1460
|
+
account_number?: string;
|
|
1461
|
+
}
|
|
1462
|
+
interface IEventPaginationData extends IEventData$1 {
|
|
1463
|
+
total_item: number;
|
|
1464
|
+
skip: number;
|
|
1465
|
+
limit: number;
|
|
1466
|
+
}
|
|
1467
|
+
interface IEventAfterLoadData extends IEventData$1 {
|
|
1468
|
+
total_item: number;
|
|
1469
|
+
skip: number;
|
|
1470
|
+
limit: number;
|
|
1471
|
+
}
|
|
1472
|
+
interface IEventSizeData extends IEventData$1 {
|
|
1473
|
+
height: number;
|
|
1474
|
+
width: number;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Interface of data from event.
|
|
1478
|
+
*
|
|
1479
|
+
* @interface IEventSelectData
|
|
1480
|
+
*
|
|
1481
|
+
* @param {string} event
|
|
1482
|
+
* @param {string} purpose
|
|
1483
|
+
* @param {string} message_source
|
|
1484
|
+
* @param {string} [ref_id]
|
|
1485
|
+
* @param {string} customer_id
|
|
1486
|
+
* @param {string} payment_source_id
|
|
1487
|
+
* @param {string} gateway_id
|
|
1488
|
+
* @param {boolean} primary
|
|
1489
|
+
* @param {string} [widget_id]
|
|
1490
|
+
* @param {string} [card_number_last4]
|
|
1491
|
+
* @param {string} [card_scheme]
|
|
1492
|
+
* @param {string} gateway_type
|
|
1493
|
+
* @param {string} [checkout_email]
|
|
1494
|
+
* @param {string} payment_source_type
|
|
1495
|
+
* @param {string} [account_name]
|
|
1496
|
+
* @param {string} [account_number]
|
|
1497
|
+
* */
|
|
1498
|
+
/**
|
|
1499
|
+
* Interface of data from event.
|
|
1500
|
+
*
|
|
1501
|
+
* @interface IEventPaginationData
|
|
1502
|
+
*
|
|
1503
|
+
* @param {string} event
|
|
1504
|
+
* @param {string} purpose
|
|
1505
|
+
* @param {string} message_source
|
|
1506
|
+
* @param {string} [ref_id]
|
|
1507
|
+
* @param {number} total_item
|
|
1508
|
+
* @param {number} skip
|
|
1509
|
+
* @param {number} limit
|
|
1510
|
+
* */
|
|
1511
|
+
/**
|
|
1512
|
+
* Interface of data from event.
|
|
1513
|
+
*
|
|
1514
|
+
* @interface IEventAfterLoadData
|
|
1515
|
+
*
|
|
1516
|
+
* @param {string} event The name of the event.
|
|
1517
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
1518
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
1519
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
1520
|
+
* @param {number} total_item Pagination param. Total item count
|
|
1521
|
+
* @param {number} skip Pagination param. Skip items from first item
|
|
1522
|
+
* @param {number} limit Pagination param. Query limit
|
|
1523
|
+
* */
|
|
1524
|
+
/**
|
|
1525
|
+
* Interface of data from event.
|
|
1526
|
+
* @interface IEventFinishData
|
|
1527
|
+
*
|
|
1528
|
+
* @param {string} event The name of the event.
|
|
1529
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
1530
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
1531
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
1532
|
+
* */
|
|
1533
|
+
/**
|
|
1534
|
+
* Interface of data from event.
|
|
1535
|
+
* @interface IEventSizeData
|
|
1536
|
+
*
|
|
1537
|
+
* @param {number} event The name of the event.
|
|
1538
|
+
* @param {number} purpose A system variable that states the purpose of the event.
|
|
1539
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
1540
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
1541
|
+
* @param {number} height Height of iFrame
|
|
1542
|
+
* @param {number} width Width of iFrame
|
|
1543
|
+
* */
|
|
1544
|
+
/**
|
|
1545
|
+
* List of available event's name
|
|
1546
|
+
*
|
|
1547
|
+
* @const EVENT
|
|
1548
|
+
*
|
|
1549
|
+
* @type {object}
|
|
1550
|
+
* @param {string} AFTER_LOAD=afterLoad
|
|
1551
|
+
* @param {string} SYSTEM_ERROR=systemError
|
|
1552
|
+
* @param {string} SELECT=select
|
|
1553
|
+
* @param {string} UNSELECT=unselect
|
|
1554
|
+
* @param {string} NEXT=next
|
|
1555
|
+
* @param {string} PREV=prev
|
|
1556
|
+
* @param {string} META_CHANGE=metaChange
|
|
1557
|
+
* @param {string} RESIZE=resize
|
|
1558
|
+
*/
|
|
1559
|
+
/**
|
|
1560
|
+
* Class HtmlPaymentSourceWidget include method for working on html
|
|
1561
|
+
* @constructor
|
|
1562
|
+
* @extends PaymentSourceWidget
|
|
1563
|
+
*
|
|
1564
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
1565
|
+
* @param {string} publicKey - PayDock users public key
|
|
1566
|
+
* @param {string} queryToken - PayDock's query token that represents params to search customer by id or reference
|
|
1567
|
+
* @example
|
|
1568
|
+
* * var widget = new HtmlPaymentSourceWidget('#widget', 'publicKey','queryToken');
|
|
1569
|
+
|
|
1570
|
+
*/
|
|
1571
|
+
declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
|
|
1572
|
+
protected container: Container;
|
|
1573
|
+
protected iFrame: IFrame;
|
|
1574
|
+
protected event: IFrameEvent;
|
|
1575
|
+
/** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
|
|
1576
|
+
/**
|
|
1577
|
+
* The final method to beginning, the load process of widget to html
|
|
1578
|
+
*
|
|
1579
|
+
*/
|
|
1580
|
+
load(): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* This callback will be called for each event in payment source widget
|
|
1583
|
+
*
|
|
1584
|
+
* @callback listener--PaymentSourceWidget
|
|
1585
|
+
* @param {IEventData | IEventSelectData | IEventPaginationData | IEventAfterLoadData} response
|
|
1586
|
+
*/
|
|
1587
|
+
/**
|
|
1588
|
+
* Listen to events of widget
|
|
1589
|
+
*
|
|
1590
|
+
* @example
|
|
1591
|
+
*
|
|
1592
|
+
* widget.on('select', function (data) {
|
|
1593
|
+
* console.log(data);
|
|
1594
|
+
* });
|
|
1595
|
+
* @param {string} eventName - Available event names [EVENT]{@link EVENT}
|
|
1596
|
+
* @param {listener--PaymentSourceWidget} cb
|
|
1597
|
+
*/
|
|
1598
|
+
on(eventName: string, cb: (data: IEventData$1 | IEventSelectData | IEventPaginationData | IEventAfterLoadData | IEventSizeData) => void): void;
|
|
1599
|
+
/**
|
|
1600
|
+
* Using this method you can hide widget after load
|
|
1601
|
+
* @param {boolean} [saveSize=false] - using this param you can save iframe's size
|
|
1602
|
+
*/
|
|
1603
|
+
hide(saveSize: boolean): void;
|
|
1604
|
+
/**
|
|
1605
|
+
* Using this method you can show widget after using hide method
|
|
1606
|
+
*
|
|
1607
|
+
*/
|
|
1608
|
+
show(): void;
|
|
1609
|
+
/**
|
|
1610
|
+
* Using this method you can reload widget
|
|
1611
|
+
*
|
|
1612
|
+
*/
|
|
1613
|
+
reload(): void;
|
|
1614
|
+
/**
|
|
1615
|
+
* After select event of widget, data (dataType) will be insert to input (selector)
|
|
1616
|
+
*
|
|
1617
|
+
* @param {string} selector - css selector . [] #
|
|
1618
|
+
* @param {string} dataType - data type of [IEventSelectData]{@link IEventSelectData}.
|
|
1619
|
+
*/
|
|
1620
|
+
onSelectInsert(selector: string, dataType: string): void;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
declare const TYPE: {
|
|
1624
|
+
EXTERNAL_CHECKOUT_TOKEN: string;
|
|
1625
|
+
CHECKOUT_TOKEN: string;
|
|
1626
|
+
BANK_ACCOUNT: string;
|
|
1627
|
+
CARD: string;
|
|
1628
|
+
};
|
|
1629
|
+
interface IBody {
|
|
1630
|
+
gateway_id: string;
|
|
1631
|
+
type: string;
|
|
1632
|
+
checkout_token?: string;
|
|
1633
|
+
}
|
|
1634
|
+
declare class Builder extends HttpCore {
|
|
1635
|
+
private body;
|
|
1636
|
+
constructor(gatewayID: string, checkoutToken: string, type: string);
|
|
1637
|
+
constructor(gatewayID: string, externalCheckoutToken: string, type: string);
|
|
1638
|
+
constructor(gatewayID: string, card: any, type: string);
|
|
1639
|
+
constructor(gatewayID: string, bankAccount: any, type: string);
|
|
1640
|
+
protected getLink(): string;
|
|
1641
|
+
send(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
|
|
1642
|
+
getConfigs(): IBody;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
interface IBaseSRCMeta {
|
|
1646
|
+
customizations?: IStyles;
|
|
1647
|
+
dpa_data?: {
|
|
1648
|
+
dpa_presentation_name?: string;
|
|
1649
|
+
dpa_uri?: string;
|
|
1650
|
+
};
|
|
1651
|
+
dpa_transaction_options?: {
|
|
1652
|
+
dpa_locale?: string;
|
|
1653
|
+
dpa_accepted_billing_countries?: string[];
|
|
1654
|
+
consumer_name_requested?: boolean;
|
|
1655
|
+
consumer_email_address_requested?: boolean;
|
|
1656
|
+
consumer_phone_number_requested?: boolean;
|
|
1657
|
+
transaction_amount?: {
|
|
1658
|
+
transaction_amount?: number;
|
|
1659
|
+
transaction_currency_code?: string;
|
|
1660
|
+
};
|
|
1661
|
+
merchant_order_id?: string;
|
|
1662
|
+
merchant_category_code?: string;
|
|
1663
|
+
merchant_country_code?: string;
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
interface PhoneNumber {
|
|
1667
|
+
country_code: string;
|
|
1668
|
+
phone_number: string;
|
|
1669
|
+
}
|
|
1670
|
+
interface Customer {
|
|
1671
|
+
email?: string;
|
|
1672
|
+
phone?: {
|
|
1673
|
+
country_code?: string;
|
|
1674
|
+
phone?: string;
|
|
1675
|
+
};
|
|
1676
|
+
first_name?: string;
|
|
1677
|
+
last_name?: string;
|
|
1678
|
+
}
|
|
1679
|
+
interface IClickToPayMeta extends IBaseSRCMeta {
|
|
1680
|
+
dpa_data?: IBaseSRCMeta['dpa_data'] & {
|
|
1681
|
+
dpa_address?: string;
|
|
1682
|
+
dpa_email_address?: string;
|
|
1683
|
+
dpa_phone_number?: PhoneNumber;
|
|
1684
|
+
dpa_logo_uri?: string;
|
|
1685
|
+
dpa_supported_email_address?: string;
|
|
1686
|
+
dpa_supported_phone_number?: PhoneNumber;
|
|
1687
|
+
dpa_uri?: string;
|
|
1688
|
+
dpa_support_uri?: string;
|
|
1689
|
+
application_type?: 'WEB_BROWSER' | 'MOBILE_APP';
|
|
1690
|
+
};
|
|
1691
|
+
disable_summary_screen?: boolean;
|
|
1692
|
+
co_brand_names?: string[];
|
|
1693
|
+
checkout_experience?: 'WITHIN_CHECKOUT' | 'PAYMENT_SETTINGS';
|
|
1694
|
+
services?: 'INLINE_CHECKOUT' | 'INLINE_INSTALLMENTS';
|
|
1695
|
+
dpa_transaction_options?: IBaseSRCMeta['dpa_transaction_options'] & {
|
|
1696
|
+
dpa_billing_preference?: MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE;
|
|
1697
|
+
payment_options?: Array<{
|
|
1698
|
+
dynamic_data_type?: string;
|
|
1699
|
+
}>;
|
|
1700
|
+
order_type?: MASTERCARD_ORDER_TYPE;
|
|
1701
|
+
three_ds_preference?: string;
|
|
1702
|
+
confirm_payment?: boolean;
|
|
1703
|
+
};
|
|
1704
|
+
customer?: Customer;
|
|
1705
|
+
unaccepted_card_type?: 'CREDIT' | 'DEBIT';
|
|
1706
|
+
}
|
|
1707
|
+
type MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE = 'FULL' | 'POSTAL_COUNTRY' | 'NONE';
|
|
1708
|
+
type MASTERCARD_ORDER_TYPE = 'SPLIT_SHIPMENT' | 'PREFERRED_CARD';
|
|
1709
|
+
interface IStyles {
|
|
1710
|
+
primary_button_color?: string;
|
|
1711
|
+
secondary_button_color?: string;
|
|
1712
|
+
primary_button_text_color?: string;
|
|
1713
|
+
secondary_button_text_color?: string;
|
|
1714
|
+
font_family?: string;
|
|
1715
|
+
enable_src_popup?: boolean;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
declare class ApiChargeInternal {
|
|
1719
|
+
protected api: ApiInternal;
|
|
1720
|
+
constructor(api: ApiInternal);
|
|
1721
|
+
walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
|
|
1722
|
+
walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
|
|
1723
|
+
standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
|
|
1724
|
+
standalone3dsHandle(): Promise<HandleResponseInterface>;
|
|
1725
|
+
}
|
|
1726
|
+
interface WalletCaptureResponse {
|
|
1727
|
+
id: string;
|
|
1728
|
+
amount: number;
|
|
1729
|
+
currency: string;
|
|
1730
|
+
status: string;
|
|
1731
|
+
}
|
|
1732
|
+
interface WalletCaptureBody {
|
|
1733
|
+
payment_method_id?: string;
|
|
1734
|
+
customer?: {
|
|
1735
|
+
payment_source?: {
|
|
1736
|
+
type?: string;
|
|
1737
|
+
card_name?: string;
|
|
1738
|
+
card_scheme?: string;
|
|
1739
|
+
card_number_last4?: string;
|
|
1740
|
+
expire_month?: number;
|
|
1741
|
+
expire_year?: number;
|
|
1742
|
+
address_line1?: string;
|
|
1743
|
+
address_line2?: string;
|
|
1744
|
+
address_city?: string;
|
|
1745
|
+
address_postcode?: string;
|
|
1746
|
+
address_state?: string;
|
|
1747
|
+
address_country?: string;
|
|
1748
|
+
external_payer_id?: string;
|
|
1749
|
+
ref_token?: string;
|
|
1750
|
+
};
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
interface WalletCallbackBody {
|
|
1754
|
+
request_type: string;
|
|
1755
|
+
}
|
|
1756
|
+
interface WalletCallbackResponse {
|
|
1757
|
+
id: string;
|
|
1758
|
+
status: string;
|
|
1759
|
+
callback_method: string;
|
|
1760
|
+
callback_rel: string;
|
|
1761
|
+
callback_url: string;
|
|
1762
|
+
}
|
|
1763
|
+
interface Standalone3dsProcessBody {
|
|
1764
|
+
charge_3ds_id: string;
|
|
1765
|
+
}
|
|
1766
|
+
interface HandleResponseInterface {
|
|
1767
|
+
status: string;
|
|
1768
|
+
error: string;
|
|
1769
|
+
result: {
|
|
1770
|
+
reference: string;
|
|
1771
|
+
reference_2: string;
|
|
1772
|
+
identifier: string;
|
|
1773
|
+
identifier_2: string;
|
|
1774
|
+
identifier_3: string;
|
|
1775
|
+
identifier_4: string;
|
|
1776
|
+
identifier_5: string;
|
|
1777
|
+
type: string;
|
|
1778
|
+
status: string;
|
|
1779
|
+
status_2: string;
|
|
1780
|
+
status_code: string;
|
|
1781
|
+
ref_token: string;
|
|
1782
|
+
cancellation: string;
|
|
1783
|
+
count: string;
|
|
1784
|
+
version: string;
|
|
1785
|
+
whitelist: {
|
|
1786
|
+
status: string;
|
|
1787
|
+
source: string;
|
|
1788
|
+
};
|
|
1789
|
+
result: string;
|
|
1790
|
+
};
|
|
1791
|
+
}
|
|
1792
|
+
interface ProcessAuthenticationResponse {
|
|
1793
|
+
status: string;
|
|
1794
|
+
error?: string;
|
|
1795
|
+
result?: {
|
|
1796
|
+
challenge: string;
|
|
1797
|
+
challenge_url: string;
|
|
1798
|
+
decoupled_challenge: boolean;
|
|
1799
|
+
frictionless: boolean;
|
|
1800
|
+
identifier: string;
|
|
1801
|
+
identifier_3: string;
|
|
1802
|
+
identifier_4: string;
|
|
1803
|
+
reference: string;
|
|
1804
|
+
reference_2: string;
|
|
1805
|
+
secondary_url: string;
|
|
1806
|
+
skipped: boolean;
|
|
1807
|
+
status: string;
|
|
1808
|
+
type: string;
|
|
1809
|
+
version: string;
|
|
1810
|
+
description?: string;
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
declare class ApiServiceInternal {
|
|
1815
|
+
protected api: ApiInternal;
|
|
1816
|
+
constructor(api: ApiInternal);
|
|
1817
|
+
getConfig(service_id: string): Promise<GetConfigResponse>;
|
|
1818
|
+
}
|
|
1819
|
+
interface GetConfigResponse {
|
|
1820
|
+
type: string;
|
|
1821
|
+
merchant: string;
|
|
1822
|
+
username: string;
|
|
1823
|
+
password: string;
|
|
1824
|
+
certificate: string;
|
|
1825
|
+
certificate_passphrase: string;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
declare class ApiInternal extends ApiBase {
|
|
1829
|
+
charge(): ApiChargeInternal;
|
|
1830
|
+
service(): ApiServiceInternal;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
interface SRCProvider {
|
|
1834
|
+
load(): void;
|
|
1835
|
+
getEnv(): string;
|
|
1836
|
+
hideButton?(saveSize: boolean): void;
|
|
1837
|
+
showButton?(): void;
|
|
1838
|
+
hideCheckout?(saveSize: boolean): void;
|
|
1839
|
+
showCheckout?(): void;
|
|
1840
|
+
reload(): void;
|
|
1841
|
+
useAutoResize?(): void;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
declare abstract class SRC {
|
|
1845
|
+
protected iframe_selector: string;
|
|
1846
|
+
protected service_id: string;
|
|
1847
|
+
protected public_key_or_access_token: string;
|
|
1848
|
+
protected meta: IClickToPayMeta;
|
|
1849
|
+
protected eventEmitter: EventEmitter;
|
|
1850
|
+
protected env: string;
|
|
1851
|
+
protected alias?: string;
|
|
1852
|
+
protected api: ApiInternal;
|
|
1853
|
+
protected provider: SRCProvider;
|
|
1854
|
+
protected autoResize: boolean;
|
|
1855
|
+
protected style: IStyles;
|
|
1856
|
+
constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
|
|
1857
|
+
/**
|
|
1858
|
+
* Object contain styles for widget - call before `.load()`.
|
|
1859
|
+
*
|
|
1860
|
+
* @example
|
|
1861
|
+
* widget.setStyles({
|
|
1862
|
+
* enable_src_popup: true
|
|
1863
|
+
* primary_button_color: 'red',
|
|
1864
|
+
* secondary_button_color: 'blue',
|
|
1865
|
+
* primary_button_text_color: 'white',
|
|
1866
|
+
* secondary_button_text_color: 'white',
|
|
1867
|
+
* font_family: 'Arial',
|
|
1868
|
+
* });
|
|
1869
|
+
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
|
|
1870
|
+
*/
|
|
1871
|
+
setStyles(styles: IStyles): void;
|
|
1872
|
+
private setStyle;
|
|
1873
|
+
load(): void;
|
|
1874
|
+
/**
|
|
1875
|
+
* Current method can change environment. By default environment = sandbox.
|
|
1876
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
1877
|
+
*
|
|
1878
|
+
* @example
|
|
1879
|
+
* SRC.setEnv('production');
|
|
1880
|
+
* @param {string} env - sandbox, production
|
|
1881
|
+
* @param {string} [alias] - Own domain alias
|
|
1882
|
+
*/
|
|
1883
|
+
setEnv(env: string, alias?: string): void;
|
|
1884
|
+
/**
|
|
1885
|
+
* Method to read the current environment
|
|
1886
|
+
*
|
|
1887
|
+
* @example
|
|
1888
|
+
* SRC.getEnv();
|
|
1889
|
+
*/
|
|
1890
|
+
getEnv(): string;
|
|
1891
|
+
on(eventName: string): Promise<any>;
|
|
1892
|
+
on(eventName: string, cb: (data: any) => void): any;
|
|
1893
|
+
/**
|
|
1894
|
+
* Using this method you can hide checkout after load and button click
|
|
1895
|
+
* @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
|
|
1896
|
+
*
|
|
1897
|
+
* @example
|
|
1898
|
+
* SRC.hideCheckout();
|
|
1899
|
+
*/
|
|
1900
|
+
hideCheckout(saveSize: boolean): void;
|
|
1901
|
+
/**
|
|
1902
|
+
* Using this method you can show checkout after using hideCheckout method
|
|
1903
|
+
*
|
|
1904
|
+
* @example
|
|
1905
|
+
* SRC.showCheckout()
|
|
1906
|
+
*/
|
|
1907
|
+
showCheckout(): void;
|
|
1908
|
+
/**
|
|
1909
|
+
* Using this method you can reload the whole checkout
|
|
1910
|
+
*
|
|
1911
|
+
* @example
|
|
1912
|
+
* SRC.reload()
|
|
1913
|
+
*/
|
|
1914
|
+
reload(): void;
|
|
1915
|
+
/**
|
|
1916
|
+
* Use this method for resize checkout iFrame according to content height, if applicable
|
|
1917
|
+
*
|
|
1918
|
+
* @example
|
|
1919
|
+
* SRC.useAutoResize();
|
|
1920
|
+
*
|
|
1921
|
+
*/
|
|
1922
|
+
useAutoResize(): void;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
/**
|
|
1926
|
+
* Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
|
|
1927
|
+
*
|
|
1928
|
+
* @extends SRC
|
|
1929
|
+
*
|
|
1930
|
+
* @constructor
|
|
1931
|
+
*
|
|
1932
|
+
* @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame.
|
|
1933
|
+
* @param {string} service_id - Card Scheme Service ID
|
|
1934
|
+
* @param {string} public_key_or_access_token - Paydock public key or Access Token
|
|
1935
|
+
* @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout
|
|
1936
|
+
* @example
|
|
1937
|
+
* var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
1938
|
+
*
|
|
1939
|
+
*/
|
|
1940
|
+
declare class ClickToPay extends SRC {
|
|
1941
|
+
protected iframe_selector: string;
|
|
1942
|
+
protected service_id: string;
|
|
1943
|
+
protected public_key_or_access_token: string;
|
|
1944
|
+
protected meta: IClickToPayMeta;
|
|
1945
|
+
/** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
|
|
1946
|
+
/**
|
|
1947
|
+
* The final method after configuring the SRC to start the load process of Click To Pay checkout
|
|
1948
|
+
*
|
|
1949
|
+
*/
|
|
1950
|
+
load(): void;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
interface ITriggerData {
|
|
1954
|
+
configuration_token?: string;
|
|
1955
|
+
tab_number?: number;
|
|
1956
|
+
elements?: string;
|
|
1957
|
+
form_values?: string;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* Interface for classes that represent a trigger data.
|
|
1961
|
+
* @interface ITriggerData
|
|
1962
|
+
*
|
|
1963
|
+
* @param {string} [configuration_token]
|
|
1964
|
+
* @param {string} [tab_number]
|
|
1965
|
+
* @param {string} [elements]
|
|
1966
|
+
* @param {string} [form_values]
|
|
1967
|
+
* */
|
|
1968
|
+
/**
|
|
1969
|
+
* List of available triggers
|
|
1970
|
+
*
|
|
1971
|
+
* @type {object}
|
|
1972
|
+
* @param {string} SUBMIT_FORM=submit_form
|
|
1973
|
+
* @param {string} CHANGE_TAB=tab
|
|
1974
|
+
* @param {string} HIDE_ELEMENTS=hide_elements
|
|
1975
|
+
* @param {string} SHOW_ELEMENTS=show_elements
|
|
1976
|
+
* @param {string} REFRESH_CHECKOUT=refresh_checkout
|
|
1977
|
+
* @param {string} UPDATE_FORM_VALUES=update_form_values
|
|
1978
|
+
* @param {string} INIT_CHECKOUT=init_checkout
|
|
1979
|
+
*/
|
|
1980
|
+
declare const TRIGGER: {
|
|
1981
|
+
SUBMIT_FORM: string;
|
|
1982
|
+
CHANGE_TAB: string;
|
|
1983
|
+
HIDE_ELEMENTS: string;
|
|
1984
|
+
SHOW_ELEMENTS: string;
|
|
1985
|
+
REFRESH_CHECKOUT: string;
|
|
1986
|
+
UPDATE_FORM_VALUES: string;
|
|
1987
|
+
INIT_CHECKOUT: string;
|
|
1988
|
+
};
|
|
1989
|
+
declare class Trigger {
|
|
1990
|
+
protected iFrame: IFrame;
|
|
1991
|
+
constructor(iFrame: IFrame);
|
|
1992
|
+
push(triggerName: string, data?: ITriggerData): void;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
declare class VaultDisplayIframeEvent extends IFrameEvent {
|
|
1996
|
+
on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* Class VaultDisplayWidget include method for working on html
|
|
2001
|
+
* @constructor
|
|
2002
|
+
*
|
|
2003
|
+
* @example
|
|
2004
|
+
* var widget = new VaultDisplayWidget('#widget', 'token');
|
|
2005
|
+
*
|
|
2006
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
2007
|
+
* @param {string} token - One time token
|
|
2008
|
+
*/
|
|
2009
|
+
declare class VaultDisplayWidget {
|
|
2010
|
+
protected container: Container;
|
|
2011
|
+
protected iFrame: IFrame;
|
|
2012
|
+
protected triggerElement: Trigger;
|
|
2013
|
+
protected event: VaultDisplayIframeEvent;
|
|
2014
|
+
protected validationData: IFormValidation;
|
|
2015
|
+
protected vaultDisplayToken: string;
|
|
2016
|
+
protected link: Link;
|
|
2017
|
+
protected configs: any[];
|
|
2018
|
+
/** @constructs */ constructor(selector: string, token: string);
|
|
2019
|
+
/**
|
|
2020
|
+
* Current method can change environment. By default environment = sandbox.
|
|
2021
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
2022
|
+
*
|
|
2023
|
+
* @example
|
|
2024
|
+
* widget.setEnv('production', 'paydock.com');
|
|
2025
|
+
* @param {string} env - sandbox, production
|
|
2026
|
+
* @param {string} [alias] - Own domain alias
|
|
2027
|
+
*/
|
|
2028
|
+
setEnv(env: string, alias?: string): void;
|
|
2029
|
+
/**
|
|
2030
|
+
* This callback will be called for each event in widget
|
|
2031
|
+
*
|
|
2032
|
+
* @callback listener
|
|
2033
|
+
* @param {IEventData} response
|
|
2034
|
+
*/
|
|
2035
|
+
on(eventName: string): Promise<IEventData$1>;
|
|
2036
|
+
on(eventName: string, cb: (data: IEventData$1) => void): any;
|
|
2037
|
+
/**
|
|
2038
|
+
* Object contain styles for widget
|
|
2039
|
+
*
|
|
2040
|
+
* @example
|
|
2041
|
+
* widget.setStyles({
|
|
2042
|
+
* background_color: '#fff',
|
|
2043
|
+
* border_color: 'yellow',
|
|
2044
|
+
* text_color: '#FFFFAA',
|
|
2045
|
+
* button_color: 'rgba(255, 255, 255, 0.9)',
|
|
2046
|
+
* font_size: '20px',
|
|
2047
|
+
* fort_family: 'fantasy'
|
|
2048
|
+
* });
|
|
2049
|
+
* @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
|
|
2050
|
+
*/
|
|
2051
|
+
setStyles(styles: IStyles$1): void;
|
|
2052
|
+
setStyle(param: string, value: string): void;
|
|
2053
|
+
/**
|
|
2054
|
+
* The final method to beginning, the load process of widget to html
|
|
2055
|
+
*
|
|
2056
|
+
*/
|
|
2057
|
+
load(): void;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
interface IWalletPaymentSuccessful {
|
|
2061
|
+
id: string;
|
|
2062
|
+
amount: number;
|
|
2063
|
+
currency: string;
|
|
2064
|
+
status: string;
|
|
2065
|
+
payer_name?: string;
|
|
2066
|
+
payer_email?: string;
|
|
2067
|
+
payer_phone?: string;
|
|
2068
|
+
}
|
|
2069
|
+
interface IWalletUnavailable {
|
|
2070
|
+
wallet?: WALLET_TYPE;
|
|
2071
|
+
}
|
|
2072
|
+
interface IWalletOnClick {
|
|
2073
|
+
attachResult: (result: Promise<void> | boolean) => void;
|
|
2074
|
+
}
|
|
2075
|
+
interface IWalletUpdate {
|
|
2076
|
+
wallet_response_code?: string;
|
|
2077
|
+
wallet_order_id?: string;
|
|
2078
|
+
wallet_session_id?: string;
|
|
2079
|
+
payment_source?: {
|
|
2080
|
+
wallet_payment_method_id?: string;
|
|
2081
|
+
card_number_last4?: string;
|
|
2082
|
+
card_scheme?: string;
|
|
2083
|
+
};
|
|
2084
|
+
wallet_loyalty_account?: {
|
|
2085
|
+
id?: string;
|
|
2086
|
+
barcode?: string;
|
|
2087
|
+
};
|
|
2088
|
+
shipping?: {
|
|
2089
|
+
address_line1?: string;
|
|
2090
|
+
address_line2?: string;
|
|
2091
|
+
address_postcode?: string;
|
|
2092
|
+
address_city?: string;
|
|
2093
|
+
address_state?: string;
|
|
2094
|
+
address_country?: string;
|
|
2095
|
+
address_company?: string;
|
|
2096
|
+
post_office_box_number?: string;
|
|
2097
|
+
wallet_address_id?: string;
|
|
2098
|
+
wallet_address_name?: string;
|
|
2099
|
+
wallet_address_created_timestamp?: string;
|
|
2100
|
+
wallet_address_updated_timestamp?: string;
|
|
2101
|
+
};
|
|
2102
|
+
selected_shipping_option?: IShippingOption;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
interface IWalletServiceUpdateData {
|
|
2106
|
+
amount: number;
|
|
2107
|
+
shipping_options?: IShippingOption[];
|
|
2108
|
+
}
|
|
2109
|
+
interface IWalletServiceUpdate {
|
|
2110
|
+
success: boolean;
|
|
2111
|
+
body?: IWalletServiceUpdateData;
|
|
2112
|
+
}
|
|
2113
|
+
interface IPaymentMethod {
|
|
2114
|
+
payment_method_id?: string;
|
|
2115
|
+
device?: string;
|
|
2116
|
+
customer: {
|
|
2117
|
+
payer_name: string;
|
|
2118
|
+
payer_email: string;
|
|
2119
|
+
payer_phone: string;
|
|
2120
|
+
payment_source: {
|
|
2121
|
+
wallet_type: WALLET_TYPE;
|
|
2122
|
+
card_name: string;
|
|
2123
|
+
type: string;
|
|
2124
|
+
card_scheme: string;
|
|
2125
|
+
card_number_last4: string;
|
|
2126
|
+
expire_month: number;
|
|
2127
|
+
expire_year: number;
|
|
2128
|
+
address_line1: string;
|
|
2129
|
+
address_line2: string;
|
|
2130
|
+
address_city: string;
|
|
2131
|
+
address_postcode: string;
|
|
2132
|
+
address_state: string;
|
|
2133
|
+
address_country: string;
|
|
2134
|
+
ref_token?: string;
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
shipping?: {
|
|
2138
|
+
method?: string;
|
|
2139
|
+
options?: IShippingOption[];
|
|
2140
|
+
address_line1?: string;
|
|
2141
|
+
address_line2?: string;
|
|
2142
|
+
address_city?: string;
|
|
2143
|
+
address_postcode?: string;
|
|
2144
|
+
address_state?: string;
|
|
2145
|
+
address_country?: string;
|
|
2146
|
+
address_company?: string;
|
|
2147
|
+
address_origin_postcode?: string;
|
|
2148
|
+
contact?: {
|
|
2149
|
+
first_name?: string;
|
|
2150
|
+
last_name?: string;
|
|
2151
|
+
email?: string;
|
|
2152
|
+
phone?: string;
|
|
2153
|
+
phone2?: string;
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
interface IUnavailableWalletEventBody {
|
|
2158
|
+
}
|
|
2159
|
+
interface IPaymentMethodSelectedWalletEventBody {
|
|
2160
|
+
data: IPaymentMethod;
|
|
2161
|
+
onSuccess: () => void;
|
|
2162
|
+
onError: (message?: string) => void;
|
|
2163
|
+
}
|
|
2164
|
+
interface IWalletService {
|
|
2165
|
+
load(container: Container): Promise<void>;
|
|
2166
|
+
close?(): void;
|
|
2167
|
+
update(data: IWalletServiceUpdate): void;
|
|
2168
|
+
enable(): void;
|
|
2169
|
+
disable(): void;
|
|
2170
|
+
setEnv(env: string): any;
|
|
2171
|
+
on(eventName: string, cb?: (data: IUnavailableWalletEventBody | IPaymentMethodSelectedWalletEventBody | any) => void): any;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
interface IEventData {
|
|
2175
|
+
event: string;
|
|
2176
|
+
data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any;
|
|
2177
|
+
}
|
|
2178
|
+
interface IWalletUpdateData {
|
|
2179
|
+
success: boolean;
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
|
|
2183
|
+
* @constructor
|
|
2184
|
+
*
|
|
2185
|
+
* @example
|
|
2186
|
+
* var button = new WalletButtons('#wallet-buttons', 'charge-token', { amount_label: 'Total', country: 'us' });
|
|
2187
|
+
*
|
|
2188
|
+
* @param {string} selector - Selector of html element. Container for the WalletButtons.
|
|
2189
|
+
* @param {string} chargeToken - token for the wallet transaction, created with a secure call to `POST charges/wallet`.
|
|
2190
|
+
* @param {IWalletMeta} meta - data that configures the E-Wallet, which can be shown on checkout page and configures required customer information.
|
|
2191
|
+
*/
|
|
2192
|
+
declare class WalletButtons {
|
|
2193
|
+
protected container: Container;
|
|
2194
|
+
protected api: ApiInternal;
|
|
2195
|
+
protected service: IWalletService;
|
|
2196
|
+
protected eventEmitter: EventEmitter;
|
|
2197
|
+
protected hasUpdateHandler: boolean;
|
|
2198
|
+
/** @constructs */ constructor(selector: string, chargeToken: string, meta: IWalletMeta);
|
|
2199
|
+
/**
|
|
2200
|
+
* Initializes the availability checks and inserts the button if possible.
|
|
2201
|
+
* Otherwise function onUnavailable(handler: VoidFunction) will be called.
|
|
2202
|
+
*
|
|
2203
|
+
* @example
|
|
2204
|
+
* var button = new WalletButtons(
|
|
2205
|
+
* '#buttons',
|
|
2206
|
+
* token,
|
|
2207
|
+
* {
|
|
2208
|
+
* amount_label: 'Total',
|
|
2209
|
+
* country: 'DE',
|
|
2210
|
+
* }
|
|
2211
|
+
* );
|
|
2212
|
+
* button.load();
|
|
2213
|
+
*/
|
|
2214
|
+
load(): void;
|
|
2215
|
+
/**
|
|
2216
|
+
* Triggers the update process of the wallet, if available.
|
|
2217
|
+
* Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
|
|
2218
|
+
*
|
|
2219
|
+
* @example
|
|
2220
|
+
* var button = new WalletButtons(
|
|
2221
|
+
* '#buttons',
|
|
2222
|
+
* token,
|
|
2223
|
+
* {
|
|
2224
|
+
* amount_label: 'Total',
|
|
2225
|
+
* country: 'DE',
|
|
2226
|
+
* }
|
|
2227
|
+
* );
|
|
2228
|
+
* button.on('update', (data) => {
|
|
2229
|
+
* updateChargeAmountInBackend(data);
|
|
2230
|
+
* button.update({ success: true });
|
|
2231
|
+
* });
|
|
2232
|
+
*
|
|
2233
|
+
* @example
|
|
2234
|
+
* // ApplePay via MPGS example:
|
|
2235
|
+
* var button = new WalletButtons(
|
|
2236
|
+
* '#buttons',
|
|
2237
|
+
* token,
|
|
2238
|
+
* {
|
|
2239
|
+
* amount_label: 'Total',
|
|
2240
|
+
* country: 'AU',
|
|
2241
|
+
* ...
|
|
2242
|
+
* }
|
|
2243
|
+
* );
|
|
2244
|
+
* button.on('update', (data) => {
|
|
2245
|
+
* updateChargeAmountInBackend(data);
|
|
2246
|
+
* button.update({
|
|
2247
|
+
* success: true,
|
|
2248
|
+
* body: {
|
|
2249
|
+
* amount: 15,
|
|
2250
|
+
* shipping_options: [
|
|
2251
|
+
* {
|
|
2252
|
+
* id: "NEW-FreeShip",
|
|
2253
|
+
* label: "NEW - Free Shipping",
|
|
2254
|
+
* detail: "Arrives in 3 to 5 days",
|
|
2255
|
+
* amount: "0.00"
|
|
2256
|
+
* },
|
|
2257
|
+
* {
|
|
2258
|
+
* id: "NEW - FastShip",
|
|
2259
|
+
* label: "NEW - Fast Shipping",
|
|
2260
|
+
* detail: "Arrives in less than 1 day",
|
|
2261
|
+
* amount: "10.00"
|
|
2262
|
+
* }
|
|
2263
|
+
* ]
|
|
2264
|
+
* }
|
|
2265
|
+
* });
|
|
2266
|
+
* });
|
|
2267
|
+
*/
|
|
2268
|
+
update(data: IWalletUpdateData): void;
|
|
2269
|
+
/**
|
|
2270
|
+
* Current method can change environment. By default environment = sandbox.
|
|
2271
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
2272
|
+
* Bear in mind that you must set an environment before calling `button.load()`.
|
|
2273
|
+
*
|
|
2274
|
+
* @example
|
|
2275
|
+
* button.setEnv('production', 'paydock.com');
|
|
2276
|
+
* @param {string} env - sandbox, production
|
|
2277
|
+
* @param {string} [alias] - Own domain alias
|
|
2278
|
+
*/
|
|
2279
|
+
setEnv(env: string, alias?: string): void;
|
|
2280
|
+
/**
|
|
2281
|
+
* Current method can enable the payment button. This method is only supported for Flypay V2.
|
|
2282
|
+
*
|
|
2283
|
+
* @example
|
|
2284
|
+
* button.enable();
|
|
2285
|
+
*/
|
|
2286
|
+
enable(): void;
|
|
2287
|
+
/**
|
|
2288
|
+
* Current method can disable the payment button. This method is only supported for Flypay V2.
|
|
2289
|
+
*
|
|
2290
|
+
* @example
|
|
2291
|
+
* button.disable('production', 'paydock.com');
|
|
2292
|
+
*/
|
|
2293
|
+
disable(): void;
|
|
2294
|
+
/**
|
|
2295
|
+
* Closes the checkout forcibly. Currently supported in Flypay wallet.
|
|
2296
|
+
*
|
|
2297
|
+
* @example
|
|
2298
|
+
* button.close();
|
|
2299
|
+
*/
|
|
2300
|
+
close(): void;
|
|
2301
|
+
on(eventName: string): Promise<IEventData>;
|
|
2302
|
+
on(eventName: string, cb: (data: IEventData) => void): any;
|
|
2303
|
+
/**
|
|
2304
|
+
* User to subscribe to the no button available event. This method is used after loading when the button is not available.
|
|
2305
|
+
* For MPGS, since can have more than one wallet button configured (ApplePay/GooglePay) you will receive a body (({ wallet: WALLET_TYPE.GOOGLE }) or ({ wallet: WALLET_TYPE.APPLE })) indicating which button is unavailable
|
|
2306
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
2307
|
+
*
|
|
2308
|
+
* @example
|
|
2309
|
+
* button.onUnavailable(() => {
|
|
2310
|
+
* console.log('No wallet buttons available');
|
|
2311
|
+
* });
|
|
2312
|
+
*
|
|
2313
|
+
* @example
|
|
2314
|
+
* button.onUnavailable().then(() => console.log('No wallet buttons available'));
|
|
2315
|
+
*
|
|
2316
|
+
* @example
|
|
2317
|
+
* button.onUnavailable(function (data) {console.log('data.wallet :: ', data.wallet)});
|
|
2318
|
+
*
|
|
2319
|
+
* @param {listener} [handler] - Function to be called when no button is available.
|
|
2320
|
+
*/
|
|
2321
|
+
onUnavailable(handler?: (data: IEventData) => void): Promise<void> | (() => void);
|
|
2322
|
+
/**
|
|
2323
|
+
* If the wallet performs some update in the checkout process, the function passed as parameter will be called.
|
|
2324
|
+
*
|
|
2325
|
+
* NOTE: make sure to call the `button.update(result)` method on handler completion.
|
|
2326
|
+
*
|
|
2327
|
+
* @example
|
|
2328
|
+
* button.onUpdate((data) => {
|
|
2329
|
+
* button.update({ success: true });
|
|
2330
|
+
* });
|
|
2331
|
+
*
|
|
2332
|
+
* @example
|
|
2333
|
+
* button.onUpdate().then((data) => throw new Error());
|
|
2334
|
+
*
|
|
2335
|
+
* @param {listener} [handler] - Function to be called when the payment was successful.
|
|
2336
|
+
*/
|
|
2337
|
+
onUpdate(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
|
|
2338
|
+
/**
|
|
2339
|
+
* If the payment was successful, the function passed as parameter will be called.
|
|
2340
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
2341
|
+
*
|
|
2342
|
+
* @example
|
|
2343
|
+
* button.onPaymentSuccessful((data) => {
|
|
2344
|
+
* console.log('Payment successful!');
|
|
2345
|
+
* });
|
|
2346
|
+
*
|
|
2347
|
+
* @example
|
|
2348
|
+
* button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
|
|
2349
|
+
*
|
|
2350
|
+
* @param {listener} [handler] - Function to be called when the payment was successful.
|
|
2351
|
+
*/
|
|
2352
|
+
onPaymentSuccessful(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
|
|
2353
|
+
/**
|
|
2354
|
+
* If the payment was left in fraud review, the function passed as parameter will be called.
|
|
2355
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
2356
|
+
*
|
|
2357
|
+
* @example
|
|
2358
|
+
* button.onPaymentInReview((data) => {
|
|
2359
|
+
* console.log('Payment in fraud review');
|
|
2360
|
+
* });
|
|
2361
|
+
*
|
|
2362
|
+
* @example
|
|
2363
|
+
* button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
|
|
2364
|
+
*
|
|
2365
|
+
* @param {listener} [handler] - Function to be called when the payment was left in fraud review status.
|
|
2366
|
+
*/
|
|
2367
|
+
onPaymentInReview(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
|
|
2368
|
+
/**
|
|
2369
|
+
* If the payment was not successful, the function passed as parameter will be called.
|
|
2370
|
+
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
2371
|
+
*
|
|
2372
|
+
* @example
|
|
2373
|
+
* button.onPaymentError((err) => {
|
|
2374
|
+
* console.log('Payment not successful');
|
|
2375
|
+
* });
|
|
2376
|
+
*
|
|
2377
|
+
* @example
|
|
2378
|
+
* button.onPaymentError().then((err) => console.log('Payment not successful'));
|
|
2379
|
+
*
|
|
2380
|
+
* @param {listener} [handler] - Function to be called when the payment was not successful.
|
|
2381
|
+
*/
|
|
2382
|
+
onPaymentError(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
|
|
2383
|
+
/**
|
|
2384
|
+
* Registers a callback function to be invoked when authentication tokens are changed.
|
|
2385
|
+
* This function allows you to respond to changes in authentication tokens, such as when a user logs in.
|
|
2386
|
+
*
|
|
2387
|
+
* @example
|
|
2388
|
+
* button.onAuthTokensChanged((eventData) => {
|
|
2389
|
+
* console.log('Authentication tokens changed:', eventData);
|
|
2390
|
+
* });
|
|
2391
|
+
*
|
|
2392
|
+
* @example
|
|
2393
|
+
* button.onAuthTokensChanged().then((eventData) => {
|
|
2394
|
+
* console.log('Authentication tokens changed:', eventData);
|
|
2395
|
+
* });
|
|
2396
|
+
*
|
|
2397
|
+
* @param {listener} [handler] - Function to be called when authentication tokens are changed.
|
|
2398
|
+
*/
|
|
2399
|
+
onAuthTokensChanged(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
|
|
2400
|
+
/**
|
|
2401
|
+
* Registers a callback function to be invoked when the wallet button gets clicked.
|
|
2402
|
+
* There are two operational modes supported, Synchronous and Asynchronous.
|
|
2403
|
+
* When asynchronous operations need to occur on the callback handler, attaching the Promise via `attachResult` is required to have the wallet wait for a result.
|
|
2404
|
+
* When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
|
|
2405
|
+
* Note this is supported for Paypal, GooglePay and ApplePay wallet buttons at the moment.
|
|
2406
|
+
*
|
|
2407
|
+
* @example
|
|
2408
|
+
* button.onClick((data) => {
|
|
2409
|
+
* performValidationLogic();
|
|
2410
|
+
* });
|
|
2411
|
+
*
|
|
2412
|
+
* @param {listener} handler - Function to be called when the wallet button is clicked.
|
|
2413
|
+
*/
|
|
2414
|
+
onClick(handler: (data: IEventData) => void): () => void;
|
|
2415
|
+
/**
|
|
2416
|
+
* Registers a callback function to be invoked when the wallet checkout opens.
|
|
2417
|
+
* Note this is supported for FlypayV2 wallet button at the moment.
|
|
2418
|
+
*
|
|
2419
|
+
* @example
|
|
2420
|
+
* button.onCheckoutOpen((data) => {
|
|
2421
|
+
* console.log('Checkout opens');
|
|
2422
|
+
* });
|
|
2423
|
+
*
|
|
2424
|
+
* @param {listener} handler - Function to be called when the wallet checkout opens.
|
|
2425
|
+
*/
|
|
2426
|
+
onCheckoutOpen(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
|
|
2427
|
+
/**
|
|
2428
|
+
* Registers a callback function to be invoked when the wallet checkout closes.
|
|
2429
|
+
* Note this is supported for FlypayV2 wallet button at the moment.
|
|
2430
|
+
*
|
|
2431
|
+
* @example
|
|
2432
|
+
* button.onCheckoutClose(() => {
|
|
2433
|
+
* console.log('Wallet checkout closes');
|
|
2434
|
+
* });
|
|
2435
|
+
*
|
|
2436
|
+
* @param {listener} handler - Function to be called when the wallet checkout closes.
|
|
2437
|
+
*/
|
|
2438
|
+
onCheckoutClose(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
|
|
2439
|
+
private setupServiceCallbacks;
|
|
2440
|
+
private setupUnavailableCallback;
|
|
2441
|
+
private setupUpdateCallback;
|
|
2442
|
+
private setupOnClickCallback;
|
|
2443
|
+
private setupOnCheckoutOpenCallback;
|
|
2444
|
+
private setupOnCheckoutCloseCallback;
|
|
2445
|
+
private setupWalletCallback;
|
|
2446
|
+
private setupPaymentCallback;
|
|
2447
|
+
private setupPaymentSuccessCallback;
|
|
2448
|
+
private setupPaymentInReviewCallback;
|
|
2449
|
+
private setupPaymentErrorCallback;
|
|
2450
|
+
private setupAuthTokensChangedCallback;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* Current constant include available type of element for styling
|
|
2455
|
+
* @const STYLABLE_ELEMENT
|
|
2456
|
+
* @type {object}
|
|
2457
|
+
* @param {string} INPUT=input.
|
|
2458
|
+
* These states are available: [STYLABLE_ELEMENT_STATE.ERROR]{@link STYLABLE_ELEMENT_STATE}, [STYLABLE_ELEMENT_STATE.FOCUS]{@link STYLABLE_ELEMENT_STATE}.
|
|
2459
|
+
* These styles are available [IElementStyleInput]{@link IElementStyleInput}
|
|
2460
|
+
* @param {string} SUBMIT_BUTTON=submit_button
|
|
2461
|
+
* These states are available: [STYLABLE_ELEMENT_STATE.HOVER]{@link STYLABLE_ELEMENT_STATE}.
|
|
2462
|
+
* These styles are available [IElementStyleSubmitButton]{@link IElementStyleSubmitButton}
|
|
2463
|
+
* @param {string} LABEL=label.
|
|
2464
|
+
* These styles are available [IElementStyleLabel]{@link IElementStyleLabel}
|
|
2465
|
+
* @param {string} TITLE=title.
|
|
2466
|
+
* These styles are available [IElementStyleTitle]{@link IElementStyleTitle}
|
|
2467
|
+
* @param {string} TITLE_DESCRIPTION=title_description.
|
|
2468
|
+
* These styles are available [IElementStyleTitleDescription]{@link IElementStyleTitleDescription}
|
|
2469
|
+
* */
|
|
2470
|
+
declare const STYLABLE_ELEMENT: {
|
|
2471
|
+
INPUT: string;
|
|
2472
|
+
SUBMIT_BUTTON: string;
|
|
2473
|
+
LABEL: string;
|
|
2474
|
+
TITLE: string;
|
|
2475
|
+
TITLE_DESCRIPTION: string;
|
|
2476
|
+
};
|
|
2477
|
+
/**
|
|
2478
|
+
* Current constant include available states of element for styling
|
|
2479
|
+
* @const STYLABLE_ELEMENT_STATE
|
|
2480
|
+
* @type {object}
|
|
2481
|
+
* @param {string} ERROR=error client|server validation. This state applies to: input
|
|
2482
|
+
* @param {string} FOCUS=focus focus. This state applies to: input
|
|
2483
|
+
* @param {string} HOVER=hover focus. This state applies to: submit_button
|
|
2484
|
+
* */
|
|
2485
|
+
declare const STYLABLE_ELEMENT_STATE: {
|
|
2486
|
+
ERROR: string;
|
|
2487
|
+
FOCUS: string;
|
|
2488
|
+
HOVER: string;
|
|
2489
|
+
};
|
|
2490
|
+
interface IElementStyleInput {
|
|
2491
|
+
color?: string;
|
|
2492
|
+
border?: string;
|
|
2493
|
+
border_radius?: string;
|
|
2494
|
+
background_color?: string;
|
|
2495
|
+
height?: string;
|
|
2496
|
+
text_decoration?: string;
|
|
2497
|
+
font_size?: string;
|
|
2498
|
+
font_family?: string;
|
|
2499
|
+
padding?: string;
|
|
2500
|
+
margin?: string;
|
|
2501
|
+
transition?: string;
|
|
2502
|
+
line_height?: string;
|
|
2503
|
+
font_weight?: string;
|
|
2504
|
+
}
|
|
2505
|
+
interface IElementStyleSubmitButton {
|
|
2506
|
+
color?: string;
|
|
2507
|
+
border?: string;
|
|
2508
|
+
border_radius?: string;
|
|
2509
|
+
background_color?: string;
|
|
2510
|
+
text_decoration?: string;
|
|
2511
|
+
font_size?: string;
|
|
2512
|
+
font_family?: string;
|
|
2513
|
+
padding?: string;
|
|
2514
|
+
margin?: string;
|
|
2515
|
+
transition?: string;
|
|
2516
|
+
line_height?: string;
|
|
2517
|
+
font_weight?: string;
|
|
2518
|
+
opacity?: string;
|
|
2519
|
+
}
|
|
2520
|
+
interface IElementStyleLabel {
|
|
2521
|
+
color?: string;
|
|
2522
|
+
text_decoration?: string;
|
|
2523
|
+
font_size?: string;
|
|
2524
|
+
font_family?: string;
|
|
2525
|
+
line_height?: string;
|
|
2526
|
+
font_weight?: string;
|
|
2527
|
+
padding?: string;
|
|
2528
|
+
margin?: string;
|
|
2529
|
+
}
|
|
2530
|
+
interface IElementStyleTitle {
|
|
2531
|
+
color?: string;
|
|
2532
|
+
text_decoration?: string;
|
|
2533
|
+
font_size?: string;
|
|
2534
|
+
font_family?: string;
|
|
2535
|
+
line_height?: string;
|
|
2536
|
+
font_weight?: string;
|
|
2537
|
+
padding?: string;
|
|
2538
|
+
margin?: string;
|
|
2539
|
+
}
|
|
2540
|
+
interface IElementStyleTitleDescription {
|
|
2541
|
+
color?: string;
|
|
2542
|
+
text_decoration?: string;
|
|
2543
|
+
font_size?: string;
|
|
2544
|
+
font_family?: string;
|
|
2545
|
+
line_height?: string;
|
|
2546
|
+
font_weight?: string;
|
|
2547
|
+
padding?: string;
|
|
2548
|
+
margin?: string;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
/**
|
|
2552
|
+
*
|
|
2553
|
+
* Class MultiWidget include method for for creating iframe url
|
|
2554
|
+
* @constructor
|
|
2555
|
+
*
|
|
2556
|
+
* @param {string} accessToken - PayDock users access token or public key
|
|
2557
|
+
* @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
|
|
2558
|
+
*
|
|
2559
|
+
* @example
|
|
2560
|
+
* var widget = new MultiWidget('accessToken','configurationToken'); // With a pre-created configuration token
|
|
2561
|
+
*
|
|
2562
|
+
* var widget = new MultiWidget('accessToken',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
|
|
2563
|
+
*
|
|
2564
|
+
* var widget = new MultiWidget('accessToken', new Configuration('gatewayId')); With Configuration
|
|
2565
|
+
*
|
|
2566
|
+
* var widget = new MultiWidget('accessToken',[ With Configurations
|
|
2567
|
+
* Configuration('gatewayId'),
|
|
2568
|
+
* Configuration('gatewayId', 'bank_account')
|
|
2569
|
+
* ]);
|
|
2570
|
+
*/
|
|
2571
|
+
declare class MultiWidget {
|
|
2572
|
+
protected link: Link;
|
|
2573
|
+
protected configs: Configuration[];
|
|
2574
|
+
protected configTokens: string[];
|
|
2575
|
+
protected accessToken: string;
|
|
2576
|
+
constructor(accessToken: string, confTokens: string[]);
|
|
2577
|
+
constructor(accessToken: string, confToken: string);
|
|
2578
|
+
constructor(accessToken: string, configs: Configuration[]);
|
|
2579
|
+
constructor(accessToken: string, conf: Configuration);
|
|
2580
|
+
/**
|
|
2581
|
+
* Object contain styles for widget
|
|
2582
|
+
*
|
|
2583
|
+
* @example
|
|
2584
|
+
* widget.setStyles({
|
|
2585
|
+
* background_color: 'rgb(0, 0, 0)',
|
|
2586
|
+
* border_color: 'yellow',
|
|
2587
|
+
* text_color: '#FFFFAA',
|
|
2588
|
+
* button_color: 'rgba(255, 255, 255, 0.9)',
|
|
2589
|
+
* font_size: '20px'
|
|
2590
|
+
* fort_family: 'fantasy'
|
|
2591
|
+
* });
|
|
2592
|
+
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
|
|
2593
|
+
*/
|
|
2594
|
+
setStyles(styles: IStyles$1): void;
|
|
2595
|
+
/**
|
|
2596
|
+
* Method to set a country code mask for the phone input.
|
|
2597
|
+
*
|
|
2598
|
+
* @example
|
|
2599
|
+
* widget.usePhoneCountryMask();
|
|
2600
|
+
*
|
|
2601
|
+
* @example
|
|
2602
|
+
* widget.usePhoneCountryMask({
|
|
2603
|
+
* default_country: 'au',
|
|
2604
|
+
* preferred_countries: ['au', 'gb'],
|
|
2605
|
+
* only_countries: ['au', 'gb', 'us', 'ua']
|
|
2606
|
+
* });
|
|
2607
|
+
*
|
|
2608
|
+
* @param {object} [options] - Options for configure the phone mask.
|
|
2609
|
+
* @param {string} [options.default_country] - Set a default country for the mask.
|
|
2610
|
+
* @param {Array.<string>} [options.preferred_countries] - Set list of preferred countries for the top of the select box .
|
|
2611
|
+
* @param {Array.<string>} [options.only_countries] - Set list of countries to show in the select box.
|
|
2612
|
+
*/
|
|
2613
|
+
usePhoneCountryMask(options?: ICountryPhoneMask): void;
|
|
2614
|
+
setStyle(param: string, value: string): void;
|
|
2615
|
+
/**
|
|
2616
|
+
* Method for set different texts inside the widget
|
|
2617
|
+
*
|
|
2618
|
+
* @example
|
|
2619
|
+
* widget.setTexts({
|
|
2620
|
+
* title: 'Your card',
|
|
2621
|
+
* finish_text: 'Payment resource was successfully accepted',
|
|
2622
|
+
* title_description: '* indicates required field',
|
|
2623
|
+
* submit_button: 'Save',
|
|
2624
|
+
* submit_button_processing: 'Load...',
|
|
2625
|
+
* });
|
|
2626
|
+
*
|
|
2627
|
+
* @param {ITexts} fields - name of text items which can be shown in widget [TEXT]{@link TEXT}
|
|
2628
|
+
*/
|
|
2629
|
+
setTexts(texts: ITexts): void;
|
|
2630
|
+
setText(param: string, value: string): void;
|
|
2631
|
+
setElementStyle(element: string, state: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel): any;
|
|
2632
|
+
setElementStyle(element: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel | IElementStyleTitle | IElementStyleTitleDescription): any;
|
|
2633
|
+
/**
|
|
2634
|
+
* The method to set the predefined values for the form fields inside the widget
|
|
2635
|
+
*
|
|
2636
|
+
* @example
|
|
2637
|
+
* widget.setFormValues({
|
|
2638
|
+
* email: 'predefined@email.com',
|
|
2639
|
+
* card_name: 'Houston'
|
|
2640
|
+
* });
|
|
2641
|
+
*
|
|
2642
|
+
* @param { Object } fieldValues - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
|
|
2643
|
+
*/
|
|
2644
|
+
setFormValues(fieldValues: IFormValues): void;
|
|
2645
|
+
setFormValue(key: string, value: string): void;
|
|
2646
|
+
/**
|
|
2647
|
+
* The method to set custom form field labels
|
|
2648
|
+
*
|
|
2649
|
+
* @example
|
|
2650
|
+
* widget.setFormPlaceholders({
|
|
2651
|
+
* card_name: 'Card Holder Name',
|
|
2652
|
+
* email: 'Email For Receipt'
|
|
2653
|
+
* })
|
|
2654
|
+
*
|
|
2655
|
+
* @param { Object } fieldLabels - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
|
|
2656
|
+
*/
|
|
2657
|
+
setFormLabels(fieldLabels: IFormLabels): void;
|
|
2658
|
+
setFormLabel(key: string, label: string): void;
|
|
2659
|
+
/**
|
|
2660
|
+
* The method to set custom form fields placeholders
|
|
2661
|
+
*
|
|
2662
|
+
* @example
|
|
2663
|
+
* widget.setFormPlaceholders({
|
|
2664
|
+
* card_name: 'Input your card holder name...',
|
|
2665
|
+
* email: 'Input your email, like test@example.com'
|
|
2666
|
+
* })
|
|
2667
|
+
*
|
|
2668
|
+
* @param { Object } fieldPlaceholders - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, Value of object is expected placeholder
|
|
2669
|
+
*/
|
|
2670
|
+
setFormPlaceholders(fieldPlaceholders: IFormPlaceholders): void;
|
|
2671
|
+
setFormPlaceholder(key: string, placeholder: string): void;
|
|
2672
|
+
/**
|
|
2673
|
+
* The method to set the full configuration for the all specific form elements (label, placeholder, value)
|
|
2674
|
+
* You can also use the other method for the partial configuration like: setFormValues, setFormPlaceholder, setFormLabel
|
|
2675
|
+
*
|
|
2676
|
+
* @example
|
|
2677
|
+
* widget.setFormElements([
|
|
2678
|
+
* {
|
|
2679
|
+
* field: 'card_name',
|
|
2680
|
+
* placeholder: 'Input your card holder name...',
|
|
2681
|
+
* label: 'Card Holder Name',
|
|
2682
|
+
* value: 'Houston',
|
|
2683
|
+
* },
|
|
2684
|
+
* {
|
|
2685
|
+
* field: 'email',
|
|
2686
|
+
* placeholder: 'Input your email, like test@example.com',
|
|
2687
|
+
* label: 'Email For Receipt',
|
|
2688
|
+
* value: 'predefined@email.com',
|
|
2689
|
+
* },
|
|
2690
|
+
* ])
|
|
2691
|
+
*
|
|
2692
|
+
* @param { string } elements - The list of elements
|
|
2693
|
+
* @param { string } elements[].field - Field name of the element [FORM_FIELD]{@link FORM_FIELD}
|
|
2694
|
+
* @param { string } elements[].placeholder - Set custom form field placeholder
|
|
2695
|
+
* @param { string } elements[].label - Set custom labels near form field
|
|
2696
|
+
* @param { string } elements[].value - Set predefined values for the form field
|
|
2697
|
+
*/
|
|
2698
|
+
setFormElements(elements: IFormElement[]): void;
|
|
2699
|
+
setFormElement(element: IFormElement): void;
|
|
2700
|
+
/**
|
|
2701
|
+
* The method to change the widget icons
|
|
2702
|
+
*
|
|
2703
|
+
* @deprecated
|
|
2704
|
+
*/
|
|
2705
|
+
setIcons(icons: IIcons): void;
|
|
2706
|
+
setIcon(key: string, value: string): void;
|
|
2707
|
+
/**
|
|
2708
|
+
* Using this method you can set hidden elements inside widget
|
|
2709
|
+
*
|
|
2710
|
+
* @example
|
|
2711
|
+
* widget.setHiddenElements(['submit_button', 'email']);
|
|
2712
|
+
*
|
|
2713
|
+
* @param {string[]} elements - list of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
|
|
2714
|
+
*/
|
|
2715
|
+
setHiddenElements(elements: string[]): void;
|
|
2716
|
+
/**
|
|
2717
|
+
* Current method can set custom ID to identify the data in the future
|
|
2718
|
+
*
|
|
2719
|
+
* @example
|
|
2720
|
+
* widget.setRefId('id');
|
|
2721
|
+
*
|
|
2722
|
+
* @param {string} refId - custom id
|
|
2723
|
+
*/
|
|
2724
|
+
setRefId(refId: string): void;
|
|
2725
|
+
/**
|
|
2726
|
+
* Current method can add visual validation from gateway to widget's form fields
|
|
2727
|
+
*
|
|
2728
|
+
* @example
|
|
2729
|
+
* widget.useGatewayFieldValidation();
|
|
2730
|
+
*/
|
|
2731
|
+
useGatewayFieldValidation(): void;
|
|
2732
|
+
/**
|
|
2733
|
+
* Current method can set icons of supported card types
|
|
2734
|
+
*
|
|
2735
|
+
* @example
|
|
2736
|
+
*
|
|
2737
|
+
* widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
2738
|
+
*
|
|
2739
|
+
* @param {string[]} elements - [SUPPORTED_CARD_TYPES]{@link SUPPORTED_CARD_TYPES}
|
|
2740
|
+
* @param {boolean} validateCardNumberInput - [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types
|
|
2741
|
+
*/
|
|
2742
|
+
setSupportedCardIcons(elements: string[], validateCardNumberInput?: boolean): void;
|
|
2743
|
+
/**
|
|
2744
|
+
* Current method can change environment. By default environment = sandbox.
|
|
2745
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
2746
|
+
*
|
|
2747
|
+
* @example
|
|
2748
|
+
* widget.setEnv('production', 'paydock.com');
|
|
2749
|
+
* @param {string} env - sandbox, production
|
|
2750
|
+
* @param {string} [alias] - Own domain alias
|
|
2751
|
+
*/
|
|
2752
|
+
setEnv(env: string, alias?: string): void;
|
|
2753
|
+
getEnv(): void;
|
|
2754
|
+
/**
|
|
2755
|
+
* Method for creating iframe url
|
|
2756
|
+
*
|
|
2757
|
+
* @example
|
|
2758
|
+
* widget.loadIFrameUrl(function (url) {
|
|
2759
|
+
* console.log(url);
|
|
2760
|
+
* }, function (errors) {
|
|
2761
|
+
* console.log(errors);
|
|
2762
|
+
* });
|
|
2763
|
+
*/
|
|
2764
|
+
loadIFrameUrl(cb: (url: string) => void, errorCb?: (errors: string[]) => void): void;
|
|
2765
|
+
/**
|
|
2766
|
+
* Method for setting a custom language code
|
|
2767
|
+
*
|
|
2768
|
+
* @example
|
|
2769
|
+
* config.setLanguage('en');
|
|
2770
|
+
* @param {string} code - ISO 639-1
|
|
2771
|
+
*/
|
|
2772
|
+
setLanguage(code: any): void;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
interface IEventMetaData extends IEventData$1 {
|
|
2776
|
+
configuration_token: string;
|
|
2777
|
+
type: string;
|
|
2778
|
+
account_name?: string;
|
|
2779
|
+
account_number?: string;
|
|
2780
|
+
card_number_last4?: string;
|
|
2781
|
+
card_number_length?: number;
|
|
2782
|
+
card_scheme?: string;
|
|
2783
|
+
gateway_type?: string;
|
|
2784
|
+
}
|
|
2785
|
+
interface IEventFinishData extends IEventData$1 {
|
|
2786
|
+
payment_source: string;
|
|
2787
|
+
}
|
|
2788
|
+
/**
|
|
2789
|
+
* Interface of data from validation event.
|
|
2790
|
+
*
|
|
2791
|
+
* @interface IFormValidation
|
|
2792
|
+
*
|
|
2793
|
+
* @param {string} event The name of the event.
|
|
2794
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
2795
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
2796
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
2797
|
+
* @param {boolean} [form_valid] Indicates wether or not the form is valid.
|
|
2798
|
+
* @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
|
|
2799
|
+
* @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
|
|
2800
|
+
* @param {Partial<Record<CardValidatorValue | GenericValidatorValue, Array<string>>>} [validators] Object containing validator identifiers as keys and the fields subject to that validator as an array of form field names.
|
|
2801
|
+
* See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
|
|
2802
|
+
*/
|
|
2803
|
+
/**
|
|
2804
|
+
* Contains basic information associated with the event and additional meta data
|
|
2805
|
+
* specific to the event. E.g., card info, gateway info, etc.
|
|
2806
|
+
*
|
|
2807
|
+
* @interface IEventMetaData
|
|
2808
|
+
*
|
|
2809
|
+
* @param {string} event The name of the event.
|
|
2810
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
2811
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
2812
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
2813
|
+
* @param {string} configuration_token Token received from our API with widget data
|
|
2814
|
+
* @param {string} type Payment type 'card', 'bank_account'
|
|
2815
|
+
* @param {string} gateway_type Gateway type
|
|
2816
|
+
* @param {string} [card_number_last4] Last 4 digit of your card
|
|
2817
|
+
* @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
|
|
2818
|
+
* @param {number} [card_number_length] Card number length
|
|
2819
|
+
* @param {string} [account_name] Bank account account name
|
|
2820
|
+
* @param {string} [account_number] Bank account account number
|
|
2821
|
+
* */
|
|
2822
|
+
/**
|
|
2823
|
+
* Interface of data from event.
|
|
2824
|
+
* @interface IEventAfterLoadData
|
|
2825
|
+
*
|
|
2826
|
+
* @param {string} event The name of the event.
|
|
2827
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
2828
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
2829
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
2830
|
+
* */
|
|
2831
|
+
/**
|
|
2832
|
+
* Interface of data from event.
|
|
2833
|
+
* @interface IEventFinishData
|
|
2834
|
+
*
|
|
2835
|
+
* @param {string} event The name of the event.
|
|
2836
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
2837
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
2838
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
2839
|
+
* @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
|
|
2840
|
+
* */
|
|
2841
|
+
/**
|
|
2842
|
+
* List of available event's name
|
|
2843
|
+
* @const EVENT
|
|
2844
|
+
*
|
|
2845
|
+
* @type {object}
|
|
2846
|
+
* @param {string} AFTER_LOAD=afterLoad
|
|
2847
|
+
* @param {string} SUBMIT=submit
|
|
2848
|
+
* @param {string} FINISH=finish
|
|
2849
|
+
* @param {string} VALIDATION=validation
|
|
2850
|
+
* @param {string} VALIDATION_ERROR=validationError
|
|
2851
|
+
* @param {string} SYSTEM_ERROR=systemError
|
|
2852
|
+
* @param {string} META_CHANGE=metaChange
|
|
2853
|
+
* @param {string} RESIZE=resize
|
|
2854
|
+
*/
|
|
2855
|
+
/**
|
|
2856
|
+
* List of available event's name
|
|
2857
|
+
* @const VAULT_DISPLAY_EVENT
|
|
2858
|
+
*
|
|
2859
|
+
* @type {object}
|
|
2860
|
+
* @param {string} AFTER_LOAD=afterLoad
|
|
2861
|
+
* @param {string} SYSTEM_ERROR=system_error
|
|
2862
|
+
* @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
|
|
2863
|
+
* @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
|
|
2864
|
+
* @param {string} ACCESS_FORBIDDEN=access_forbidden
|
|
2865
|
+
* @param {string} SESSION_EXPIRED=systemError
|
|
2866
|
+
* @param {string} SYSTEM_ERROR=session_expired
|
|
2867
|
+
* @param {string} OPERATION_FORBIDDEN=operation_forbidden
|
|
2868
|
+
*/
|
|
2869
|
+
/**
|
|
2870
|
+
* Class HtmlMultiWidget include method for working with html
|
|
2871
|
+
* @constructor
|
|
2872
|
+
* @extends MultiWidget
|
|
2873
|
+
*
|
|
2874
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
2875
|
+
* @param {string} publicKey - PayDock users public key
|
|
2876
|
+
* @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
|
|
2877
|
+
* @example
|
|
2878
|
+
* var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
|
|
2879
|
+
*
|
|
2880
|
+
* var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
|
|
2881
|
+
*
|
|
2882
|
+
* var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
|
|
2883
|
+
*
|
|
2884
|
+
* var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
|
|
2885
|
+
* Configuration(), // default gateway_id,
|
|
2886
|
+
* Configuration('not_configured'), // without gateway,
|
|
2887
|
+
* Configuration('gatewayId'),
|
|
2888
|
+
* Configuration('gatewayId', 'bank_account')
|
|
2889
|
+
* ]);
|
|
2890
|
+
*/
|
|
2891
|
+
declare class HtmlMultiWidget extends MultiWidget {
|
|
2892
|
+
protected container: Container;
|
|
2893
|
+
protected iFrame: IFrame;
|
|
2894
|
+
protected triggerElement: Trigger;
|
|
2895
|
+
protected event: IFrameEvent;
|
|
2896
|
+
protected validationData: IFormValidation;
|
|
2897
|
+
/** @constructs */ constructor(selector: string, publicKey: string, conf: any);
|
|
2898
|
+
/**
|
|
2899
|
+
* Loads the widget.
|
|
2900
|
+
*
|
|
2901
|
+
* Calling this method results in an iframe element being inserted and rendered in the DOM.
|
|
2902
|
+
*/
|
|
2903
|
+
load(): void;
|
|
2904
|
+
/**
|
|
2905
|
+
* Registers a form validation callback for validation events.
|
|
2906
|
+
*/
|
|
2907
|
+
protected afterLoad(): void;
|
|
2908
|
+
/**
|
|
2909
|
+
* Listen to events of widget
|
|
2910
|
+
*
|
|
2911
|
+
* @example
|
|
2912
|
+
*
|
|
2913
|
+
* ```javascript
|
|
2914
|
+
* widget.on('form_submit', function (data) {
|
|
2915
|
+
* console.log(data);
|
|
2916
|
+
* });
|
|
2917
|
+
* ```
|
|
2918
|
+
*
|
|
2919
|
+
* @example
|
|
2920
|
+
*
|
|
2921
|
+
* ```javascript
|
|
2922
|
+
* widget.on('form_submit').then(function (data) {
|
|
2923
|
+
* console.log(data);
|
|
2924
|
+
* });
|
|
2925
|
+
* ```
|
|
2926
|
+
*
|
|
2927
|
+
* @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
|
|
2928
|
+
*
|
|
2929
|
+
* @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
|
|
2930
|
+
* @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
|
|
2931
|
+
*
|
|
2932
|
+
* @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
|
|
2933
|
+
*/
|
|
2934
|
+
on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
|
|
2935
|
+
on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
|
|
2936
|
+
/**
|
|
2937
|
+
* Registers callback that will be invoked for every trigger.
|
|
2938
|
+
*
|
|
2939
|
+
* @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
|
|
2940
|
+
* @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
|
|
2941
|
+
*/
|
|
2942
|
+
trigger(triggerName: string, data?: ITriggerData): void;
|
|
2943
|
+
/**
|
|
2944
|
+
* Gets a reference to the form current validation state.
|
|
2945
|
+
*
|
|
2946
|
+
* !Warning: do not directly modify the values of the returned object.
|
|
2947
|
+
*
|
|
2948
|
+
* @return {IFormValidation} Form validation object
|
|
2949
|
+
*/
|
|
2950
|
+
getValidationState(): IFormValidation;
|
|
2951
|
+
/**
|
|
2952
|
+
* Checks if a given form is valid.
|
|
2953
|
+
*
|
|
2954
|
+
* A form is valid if all form fields are valid.
|
|
2955
|
+
*
|
|
2956
|
+
* @return {boolean} Indicates wether or not form is valid.
|
|
2957
|
+
*/
|
|
2958
|
+
isValidForm(): boolean;
|
|
2959
|
+
/**
|
|
2960
|
+
* Using this method you can check if a specific form field is invalid
|
|
2961
|
+
*
|
|
2962
|
+
* @param {string} field - Field name
|
|
2963
|
+
* @return {boolean} Field is invalid
|
|
2964
|
+
*/
|
|
2965
|
+
isInvalidField(field?: string): boolean;
|
|
2966
|
+
/**
|
|
2967
|
+
* Checks if a given form field is displaying an error.
|
|
2968
|
+
*
|
|
2969
|
+
* @param {string} field - The form field name
|
|
2970
|
+
*
|
|
2971
|
+
* @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
|
|
2972
|
+
*/
|
|
2973
|
+
isFieldErrorShowed(field?: string): boolean;
|
|
2974
|
+
/**
|
|
2975
|
+
* Checks if a given form field is valid or invalid by name.
|
|
2976
|
+
*
|
|
2977
|
+
* @param {string} field - The form field name
|
|
2978
|
+
* @param validator - The name of the validator.
|
|
2979
|
+
*
|
|
2980
|
+
* @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
|
|
2981
|
+
*/
|
|
2982
|
+
isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
|
|
2983
|
+
/**
|
|
2984
|
+
* Hides the widget.
|
|
2985
|
+
*
|
|
2986
|
+
* E.g., use this method to hide the widget after it loads.
|
|
2987
|
+
*
|
|
2988
|
+
* @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
|
|
2989
|
+
*/
|
|
2990
|
+
hide(saveSize: boolean): void;
|
|
2991
|
+
/**
|
|
2992
|
+
* Shows the widget.
|
|
2993
|
+
*
|
|
2994
|
+
* E.g., use this method to show the widget after it was explicitly hidden.
|
|
2995
|
+
*/
|
|
2996
|
+
show(): void;
|
|
2997
|
+
/**
|
|
2998
|
+
* Reloads the widget.
|
|
2999
|
+
*/
|
|
3000
|
+
reload(): void;
|
|
3001
|
+
/**
|
|
3002
|
+
* Hides the specified Widget elements by their identifier.
|
|
3003
|
+
*
|
|
3004
|
+
* @example
|
|
3005
|
+
*
|
|
3006
|
+
* ```javascript
|
|
3007
|
+
* widget.hideElements(['submit_button', 'email']);
|
|
3008
|
+
* ```
|
|
3009
|
+
*
|
|
3010
|
+
* @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
|
|
3011
|
+
*/
|
|
3012
|
+
hideElements(elements: string[]): void;
|
|
3013
|
+
/**
|
|
3014
|
+
* Shows the specified Widget elements by their identifier.
|
|
3015
|
+
*
|
|
3016
|
+
* @example
|
|
3017
|
+
*
|
|
3018
|
+
* ```javascript
|
|
3019
|
+
* widget.showElements(['submit_button', 'email']);
|
|
3020
|
+
* ```
|
|
3021
|
+
*
|
|
3022
|
+
* @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
|
|
3023
|
+
*/
|
|
3024
|
+
showElements(elements: string[]): void;
|
|
3025
|
+
/**
|
|
3026
|
+
* Updates the form field values inside the widget.
|
|
3027
|
+
*
|
|
3028
|
+
* @example
|
|
3029
|
+
*
|
|
3030
|
+
* ```javascript
|
|
3031
|
+
* widget.updateFormValues({
|
|
3032
|
+
* email: 'predefined@email.com',
|
|
3033
|
+
* card_name: 'Houston'
|
|
3034
|
+
* });
|
|
3035
|
+
*```
|
|
3036
|
+
*
|
|
3037
|
+
* @param {IFormValues} fieldValues - Fields with values
|
|
3038
|
+
*/
|
|
3039
|
+
updateFormValues(fieldValues: IFormValues): void;
|
|
3040
|
+
/**
|
|
3041
|
+
* Updates a single form field values inside the widget by the form field name.
|
|
3042
|
+
*
|
|
3043
|
+
* @example
|
|
3044
|
+
*
|
|
3045
|
+
* ```javascript
|
|
3046
|
+
* widget.updateFormValue("card_name", "John Doe");
|
|
3047
|
+
*```
|
|
3048
|
+
*
|
|
3049
|
+
* @param {string} key - The form field name
|
|
3050
|
+
* @param {string} value - The form field value
|
|
3051
|
+
*/
|
|
3052
|
+
updateFormValue(key: string, value: string): void;
|
|
3053
|
+
/**
|
|
3054
|
+
* Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
|
|
3055
|
+
*
|
|
3056
|
+
* @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
|
|
3057
|
+
* @param {string} dataType - The data type of IEventData object.
|
|
3058
|
+
*/
|
|
3059
|
+
onFinishInsert(selector: string, dataType: string): void;
|
|
3060
|
+
/**
|
|
3061
|
+
* Intercepts a form submission and delegates processing to the widget.
|
|
3062
|
+
*
|
|
3063
|
+
* An simplified example of the process:
|
|
3064
|
+
* - User clicks submit button in your form
|
|
3065
|
+
* - This implicitly triggers a submission to the widget
|
|
3066
|
+
* - The widget submits your form
|
|
3067
|
+
*
|
|
3068
|
+
* @note The widget's submit button will be hidden.
|
|
3069
|
+
*
|
|
3070
|
+
* @param {string} selector - css selector of your form
|
|
3071
|
+
*
|
|
3072
|
+
* @example
|
|
3073
|
+
*
|
|
3074
|
+
* ```html
|
|
3075
|
+
* <body>
|
|
3076
|
+
* <form id="myForm">
|
|
3077
|
+
* <input name="amount">
|
|
3078
|
+
* <button type="submit">Submit</button>
|
|
3079
|
+
* </form>
|
|
3080
|
+
* <script>
|
|
3081
|
+
* widget.interceptSubmitForm('#myForm');
|
|
3082
|
+
* </script>
|
|
3083
|
+
* </body>
|
|
3084
|
+
* ```
|
|
3085
|
+
*/
|
|
3086
|
+
interceptSubmitForm(selector: string): void;
|
|
3087
|
+
/**
|
|
3088
|
+
* This method hides a submit button and automatically execute form submit
|
|
3089
|
+
*/
|
|
3090
|
+
useCheckoutAutoSubmit(): void;
|
|
3091
|
+
/**
|
|
3092
|
+
* Use this method for resize iFrame according content height
|
|
3093
|
+
*
|
|
3094
|
+
* @example
|
|
3095
|
+
*
|
|
3096
|
+
* ```javascript
|
|
3097
|
+
* widget.useAutoResize();
|
|
3098
|
+
*```
|
|
3099
|
+
*/
|
|
3100
|
+
useAutoResize(): void;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* Class Widget include method for working on html and include extended by HtmlMultiWidget methods
|
|
3105
|
+
* @constructor
|
|
3106
|
+
* @extends HtmlMultiWidget
|
|
3107
|
+
* @extends MultiWidget
|
|
3108
|
+
*
|
|
3109
|
+
* @example
|
|
3110
|
+
* var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID'); // short
|
|
3111
|
+
*
|
|
3112
|
+
* var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
|
|
3113
|
+
*
|
|
3114
|
+
* var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
|
|
3115
|
+
*
|
|
3116
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
3117
|
+
* @param {string} publicKey - PayDock users public key
|
|
3118
|
+
* @param {string} [gatewayID=default] - ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
|
|
3119
|
+
* @param {string} [paymentType=card] - Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”.
|
|
3120
|
+
* @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
|
|
3121
|
+
*/
|
|
3122
|
+
declare class HtmlWidget extends HtmlMultiWidget {
|
|
3123
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
|
|
3124
|
+
/**
|
|
3125
|
+
* Destination, where customer will receive all successful responses.
|
|
3126
|
+
* Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
3127
|
+
*
|
|
3128
|
+
* @example
|
|
3129
|
+
* widget.setWebHookDestination('http://google.com');
|
|
3130
|
+
*
|
|
3131
|
+
* @param {string} url - Your endpoint for post request.
|
|
3132
|
+
*/
|
|
3133
|
+
setWebHookDestination(url: string): void;
|
|
3134
|
+
/**
|
|
3135
|
+
* URL to which the Customer will be redirected to after the success finish
|
|
3136
|
+
*
|
|
3137
|
+
* @example
|
|
3138
|
+
* widget.setSuccessRedirectUrl('google.com/search?q=success');
|
|
3139
|
+
*
|
|
3140
|
+
* @param {string} url
|
|
3141
|
+
*/
|
|
3142
|
+
setSuccessRedirectUrl(url: string): void;
|
|
3143
|
+
/**
|
|
3144
|
+
* URL to which the Customer will be redirected to if an error is triggered in the process of operation
|
|
3145
|
+
*
|
|
3146
|
+
* @example
|
|
3147
|
+
* widget.setErrorRedirectUrl('google.com/search?q=error');
|
|
3148
|
+
*
|
|
3149
|
+
* @param {string} url
|
|
3150
|
+
*/
|
|
3151
|
+
setErrorRedirectUrl(url: string): void;
|
|
3152
|
+
/**
|
|
3153
|
+
* Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
|
|
3154
|
+
*
|
|
3155
|
+
* @example
|
|
3156
|
+
* widget.setFormFields(['phone', 'email', 'first_name*']);
|
|
3157
|
+
*
|
|
3158
|
+
* @param {string[]} fields - name of fields which can be shown in a widget.
|
|
3159
|
+
* If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
|
|
3160
|
+
*/
|
|
3161
|
+
setFormFields(fields: string[]): void;
|
|
3162
|
+
/**
|
|
3163
|
+
* The method to set the full configuration for the all specific form elements (visibility, required, label, placeholder, value)
|
|
3164
|
+
* You can also use the other method for the partial configuration like: setFormFields, setFormValues, setFormPlaceholder, setFormLabel
|
|
3165
|
+
*
|
|
3166
|
+
* @example
|
|
3167
|
+
* widget.setFormElements([
|
|
3168
|
+
* {
|
|
3169
|
+
* field: 'card_name*',
|
|
3170
|
+
* placeholder: 'Input your card holder name...',
|
|
3171
|
+
* label: 'Card Holder Name',
|
|
3172
|
+
* value: 'Houston',
|
|
3173
|
+
* },
|
|
3174
|
+
* {
|
|
3175
|
+
* field: 'email',
|
|
3176
|
+
* placeholder: 'Input your email, like test@example.com',
|
|
3177
|
+
* label: 'Email for the receipt',
|
|
3178
|
+
* value: 'predefined@email.com',
|
|
3179
|
+
* },
|
|
3180
|
+
* ])
|
|
3181
|
+
*
|
|
3182
|
+
* @param { Object[] } elements - List of elements
|
|
3183
|
+
* @param { string } elements[].field - Field name of element. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
|
|
3184
|
+
* @param { string } elements[].placeholder - Set custom placeholders in form fields
|
|
3185
|
+
* @param { string } elements[].label - Set a custom labels near the form field
|
|
3186
|
+
* @param { string } elements[].value - Set predefined values for the form field
|
|
3187
|
+
*/
|
|
3188
|
+
setFormElements(elements: IFormElement[]): void;
|
|
3189
|
+
setFormElement(element: IFormElement): void;
|
|
3190
|
+
/**
|
|
3191
|
+
* The method to set meta information for the checkout page
|
|
3192
|
+
*
|
|
3193
|
+
* @example
|
|
3194
|
+
* config.setMeta({
|
|
3195
|
+
brand_name: 'paydock',
|
|
3196
|
+
reference: '15',
|
|
3197
|
+
email: 'wault@paydock.com'
|
|
3198
|
+
});
|
|
3199
|
+
*
|
|
3200
|
+
* @param {IPayPalMeta | IBamboraMeta} object - data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IBamboraMeta]{@link IBamboraMeta}
|
|
3201
|
+
*/
|
|
3202
|
+
setMeta(meta: IPayPalMeta | IBamboraMeta): void;
|
|
3203
|
+
setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
export { AfterpayCheckoutButton, Api, CHECKOUT_BUTTON_EVENT, Canvas3ds, ClickToPay, Configuration, ELEMENT, EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, type ICheckout, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, MultiWidget, PAYMENT_TYPE, PURPOSE, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };
|