@paydock/client-sdk 1.104.1-beta → 1.106.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/.nvmrc +1 -0
- package/README.md +827 -537
- package/api.d.ts +1 -0
- package/api.js +1 -0
- package/bundles/widget.umd.js +7068 -7120
- package/bundles/widget.umd.min.js +1 -2
- package/canvas3ds.d.ts +1 -0
- package/canvas3ds.js +1 -0
- package/checkout-button.d.ts +1 -0
- package/checkout-button.js +1 -0
- package/inicialization-guide.md +7 -0
- package/{bundles/types → lib}/api/api-base.d.ts +1 -2
- package/lib/api/api-base.js +101 -0
- package/lib/api/api-base.js.map +1 -0
- package/{bundles/types → lib}/api/api-charge-internal.d.ts +0 -1
- package/lib/api/api-charge-internal.js +30 -0
- package/lib/api/api-charge-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api-charge.d.ts +0 -1
- package/lib/api/api-charge.js +49 -0
- package/lib/api/api-charge.js.map +1 -0
- package/{bundles/types → lib}/api/api-internal.d.ts +0 -1
- package/lib/api/api-internal.js +13 -0
- package/lib/api/api-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api-service-internal.d.ts +2 -2
- package/lib/api/api-service-internal.js +19 -0
- package/lib/api/api-service-internal.js.map +1 -0
- package/{bundles/types → lib}/api/api.d.ts +1 -2
- package/lib/api/api.js +62 -0
- package/lib/api/api.js.map +1 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +2 -0
- package/lib/api/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/canvas-3ds.d.ts +1 -2
- package/lib/canvas-3ds/canvas-3ds.js +157 -0
- package/lib/canvas-3ds/canvas-3ds.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/index.d.ts +0 -1
- package/lib/canvas-3ds/index.js +2 -0
- package/lib/canvas-3ds/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/gpayments-service.d.ts +0 -1
- package/lib/canvas-3ds/services/gpayments-service.js +181 -0
- package/lib/canvas-3ds/services/gpayments-service.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/index.d.ts +0 -1
- package/lib/canvas-3ds/services/index.js +2 -0
- package/lib/canvas-3ds/services/index.js.map +1 -0
- package/{bundles/types → lib}/canvas-3ds/services/standalone3ds-service.d.ts +0 -1
- package/lib/canvas-3ds/services/standalone3ds-service.js +32 -0
- package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -2
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js +50 -0
- package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/afterpay/afterpay.runner.d.ts +0 -1
- package/lib/checkout-button/afterpay/afterpay.runner.js +41 -0
- package/lib/checkout-button/afterpay/afterpay.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/checkout-button.d.ts +1 -2
- package/{bundles/types → lib}/checkout-button/checkout-button.interface.d.ts +0 -1
- package/lib/checkout-button/checkout-button.interface.js +45 -0
- package/lib/checkout-button/checkout-button.interface.js.map +1 -0
- package/lib/checkout-button/checkout-button.js +266 -0
- package/lib/checkout-button/checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/checkout-contextual-handler.d.ts +0 -1
- package/lib/checkout-button/checkout-contextual-handler.js +75 -0
- package/lib/checkout-button/checkout-contextual-handler.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/index.d.ts +1 -2
- package/lib/checkout-button/index.js +85 -0
- package/lib/checkout-button/index.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -2
- package/lib/checkout-button/paypal/paypal-checkout-button.js +25 -0
- package/lib/checkout-button/paypal/paypal-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/paypal/paypal.runner.d.ts +0 -1
- package/lib/checkout-button/paypal/paypal.runner.js +14 -0
- package/lib/checkout-button/paypal/paypal.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/base.runner.d.ts +3 -4
- package/lib/checkout-button/runner/base.runner.js +13 -0
- package/lib/checkout-button/runner/base.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/contextual.runner.d.ts +1 -2
- package/lib/checkout-button/runner/contextual.runner.js +40 -0
- package/lib/checkout-button/runner/contextual.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/index.d.ts +0 -1
- package/lib/checkout-button/runner/index.js +11 -0
- package/lib/checkout-button/runner/index.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/popup.runner.d.ts +1 -2
- package/lib/checkout-button/runner/popup.runner.js +68 -0
- package/lib/checkout-button/runner/popup.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/runner/redirect.runner.d.ts +1 -2
- package/lib/checkout-button/runner/redirect.runner.js +15 -0
- package/lib/checkout-button/runner/redirect.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +64 -0
- package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +78 -0
- package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +49 -0
- package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.config.d.ts +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.config.js +4 -0
- package/lib/checkout-button/zipmoney/zipmoney.config.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.runner.d.ts +1 -2
- package/lib/checkout-button/zipmoney/zipmoney.runner.js +23 -0
- package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +1 -0
- package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.types.d.ts +0 -1
- package/lib/checkout-button/zipmoney/zipmoney.types.js +1 -0
- package/lib/checkout-button/zipmoney/zipmoney.types.js.map +1 -0
- package/{bundles/types → lib}/components/ability-guard.d.ts +0 -1
- package/lib/components/ability-guard.js +44 -0
- package/lib/components/ability-guard.js.map +1 -0
- package/{bundles/types → lib}/components/background.d.ts +0 -1
- package/lib/components/background.js +193 -0
- package/lib/components/background.js.map +1 -0
- package/{bundles/types → lib}/components/container.d.ts +1 -1
- package/lib/components/container.js +63 -0
- package/lib/components/container.js.map +1 -0
- package/{bundles/types → lib}/components/dispatcher.d.ts +1 -2
- package/lib/components/dispatcher.js +39 -0
- package/lib/components/dispatcher.js.map +1 -0
- package/{bundles/types → lib}/components/element-style.d.ts +1 -2
- package/lib/components/element-style.js +52 -0
- package/lib/components/element-style.js.map +1 -0
- package/{bundles/types → lib}/components/flypay-iframe-event.d.ts +0 -1
- package/lib/components/flypay-iframe-event.js +28 -0
- package/lib/components/flypay-iframe-event.js.map +1 -0
- package/{bundles/types → lib}/components/form-Interceptor.d.ts +0 -1
- package/lib/components/form-Interceptor.js +38 -0
- package/lib/components/form-Interceptor.js.map +1 -0
- package/{bundles/types → lib}/components/http-core.d.ts +0 -1
- package/lib/components/http-core.js +57 -0
- package/lib/components/http-core.js.map +1 -0
- package/{bundles/types → lib}/components/iframe-event.d.ts +17 -13
- package/lib/components/iframe-event.js +77 -0
- package/lib/components/iframe-event.js.map +1 -0
- package/{bundles/types → lib}/components/iframe.d.ts +0 -1
- package/lib/components/iframe.js +62 -0
- package/lib/components/iframe.js.map +1 -0
- package/{bundles/types → lib}/components/link.d.ts +4 -4
- package/lib/components/link.js +60 -0
- package/lib/components/link.js.map +1 -0
- package/{bundles/types → lib}/components/loader.d.ts +0 -1
- package/lib/components/loader.js +234 -0
- package/lib/components/loader.js.map +1 -0
- package/{bundles/types → lib}/components/param.d.ts +11 -14
- package/lib/components/param.js +147 -0
- package/lib/components/param.js.map +1 -0
- package/{bundles/types → lib}/components/popup.d.ts +0 -1
- package/lib/components/popup.js +104 -0
- package/lib/components/popup.js.map +1 -0
- package/{bundles/types → lib}/components/storage-dispatcher.d.ts +0 -1
- package/lib/components/storage-dispatcher.js +75 -0
- package/lib/components/storage-dispatcher.js.map +1 -0
- package/{bundles/types → lib}/components/trigger.d.ts +0 -1
- package/lib/components/trigger.js +49 -0
- package/lib/components/trigger.js.map +1 -0
- package/{bundles/types → lib}/components/vault-display-iframe-event.d.ts +0 -1
- package/lib/components/vault-display-iframe-event.js +27 -0
- package/lib/components/vault-display-iframe-event.js.map +1 -0
- package/{bundles/types → lib}/components/wallet-background.d.ts +2 -2
- package/lib/components/wallet-background.js +75 -0
- package/lib/components/wallet-background.js.map +1 -0
- package/{bundles/types → lib}/components/wallet-trigger.d.ts +0 -1
- package/lib/components/wallet-trigger.js +27 -0
- package/lib/components/wallet-trigger.js.map +1 -0
- package/{bundles/types/configs/env/environment.paydock.d.ts → lib/configs/env/env.d.ts} +8 -5
- package/lib/configs/env/env.js +117 -0
- package/lib/configs/env/env.js.map +1 -0
- package/{bundles/types → lib}/configs/sdk.d.ts +2 -3
- package/lib/configs/sdk.js +16 -0
- package/lib/configs/sdk.js.map +1 -0
- package/lib/constants/validators.d.ts +44 -0
- package/lib/constants/validators.js +42 -0
- package/lib/constants/validators.js.map +1 -0
- package/{bundles/types → lib}/external-checkout/builder.d.ts +0 -1
- package/lib/external-checkout/builder.js +45 -0
- package/lib/external-checkout/builder.js.map +1 -0
- package/{bundles/types → lib}/external-checkout/checker.d.ts +0 -1
- package/lib/external-checkout/checker.js +22 -0
- package/lib/external-checkout/checker.js.map +1 -0
- package/lib/external-checkout/index.d.ts +2 -0
- package/lib/external-checkout/index.js +3 -0
- package/lib/external-checkout/index.js.map +1 -0
- package/{bundles/types → lib}/helper/access-token.d.ts +0 -1
- package/lib/helper/access-token.js +44 -0
- package/lib/helper/access-token.js.map +1 -0
- package/{bundles/types → lib}/helper/browser.d.ts +0 -1
- package/lib/helper/browser.js +79 -0
- package/lib/helper/browser.js.map +1 -0
- package/{bundles/types → lib}/helper/event-emitter.d.ts +0 -1
- package/lib/helper/event-emitter.js +23 -0
- package/lib/helper/event-emitter.js.map +1 -0
- package/{bundles/types → lib}/helper/event.d.ts +0 -1
- package/lib/helper/event.js +23 -0
- package/lib/helper/event.js.map +1 -0
- package/{bundles/types → lib}/helper/ms.d.ts +0 -1
- package/lib/helper/ms.js +32 -0
- package/lib/helper/ms.js.map +1 -0
- package/{bundles/types → lib}/helper/object.d.ts +0 -1
- package/lib/helper/object.js +6 -0
- package/lib/helper/object.js.map +1 -0
- package/{bundles/types → lib}/helper/url.d.ts +0 -1
- package/lib/helper/url.js +11 -0
- package/lib/helper/url.js.map +1 -0
- package/{bundles/types → lib}/helper/uuid.d.ts +0 -1
- package/lib/helper/uuid.js +26 -0
- package/lib/helper/uuid.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source/builder.d.ts +0 -1
- package/lib/payment-source/builder.js +49 -0
- package/lib/payment-source/builder.js.map +1 -0
- package/{bundles/types → lib}/payment-source/index.d.ts +0 -1
- package/lib/payment-source/index.js +2 -0
- package/lib/payment-source/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/html-payment-source-widget.d.ts +17 -14
- package/lib/payment-source-widget/html-payment-source-widget.js +172 -0
- package/lib/payment-source-widget/html-payment-source-widget.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/index.d.ts +0 -1
- package/lib/payment-source-widget/index.js +35 -0
- package/lib/payment-source-widget/index.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/interfaces.d.ts +0 -1
- package/lib/payment-source-widget/interfaces.js +2 -0
- package/lib/payment-source-widget/interfaces.js.map +1 -0
- package/{bundles/types → lib}/payment-source-widget/payment-source-widget.d.ts +1 -2
- package/lib/payment-source-widget/payment-source-widget.js +142 -0
- package/lib/payment-source-widget/payment-source-widget.js.map +1 -0
- package/lib/secure-remote-commerce/index.d.ts +102 -0
- package/lib/secure-remote-commerce/index.js +103 -0
- package/lib/secure-remote-commerce/index.js.map +1 -0
- package/lib/secure-remote-commerce/interfaces.d.ts +148 -0
- package/lib/secure-remote-commerce/interfaces.js +48 -0
- package/lib/secure-remote-commerce/interfaces.js.map +1 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +30 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +40 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +2 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +1 -0
- package/{bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts → lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts} +4 -8
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +89 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -0
- package/{bundles/types → lib}/secure-remote-commerce/providers/src-provider.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/src-provider.js +1 -0
- package/lib/secure-remote-commerce/providers/src-provider.js.map +1 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +85 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.js +155 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -0
- package/{bundles/types → lib}/vault-display-widget/index.d.ts +0 -1
- package/lib/vault-display-widget/index.js +14 -0
- package/lib/vault-display-widget/index.js.map +1 -0
- package/{bundles/types → lib}/vault-display-widget/vault-display-widget.d.ts +1 -2
- package/lib/vault-display-widget/vault-display-widget.js +99 -0
- package/lib/vault-display-widget/vault-display-widget.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/afterpay.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/afterpay.wallet-service.js +152 -0
- package/lib/wallet-buttons/afterpay.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/apple.wallet-service.d.ts +2 -1
- package/lib/wallet-buttons/apple.wallet-service.js +324 -0
- package/lib/wallet-buttons/apple.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -2
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +163 -0
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/flypay.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/flypay.wallet-service.js +117 -0
- package/lib/wallet-buttons/flypay.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/google.wallet-service.d.ts +3 -1
- package/lib/wallet-buttons/google.wallet-service.js +301 -0
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +3 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js +151 -0
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +1 -0
- package/lib/wallet-buttons/index.d.ts +127 -0
- package/lib/wallet-buttons/index.js +128 -0
- package/lib/wallet-buttons/index.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/interfaces.d.ts +3 -1
- package/lib/wallet-buttons/interfaces.js +1 -0
- package/lib/wallet-buttons/interfaces.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/mastercard.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/mastercard.wallet-service.js +27 -0
- package/lib/wallet-buttons/mastercard.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/paypal.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/paypal.wallet-service.js +144 -0
- package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/stripe.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/stripe.wallet-service.js +100 -0
- package/lib/wallet-buttons/stripe.wallet-service.js.map +1 -0
- package/{bundles/types/wallet-buttons/wallet-cba-buttons.d.ts → lib/wallet-buttons/wallet-buttons.d.ts} +92 -115
- package/lib/wallet-buttons/wallet-buttons.js +479 -0
- package/lib/wallet-buttons/wallet-buttons.js.map +1 -0
- package/{bundles/types → lib}/wallet-buttons/wallet-service.d.ts +7 -1
- package/lib/wallet-buttons/wallet-service.js +60 -0
- package/lib/wallet-buttons/wallet-service.js.map +1 -0
- package/{bundles/types → lib}/widget/configuration.d.ts +2 -3
- package/lib/widget/configuration.js +260 -0
- package/lib/widget/configuration.js.map +1 -0
- package/lib/widget/html-multi-widget.d.ts +336 -0
- package/lib/widget/html-multi-widget.js +422 -0
- package/lib/widget/html-multi-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/html-widget.d.ts +1 -2
- package/lib/widget/html-widget.js +127 -0
- package/lib/widget/html-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/index.d.ts +1 -2
- package/lib/widget/index.js +132 -0
- package/lib/widget/index.js.map +1 -0
- package/{bundles/types → lib}/widget/meta.d.ts +0 -1
- package/lib/widget/meta.js +8 -0
- package/lib/widget/meta.js.map +1 -0
- package/{bundles/types → lib}/widget/multi-widget.d.ts +1 -2
- package/lib/widget/multi-widget.js +437 -0
- package/lib/widget/multi-widget.js.map +1 -0
- package/{bundles/types → lib}/widget/style.d.ts +0 -1
- package/lib/widget/style.js +204 -0
- package/lib/widget/style.js.map +1 -0
- package/package.json +42 -164
- package/payment-source-widget.d.ts +1 -0
- package/payment-source-widget.js +1 -0
- package/slate.md +205 -239
- package/tslint.json +129 -0
- package/typings/globals/jasmine/index.d.ts +576 -0
- package/typings/globals/jasmine-ajax/index.d.ts +83 -0
- package/typings/globals/jquery/index.d.ts +3759 -0
- package/typings/index.d.ts +3 -0
- package/vault-display-widget.d.ts +1 -0
- package/vault-display-widget.js +1 -0
- package/vendors/zipmoney.d.ts +18 -0
- package/vendors/zipmoney.js +1 -0
- package/widget.d.ts +1 -0
- package/widget.js +1 -0
- package/bundles/index.cjs +0 -10674
- package/bundles/index.cjs.d.ts +0 -3163
- package/bundles/index.cjs.map +0 -1
- package/bundles/index.mjs +0 -10642
- package/bundles/index.mjs.d.ts +0 -3163
- package/bundles/index.mjs.map +0 -1
- package/bundles/types/api/api-base.d.ts.map +0 -1
- package/bundles/types/api/api-charge-internal.d.ts.map +0 -1
- package/bundles/types/api/api-charge.d.ts.map +0 -1
- package/bundles/types/api/api-internal.d.ts.map +0 -1
- package/bundles/types/api/api-service-internal.d.ts.map +0 -1
- package/bundles/types/api/api.d.ts.map +0 -1
- package/bundles/types/api/index.d.ts +0 -2
- package/bundles/types/api/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/index.d.ts.map +0 -1
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +0 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +0 -1
- package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +0 -1
- package/bundles/types/checkout-button/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/base.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/index.d.ts +0 -4
- package/bundles/types/checkout-button/zipmoney/index.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +0 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +0 -1
- package/bundles/types/components/ability-guard.d.ts.map +0 -1
- package/bundles/types/components/background.d.ts.map +0 -1
- package/bundles/types/components/container.d.ts.map +0 -1
- package/bundles/types/components/dispatcher.d.ts.map +0 -1
- package/bundles/types/components/element-style.d.ts.map +0 -1
- package/bundles/types/components/flypay-iframe-event.d.ts.map +0 -1
- package/bundles/types/components/form-Interceptor.d.ts.map +0 -1
- package/bundles/types/components/http-core.d.ts.map +0 -1
- package/bundles/types/components/iframe-event.d.ts.map +0 -1
- package/bundles/types/components/iframe.d.ts.map +0 -1
- package/bundles/types/components/link.d.ts.map +0 -1
- package/bundles/types/components/loader.d.ts.map +0 -1
- package/bundles/types/components/param.d.ts.map +0 -1
- package/bundles/types/components/popup.d.ts.map +0 -1
- package/bundles/types/components/storage-dispatcher.d.ts.map +0 -1
- package/bundles/types/components/trigger.d.ts.map +0 -1
- package/bundles/types/components/vault-display-iframe-event.d.ts.map +0 -1
- package/bundles/types/components/wallet-background.d.ts.map +0 -1
- package/bundles/types/components/wallet-trigger.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.cba.d.ts +0 -29
- package/bundles/types/configs/env/environment.cba.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.interface.d.ts +0 -12
- package/bundles/types/configs/env/environment.interface.d.ts.map +0 -1
- package/bundles/types/configs/env/environment.paydock.d.ts.map +0 -1
- package/bundles/types/configs/env/index.d.ts +0 -3
- package/bundles/types/configs/env/index.d.ts.map +0 -1
- package/bundles/types/configs/sdk.d.ts.map +0 -1
- package/bundles/types/external-checkout/builder.d.ts.map +0 -1
- package/bundles/types/external-checkout/checker.d.ts.map +0 -1
- package/bundles/types/external-checkout/index.d.ts +0 -3
- package/bundles/types/external-checkout/index.d.ts.map +0 -1
- package/bundles/types/helper/access-token.d.ts.map +0 -1
- package/bundles/types/helper/browser.d.ts.map +0 -1
- package/bundles/types/helper/event-emitter.d.ts.map +0 -1
- package/bundles/types/helper/event.d.ts.map +0 -1
- package/bundles/types/helper/ms.d.ts.map +0 -1
- package/bundles/types/helper/object.d.ts.map +0 -1
- package/bundles/types/helper/url.d.ts.map +0 -1
- package/bundles/types/helper/uuid.d.ts.map +0 -1
- package/bundles/types/index-cba.d.ts +0 -13
- package/bundles/types/index-cba.d.ts.map +0 -1
- package/bundles/types/index.d.ts +0 -14
- package/bundles/types/index.d.ts.map +0 -1
- package/bundles/types/payment-source/builder.d.ts.map +0 -1
- package/bundles/types/payment-source/index.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/index.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/interfaces.d.ts.map +0 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +0 -2
- package/bundles/types/secure-remote-commerce/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +0 -72
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +0 -164
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +0 -1
- package/bundles/types/vault-display-widget/index.d.ts.map +0 -1
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/index-cba.d.ts +0 -2
- package/bundles/types/wallet-buttons/index-cba.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/index.d.ts +0 -2
- package/bundles/types/wallet-buttons/index.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +0 -366
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/wallet-service.d.ts.map +0 -1
- package/bundles/types/widget/configuration.d.ts.map +0 -1
- package/bundles/types/widget/html-multi-widget.d.ts +0 -266
- package/bundles/types/widget/html-multi-widget.d.ts.map +0 -1
- package/bundles/types/widget/html-widget.d.ts.map +0 -1
- package/bundles/types/widget/index.d.ts.map +0 -1
- package/bundles/types/widget/meta.d.ts.map +0 -1
- package/bundles/types/widget/multi-widget.d.ts.map +0 -1
- package/bundles/types/widget/style.d.ts.map +0 -1
- package/bundles/widget.umd.js.d.ts +0 -3163
- package/bundles/widget.umd.js.map +0 -1
- package/bundles/widget.umd.js.min.d.ts +0 -3163
- package/bundles/widget.umd.min.js.map +0 -1
- package/docs/api-canvas3ds.md +0 -158
- package/docs/api-checkout-button.md +0 -912
- package/docs/api-examples.md +0 -65
- package/docs/api-ps-widget.md +0 -585
- package/docs/api-vault-display.md +0 -94
- package/docs/api-widget.md +0 -2444
- package/docs/api-wrapper.md +0 -78
- package/docs/canvas3ds-examples.md +0 -242
- package/docs/cba-header.md +0 -13
- package/docs/cba-license.md +0 -2
- package/docs/checkout-examples.md +0 -248
- package/docs/header.md +0 -15
- package/docs/html/layout.html +0 -78
- package/docs/html/marked.js +0 -23
- package/docs/html/style.css +0 -365
- package/docs/install/npm.content.md +0 -16
- package/docs/install/npm.example.md +0 -24
- package/docs/install/umd.content.md +0 -21
- package/docs/install/umd.example.md +0 -6
- package/docs/install.md +0 -53
- package/docs/install.readme.t.md +0 -17
- package/docs/install.slate.t.md +0 -17
- package/docs/license.md +0 -2
- package/docs/partials/header.hbs +0 -3
- package/docs/ps-examples.md +0 -129
- package/docs/secure-remote-commerce-examples.md +0 -258
- package/docs/secure-remote-commerce.md +0 -265
- package/docs/vault-display-example.md +0 -132
- package/docs/wallet-buttons-examples.md +0 -580
- package/docs/wallet-buttons.md +0 -424
- package/docs/wallet-cba-buttons-examples.md +0 -388
- package/docs/widget-examples.md +0 -134
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { EventEmitter } from '../helper/event-emitter';
|
|
2
|
+
import { ApiInternal } from '../api/api-internal';
|
|
3
|
+
import { SRCProvider } from './providers/src-provider';
|
|
4
|
+
import { IStyles, IMastercardSRCMeta } from './interfaces';
|
|
5
|
+
declare abstract class SRC {
|
|
6
|
+
protected iframe_selector: string;
|
|
7
|
+
protected service_id: string;
|
|
8
|
+
protected public_key_or_access_token: string;
|
|
9
|
+
protected meta: IMastercardSRCMeta;
|
|
10
|
+
protected eventEmitter: EventEmitter;
|
|
11
|
+
protected env: string;
|
|
12
|
+
protected alias?: string;
|
|
13
|
+
protected api: ApiInternal;
|
|
14
|
+
protected provider: SRCProvider;
|
|
15
|
+
protected autoResize: boolean;
|
|
16
|
+
protected style: IStyles;
|
|
17
|
+
constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
|
|
18
|
+
/**
|
|
19
|
+
* Object contain styles for widget - call before `.load()`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* widget.setStyles({
|
|
23
|
+
* enable_src_popup: true
|
|
24
|
+
* primary_button_color: 'red',
|
|
25
|
+
* secondary_button_color: 'blue',
|
|
26
|
+
* primary_button_text_color: 'white',
|
|
27
|
+
* secondary_button_text_color: 'white',
|
|
28
|
+
* font_family: 'Arial',
|
|
29
|
+
* });
|
|
30
|
+
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
|
|
31
|
+
*/
|
|
32
|
+
setStyles(styles: IStyles): void;
|
|
33
|
+
private setStyle;
|
|
34
|
+
load(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Current method can change environment. By default environment = sandbox.
|
|
37
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* SRC.setEnv('production');
|
|
41
|
+
* @param {string} env - sandbox, production
|
|
42
|
+
* @param {string} [alias] - Own domain alias
|
|
43
|
+
*/
|
|
44
|
+
setEnv(env: string, alias?: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Method to read the current environment
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* SRC.getEnv();
|
|
50
|
+
*/
|
|
51
|
+
getEnv(): string;
|
|
52
|
+
on(eventName: string): Promise<any>;
|
|
53
|
+
on(eventName: string, cb: (data: any) => void): any;
|
|
54
|
+
/**
|
|
55
|
+
* Using this method you can hide checkout after load and button click
|
|
56
|
+
* @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* SRC.hideCheckout();
|
|
60
|
+
*/
|
|
61
|
+
hideCheckout(saveSize: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* Using this method you can show checkout after using hideCheckout method
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* SRC.showCheckout()
|
|
67
|
+
*/
|
|
68
|
+
showCheckout(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Using this method you can reload the whole checkout
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* SRC.reload()
|
|
74
|
+
*/
|
|
75
|
+
reload(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Use this method for resize checkout iFrame according to content height, if applicable
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* SRC.useAutoResize();
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
useAutoResize(): void;
|
|
84
|
+
}
|
|
85
|
+
export { SRC };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { API_AUTH_TYPE } from '../api/api-base';
|
|
2
|
+
import { CARD_SCHEME_SERVICE } from '../api/api-service-internal';
|
|
3
|
+
import { EventEmitter } from '../helper/event-emitter';
|
|
4
|
+
import { MastercardSRC } from './providers/mastercard-src';
|
|
5
|
+
import { ApiInternal } from '../api/api-internal';
|
|
6
|
+
import { STYLE } from './interfaces';
|
|
7
|
+
import { ObjectHelper } from '../helper/object';
|
|
8
|
+
class SRC {
|
|
9
|
+
constructor(iframe_selector, service_id, public_key_or_access_token, meta) {
|
|
10
|
+
this.iframe_selector = iframe_selector;
|
|
11
|
+
this.service_id = service_id;
|
|
12
|
+
this.public_key_or_access_token = public_key_or_access_token;
|
|
13
|
+
this.meta = meta;
|
|
14
|
+
this.autoResize = false;
|
|
15
|
+
this.style = {};
|
|
16
|
+
this.api = new ApiInternal(public_key_or_access_token, API_AUTH_TYPE.PUBLIC_KEY);
|
|
17
|
+
this.eventEmitter = new EventEmitter();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Object contain styles for widget - call before `.load()`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* widget.setStyles({
|
|
24
|
+
* enable_src_popup: true
|
|
25
|
+
* primary_button_color: 'red',
|
|
26
|
+
* secondary_button_color: 'blue',
|
|
27
|
+
* primary_button_text_color: 'white',
|
|
28
|
+
* secondary_button_text_color: 'white',
|
|
29
|
+
* font_family: 'Arial',
|
|
30
|
+
* });
|
|
31
|
+
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
|
|
32
|
+
*/
|
|
33
|
+
setStyles(styles) {
|
|
34
|
+
for (let index in styles) {
|
|
35
|
+
if (styles.hasOwnProperty(index))
|
|
36
|
+
this.setStyle(index, styles[index]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setStyle(param, value) {
|
|
40
|
+
if (ObjectHelper.values(STYLE).indexOf(param) !== -1)
|
|
41
|
+
this.style[param] = value;
|
|
42
|
+
else
|
|
43
|
+
console.warn(`Widget::setStyle[s: unsupported style param ${param}`);
|
|
44
|
+
}
|
|
45
|
+
load() {
|
|
46
|
+
if (this.provider)
|
|
47
|
+
return;
|
|
48
|
+
this.api.service().getConfig(this.service_id).then(({ type }) => {
|
|
49
|
+
this.meta.customizations = this.style; // assign the style on the start of the widget
|
|
50
|
+
switch (type) {
|
|
51
|
+
case CARD_SCHEME_SERVICE.MASTERCARD_SRC:
|
|
52
|
+
this.provider = new MastercardSRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
;
|
|
56
|
+
if (this.provider)
|
|
57
|
+
this.provider.load();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Current method can change environment. By default environment = sandbox.
|
|
62
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* SRC.setEnv('production');
|
|
66
|
+
* @param {string} env - sandbox, production
|
|
67
|
+
* @param {string} [alias] - Own domain alias
|
|
68
|
+
*/
|
|
69
|
+
setEnv(env, alias) {
|
|
70
|
+
if (this.provider)
|
|
71
|
+
return;
|
|
72
|
+
this.env = env;
|
|
73
|
+
this.alias = alias;
|
|
74
|
+
this.api.setEnv(env, alias);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Method to read the current environment
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* SRC.getEnv();
|
|
81
|
+
*/
|
|
82
|
+
getEnv() {
|
|
83
|
+
if (this.provider)
|
|
84
|
+
return this.provider.getEnv();
|
|
85
|
+
else
|
|
86
|
+
return this.env;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Listen to events of SRC
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
*
|
|
93
|
+
* SRC.on('checkoutCompleted', function (token) {
|
|
94
|
+
* console.log(token);
|
|
95
|
+
* });
|
|
96
|
+
* // or
|
|
97
|
+
* SRC.on('checkoutCompleted').then(function (token) {
|
|
98
|
+
* console.log(token);
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* @param {string} eventName - Available event names [EVENT]{@link EVENT}
|
|
102
|
+
* @param {listener} [cb] - The callback to handle the event. When available, it will send back data of type [EventData]{@link EventData}
|
|
103
|
+
* @return {Promise<any> | void}
|
|
104
|
+
*/
|
|
105
|
+
on(eventName, cb) {
|
|
106
|
+
if (typeof cb === "function")
|
|
107
|
+
return this.eventEmitter.subscribe(eventName, cb);
|
|
108
|
+
return new Promise((resolve) => this.eventEmitter.subscribe(eventName, (res) => resolve(res)));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Using this method you can hide checkout after load and button click
|
|
112
|
+
* @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* SRC.hideCheckout();
|
|
116
|
+
*/
|
|
117
|
+
hideCheckout(saveSize) {
|
|
118
|
+
if (this.provider && typeof this.provider.hideCheckout === 'function')
|
|
119
|
+
this.provider.hideCheckout(saveSize);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Using this method you can show checkout after using hideCheckout method
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* SRC.showCheckout()
|
|
126
|
+
*/
|
|
127
|
+
showCheckout() {
|
|
128
|
+
if (this.provider && typeof this.provider.showCheckout === 'function')
|
|
129
|
+
this.provider.showCheckout();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Using this method you can reload the whole checkout
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* SRC.reload()
|
|
136
|
+
*/
|
|
137
|
+
reload() {
|
|
138
|
+
if (this.provider)
|
|
139
|
+
this.provider.reload();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Use this method for resize checkout iFrame according to content height, if applicable
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* SRC.useAutoResize();
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
useAutoResize() {
|
|
149
|
+
this.autoResize = true;
|
|
150
|
+
if (this.provider && typeof this.provider.useAutoResize === 'function')
|
|
151
|
+
this.provider.useAutoResize();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export { SRC };
|
|
155
|
+
//# sourceMappingURL=../../src/lib/secure-remote-commerce/secure-remote-commerce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-remote-commerce.js","sourceRoot":"","sources":["../../secure-remote-commerce/secure-remote-commerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAW,KAAK,EAAiC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAe,GAAG;IAYd,YAAsB,eAAuB,EAAY,UAAkB,EAAY,0BAAkC,EAAY,IAAwB;QAAvI,oBAAe,GAAf,eAAe,CAAQ;QAAY,eAAU,GAAV,UAAU,CAAQ;QAAY,+BAA0B,GAA1B,0BAA0B,CAAQ;QAAY,SAAI,GAAJ,IAAI,CAAoB;QAHnJ,eAAU,GAAG,KAAK,CAAC;QACnB,UAAK,GAAY,EAAa,CAAC;QAGrC,IAAI,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,0BAA0B,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IAC3C,CAAC;IAEA;;;;;;;;;;;;;MAaE;IACI,SAAS,CAAC,MAAe;QAC5B,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE;YACtB,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC;gBAC5B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C;IACL,CAAC;IAEO,QAAQ,CAAC,KAAa,EAA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E,CAAC;IACtC,CAAC;CACJ;AAED,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { VaultDisplayWidget } from '../vault-display-widget/vault-display-widget';
|
|
2
|
+
/**
|
|
3
|
+
* List of available style params for vault display widget
|
|
4
|
+
*
|
|
5
|
+
* @const VAULT_DISPLAY_STYLE
|
|
6
|
+
* @type {object}
|
|
7
|
+
* @param {string} BACKGROUND_COLOR=background_color
|
|
8
|
+
* @param {string} TEXT_COLOR=text_color
|
|
9
|
+
* @param {string} BORDER_COLOR=border_color
|
|
10
|
+
* @param {string} BUTTON_COLOR=button_color
|
|
11
|
+
* @param {string} FONT_SIZE=font_size
|
|
12
|
+
* @param {string} FONT_FAMILY=font_family
|
|
13
|
+
*/
|
|
14
|
+
//# sourceMappingURL=../../src/lib/vault-display-widget/index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../vault-display-widget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF;;;;;;;;;;;GAWG"}
|
|
@@ -24,7 +24,7 @@ declare class VaultDisplayWidget {
|
|
|
24
24
|
protected vaultDisplayToken: string;
|
|
25
25
|
protected link: Link;
|
|
26
26
|
protected configs: any[];
|
|
27
|
-
constructor(selector: string, token: string);
|
|
27
|
+
/** @constructs */ constructor(selector: string, token: string);
|
|
28
28
|
/**
|
|
29
29
|
* Current method can change environment. By default environment = sandbox.
|
|
30
30
|
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
@@ -66,4 +66,3 @@ declare class VaultDisplayWidget {
|
|
|
66
66
|
load(): void;
|
|
67
67
|
}
|
|
68
68
|
export { VaultDisplayWidget };
|
|
69
|
-
//# sourceMappingURL=vault-display-widget.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Container } from '../components/container';
|
|
2
|
+
import { IFrame } from '../components/iframe';
|
|
3
|
+
import { Trigger } from '../components/trigger';
|
|
4
|
+
import { STYLE } from '../components/param';
|
|
5
|
+
import { Link, VAULT_DISPLAY_WIDGET_LINK } from '../components/link';
|
|
6
|
+
import { ObjectHelper } from '../helper/object';
|
|
7
|
+
import { VaultDisplayIframeEvent } from '../components/vault-display-iframe-event';
|
|
8
|
+
/**
|
|
9
|
+
* Class VaultDisplayWidget include method for working on html
|
|
10
|
+
* @constructor
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* var widget = new VaultDisplayWidget('#widget', 'token');
|
|
14
|
+
*
|
|
15
|
+
* @param {string} selector - Selector of html element. Container for widget
|
|
16
|
+
* @param {string} token - One time token
|
|
17
|
+
*/
|
|
18
|
+
class VaultDisplayWidget {
|
|
19
|
+
/** @constructs */ // constructs added for correct parse classes jsdoc2md
|
|
20
|
+
constructor(selector, token) {
|
|
21
|
+
this.validationData = {};
|
|
22
|
+
this.configs = [];
|
|
23
|
+
this.container = new Container(selector);
|
|
24
|
+
this.iFrame = new IFrame(this.container);
|
|
25
|
+
this.triggerElement = new Trigger(this.iFrame);
|
|
26
|
+
this.event = new VaultDisplayIframeEvent(window);
|
|
27
|
+
this.vaultDisplayToken = token;
|
|
28
|
+
this.link = new Link(VAULT_DISPLAY_WIDGET_LINK);
|
|
29
|
+
this.link.setParams({ vault_display_token: token });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Current method can change environment. By default environment = sandbox.
|
|
33
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* widget.setEnv('production', 'paydock.com');
|
|
37
|
+
* @param {string} env - sandbox, production
|
|
38
|
+
* @param {string} [alias] - Own domain alias
|
|
39
|
+
*/
|
|
40
|
+
setEnv(env, alias) {
|
|
41
|
+
this.link.setEnv(env, alias);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Listen to events of widget
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
*
|
|
48
|
+
* widget.on('after_load', function (data) {
|
|
49
|
+
* console.log(data);
|
|
50
|
+
* });
|
|
51
|
+
* // or
|
|
52
|
+
* widget.on('after_load').then(function (data) {
|
|
53
|
+
* console.log(data);
|
|
54
|
+
* });
|
|
55
|
+
* @param {string} eventName - Available event names [VAULT_DISPLAY_EVENT]{@link VAULT_DISPLAY_EVENT}
|
|
56
|
+
* @param {listener} [cb]
|
|
57
|
+
* @return {Promise<IEventData | void>}
|
|
58
|
+
*/
|
|
59
|
+
on(eventName, cb) {
|
|
60
|
+
if (typeof cb === "function")
|
|
61
|
+
return this.event.on(eventName, this.link.getParams().widget_id, cb);
|
|
62
|
+
return new Promise((resolve) => this.event.on(eventName, this.link.getParams().widget_id, (res) => resolve(res)));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Object contain styles for widget
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* widget.setStyles({
|
|
69
|
+
* background_color: '#fff',
|
|
70
|
+
* border_color: 'yellow',
|
|
71
|
+
* text_color: '#FFFFAA',
|
|
72
|
+
* button_color: 'rgba(255, 255, 255, 0.9)',
|
|
73
|
+
* font_size: '20px',
|
|
74
|
+
* fort_family: 'fantasy'
|
|
75
|
+
* });
|
|
76
|
+
* @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
|
|
77
|
+
*/
|
|
78
|
+
setStyles(styles) {
|
|
79
|
+
for (let index in styles) {
|
|
80
|
+
if (styles.hasOwnProperty(index))
|
|
81
|
+
this.setStyle(index, styles[index]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
setStyle(param, value) {
|
|
85
|
+
if (ObjectHelper.values(STYLE).indexOf(param) !== -1)
|
|
86
|
+
this.link.setParams({ [param]: value });
|
|
87
|
+
else
|
|
88
|
+
console.warn(`Widget::setStyle[s: unsupported style param ${param}`);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The final method to beginning, the load process of widget to html
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
load() {
|
|
95
|
+
this.iFrame.load(this.link.getUrl(), { title: 'Vault Display' });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export { VaultDisplayWidget };
|
|
99
|
+
//# sourceMappingURL=../../src/lib/vault-display-widget/vault-display-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-display-widget.js","sourceRoot":"","sources":["../../vault-display-widget/vault-display-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAA4B,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,kBAAkB;IAUpB,kBAAkB,CAAC,sDAAsD;IACzE,YAAY,QAAgB,EAAE,KAAa;QANjC,mBAAc,GAAoB,EAAE,CAAC;QAGrC,YAAO,GAAG,EAAE,CAAC;QAInB,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACjD,I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AS,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;;YAExC,OAAO,CAAC,IAAI,CAAC,+CAA+C,KAAK,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;OAGG;IACI,IAAI;QACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAC,KAAK,EAAE,eAAe,EAAC,CAAC,CAAC;IACnE,CAAC;CACJ;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { WalletService, WALLET_EVENT } from './wallet-service';
|
|
2
|
+
import { WALLET_TYPE } from '../components/param';
|
|
3
|
+
import { StorageDataIntent, StorageDispatcher } from '../components/storage-dispatcher';
|
|
4
|
+
export class AfterPayWalletService extends WalletService {
|
|
5
|
+
constructor(token, meta) {
|
|
6
|
+
super(token, meta);
|
|
7
|
+
this.token = token;
|
|
8
|
+
this.storageDispatcher = new StorageDispatcher('afterpay.wallet.paydock');
|
|
9
|
+
}
|
|
10
|
+
load(container) {
|
|
11
|
+
this.storageDispatcher.create(() => this.mount(container));
|
|
12
|
+
}
|
|
13
|
+
setEnv(env) {
|
|
14
|
+
super.setEnv(env);
|
|
15
|
+
this.storageDispatcher.setEnv(env);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
mount(container) {
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
|
+
let customStyles = {};
|
|
21
|
+
if (((_a = this.meta) === null || _a === void 0 ? void 0 : _a.style) && typeof ((_b = this.meta) === null || _b === void 0 ? void 0 : _b.style) === 'object')
|
|
22
|
+
customStyles = JSON.parse(JSON.stringify(((_c = this.meta) === null || _c === void 0 ? void 0 : _c.style['afterpay']) || ((_d = this.meta) === null || _d === void 0 ? void 0 : _d.style)));
|
|
23
|
+
const afterpayButton = this.getButton(customStyles);
|
|
24
|
+
afterpayButton.onclick = () => this.onAfterPayButtonClicked();
|
|
25
|
+
const buttonWalletStyle = this.getButtonStyle(customStyles);
|
|
26
|
+
container.getElement().appendChild(afterpayButton);
|
|
27
|
+
container.getElement().appendChild(buttonWalletStyle);
|
|
28
|
+
}
|
|
29
|
+
onAfterPayButtonClicked() {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const afterpayJS = document.createElement('script');
|
|
32
|
+
const countryCode = (_a = this.meta) === null || _a === void 0 ? void 0 : _a.country;
|
|
33
|
+
afterpayJS.type = 'text/javascript';
|
|
34
|
+
afterpayJS.src =
|
|
35
|
+
((_b = this.meta) === null || _b === void 0 ? void 0 : _b.gateway_mode) === 'live'
|
|
36
|
+
? 'https://portal.afterpay.com/afterpay.js'
|
|
37
|
+
: 'https://portal.sandbox.afterpay.com/afterpay.js';
|
|
38
|
+
afterpayJS.async = true;
|
|
39
|
+
afterpayJS.defer = true;
|
|
40
|
+
afterpayJS.onload = () => {
|
|
41
|
+
window.AfterPay.initialize({ countryCode });
|
|
42
|
+
this.storageDispatcher.push({ intent: StorageDataIntent.WIDGET_SESSION, data: { token: this.token } }, {
|
|
43
|
+
onSuccess: () => {
|
|
44
|
+
this.getCheckoutSession()
|
|
45
|
+
.then((response) => {
|
|
46
|
+
window.AfterPay.redirect({
|
|
47
|
+
token: response.ref_token,
|
|
48
|
+
});
|
|
49
|
+
})
|
|
50
|
+
.catch((err) => {
|
|
51
|
+
window.AfterPay.close();
|
|
52
|
+
this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, {
|
|
53
|
+
err,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onError: () => {
|
|
58
|
+
console.error('Error initializing Afterpay wallet');
|
|
59
|
+
window.AfterPay.close();
|
|
60
|
+
this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, {});
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
document.head.appendChild(afterpayJS);
|
|
65
|
+
}
|
|
66
|
+
getCheckoutSession() {
|
|
67
|
+
return new Promise((resolve, reject) => this.eventEmitter.emit(WALLET_EVENT.CALLBACK, {
|
|
68
|
+
data: {
|
|
69
|
+
request_type: 'CREATE_SESSION',
|
|
70
|
+
wallet_type: WALLET_TYPE.AFTERPAY,
|
|
71
|
+
},
|
|
72
|
+
onSuccess: (res) => {
|
|
73
|
+
resolve(res);
|
|
74
|
+
},
|
|
75
|
+
onError: (message) => {
|
|
76
|
+
reject(message);
|
|
77
|
+
},
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
getButton(customStyles) {
|
|
81
|
+
const afterpayButton = document.createElement('button');
|
|
82
|
+
afterpayButton.classList.add("afterpay-checkout-btn");
|
|
83
|
+
afterpayButton.setAttribute('type', 'button');
|
|
84
|
+
afterpayButton.innerHTML = `
|
|
85
|
+
<div class="afterpay-checkout-btn__wrapper">
|
|
86
|
+
<svg viewBox="0 0 390 94"
|
|
87
|
+
height="${this.getHeight(customStyles)}"
|
|
88
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
89
|
+
<g fill="currentColor">
|
|
90
|
+
<path
|
|
91
|
+
d="M388.6 21.4l-34.8 71.8h-14.4l13-26.8-20.5-45h14.8l13.2 30.1 14.3-30.1zM41 46.9c0-8.6-6.2-14.6-13.9-14.6s-13.9 6.1-13.9 14.6c0 8.4 6.2 14.6 13.9 14.6 7.6 0 13.9-6.1 13.9-14.6m.1 25.5v-6.6c-3.8 4.6-9.4 7.4-16.1 7.4C11 73.2.4 62 .4 46.9c0-15 11-26.4 24.9-26.4 6.5 0 12 2.9 15.8 7.3v-6.4h12.5v51H41.1zM114.6 61.1c-4.4 0-5.6-1.6-5.6-5.9V32.5h8.1V21.4H109V8.9H96.1v12.4H79.5v-5.1c0-4.3 1.6-5.9 6.1-5.9h2.8V.4h-6.2C71.6.4 66.6 3.9 66.6 14.5v6.8h-7.1v11.1h7.1v39.9h12.9V32.5h16.6v25c0 10.4 4 14.9 14.4 14.9h6.6V61.1h-2.5zM160.7 42.3c-.9-6.6-6.3-10.6-12.6-10.6s-11.5 3.9-12.9 10.6h25.5zm-25.6 7.9c.9 7.5 6.3 11.8 13.2 11.8 5.4 0 9.6-2.6 12-6.6h13.2c-3.1 10.8-12.7 17.7-25.5 17.7-15.4 0-26.2-10.8-26.2-26.2 0-15.4 11.4-26.5 26.5-26.5 15.2 0 26.2 11.2 26.2 26.5 0 1.1-.1 2.2-.3 3.3h-39.1zM256.2 46.9c0-8.3-6.2-14.6-13.9-14.6s-13.9 6.1-13.9 14.6c0 8.4 6.2 14.6 13.9 14.6 7.6 0 13.9-6.4 13.9-14.6m-40.4 46.3V21.4h12.5V28c3.8-4.7 9.4-7.5 16.1-7.5 13.8 0 24.6 11.3 24.6 26.3s-11 26.4-24.9 26.4c-6.4 0-11.7-2.6-15.4-6.8v26.8h-12.9zM314.2 46.9c0-8.6-6.2-14.6-13.9-14.6-7.6 0-13.9 6.1-13.9 14.6 0 8.4 6.2 14.6 13.9 14.6s13.9-6.1 13.9-14.6m.1 25.5v-6.6c-3.8 4.6-9.4 7.4-16.1 7.4-14 0-24.6-11.2-24.6-26.3 0-15 11-26.4 24.9-26.4 6.5 0 12 2.9 15.8 7.3v-6.4h12.5v51h-12.5zM193.2 26.4s3.2-5.9 11-5.9c3.3 0 5.5 1.2 5.5 1.2v13s-4.7-2.9-9.1-2.3c-4.3.6-7.1 4.6-7.1 9.9v30.2h-13v-51H193v4.9h.2z" />
|
|
92
|
+
</g>
|
|
93
|
+
</svg>
|
|
94
|
+
<svg viewBox="0 0 107 96"
|
|
95
|
+
height="${this.getHeight(customStyles)}"
|
|
96
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
97
|
+
<path
|
|
98
|
+
d="M99 19.5L84.2 11l-15-8.6c-10-5.7-22.4 1.5-22.4 13v1.9c0 1.1.6 2 1.5 2.6l7 4c1.9 1.1 4.4-.3 4.4-2.5v-4.6c0-2.3 2.5-3.7 4.4-2.6l13.8 7.9L91.6 30c2 1.1 2 4 0 5.1L77.9 43l-13.8 7.9c-2 1.1-4.4-.3-4.4-2.6V46c0-11.5-12.4-18.7-22.4-13l-15 8.6-14.8 8.5c-10 5.7-10 20.2 0 26l14.8 8.5 15 8.6c10 5.7 22.4-1.5 22.4-13v-1.9c0-1.1-.6-2-1.5-2.6l-7-4c-1.9-1.1-4.4.3-4.4 2.5v4.6c0 2.3-2.5 3.7-4.4 2.6l-13.8-7.9-13.7-7.9c-2-1.1-2-4 0-5.1l13.7-7.9 13.8-7.9c2-1.1 4.4.3 4.4 2.6v2.3c0 11.5 12.4 18.7 22.4 13l15-8.6L99 45.5c10.1-5.8 10.1-20.2 0-26"
|
|
99
|
+
fill="currentColor" />
|
|
100
|
+
</svg>
|
|
101
|
+
</div>
|
|
102
|
+
`;
|
|
103
|
+
return afterpayButton;
|
|
104
|
+
}
|
|
105
|
+
getButtonStyle(customStyles) {
|
|
106
|
+
const styleSheet = document.createElement('style');
|
|
107
|
+
const buttonColor = this.generateButtonColor(customStyles.button_type);
|
|
108
|
+
styleSheet.innerText = `
|
|
109
|
+
.afterpay-checkout-btn {
|
|
110
|
+
outline: none;
|
|
111
|
+
border: none;
|
|
112
|
+
border-radius: ${this.getHeight(customStyles)};
|
|
113
|
+
padding: 0;
|
|
114
|
+
margin: 0;
|
|
115
|
+
transition: all 300ms;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.afterpay-checkout-btn:active {
|
|
120
|
+
opacity: 0.7;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.afterpay-checkout-btn__wrapper {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
padding: 10px 20px;
|
|
127
|
+
color: ${buttonColor.color};
|
|
128
|
+
background-color: ${buttonColor.background};
|
|
129
|
+
border-radius: ${this.getHeight(customStyles)};
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
return styleSheet;
|
|
133
|
+
}
|
|
134
|
+
generateButtonColor(button_type) {
|
|
135
|
+
switch (button_type) {
|
|
136
|
+
case 'black':
|
|
137
|
+
return { color: '#B2FCE3', background: '#000' };
|
|
138
|
+
case 'mint':
|
|
139
|
+
return { color: '#000', background: '#B2FCE3' };
|
|
140
|
+
default:
|
|
141
|
+
return { color: '#fff', background: '#000' };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
getHeight(customStyles) {
|
|
145
|
+
if (!customStyles.height)
|
|
146
|
+
return '40px';
|
|
147
|
+
if (Number.isNaN(Number(customStyles.height)))
|
|
148
|
+
return customStyles.height;
|
|
149
|
+
return `${customStyles.height}px`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=../../src/lib/wallet-buttons/afterpay.wallet-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"afterpay.wallet-service.js","sourceRoot":"","sources":["../../wallet-buttons/afterpay.wallet-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEnG,OAAO,EAAkB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAQxF,MAAM,OAAO,qBAAsB,SAAQ,aAAa;IAIpD,YAAY,KAAa,EAAE,IAAwB;QAC/C,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;IAC9E,CAAC;IAEM,IAAI,CAAC,SAAoB;QAC5B,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/D,CAAC;IAEM,MAAM,CAAC,GAAW;QACrB,KAAK,CAAC,MAAM,CAAC,GAAG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AS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;YACpD,KAAK,MAAM;gBACP,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;YACpD;gBACI,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;SACpD;IACL,CAAC;IAEO,SAAS,CAAC,YAA4B;QAC1C,IAAI,CAAC,YAAY,CAAC,MAAM;YACpB,OAAO,MAAM,CAAC;QAClB,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,YAAY,CAAC,MAAM,CAAC;QAC/B,OAAO,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC;IACtC,CAAC;CACJ"}
|
|
@@ -32,9 +32,11 @@ export declare class AppleWalletService extends WalletService implements IWallet
|
|
|
32
32
|
private checkAvailability;
|
|
33
33
|
private mount;
|
|
34
34
|
private onApplePayButtonClicked;
|
|
35
|
+
private onCancelPayment;
|
|
35
36
|
private createRequest;
|
|
36
37
|
private getMerchantSession;
|
|
37
38
|
private onValidateMerchant;
|
|
39
|
+
private handleMerchantOnButtonClickEvent;
|
|
38
40
|
private onPaymentAuthorized;
|
|
39
41
|
private onShippingContactSelected;
|
|
40
42
|
private onShippingMethodSelected;
|
|
@@ -43,4 +45,3 @@ export declare class AppleWalletService extends WalletService implements IWallet
|
|
|
43
45
|
private createButtonStyle;
|
|
44
46
|
}
|
|
45
47
|
export {};
|
|
46
|
-
//# sourceMappingURL=apple.wallet-service.d.ts.map
|