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