@paydock/client-sdk 0.0.3 → 0.1.2-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 +9050 -52
- package/bundles/index.cjs +38558 -0
- package/bundles/index.cjs.d.ts +4777 -0
- package/bundles/index.mjs +38519 -0
- package/bundles/index.mjs.d.ts +4777 -0
- package/bundles/types/api/api-base.d.ts +54 -0
- package/bundles/types/api/api-base.d.ts.map +1 -0
- package/bundles/types/api/api-charge-internal.d.ts +99 -0
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
- package/bundles/types/api/api-charge.d.ts +36 -0
- package/bundles/types/api/api-charge.d.ts.map +1 -0
- package/bundles/types/api/api-checkout-internal.d.ts +58 -0
- package/bundles/types/api/api-checkout-internal.d.ts.map +1 -0
- package/bundles/types/api/api-gateway-internal.d.ts +12 -0
- package/bundles/types/api/api-gateway-internal.d.ts.map +1 -0
- package/bundles/types/api/api-internal.d.ts +13 -0
- package/bundles/types/api/api-internal.d.ts.map +1 -0
- package/bundles/types/api/api-service-internal.d.ts +19 -0
- package/bundles/types/api/api-service-internal.d.ts.map +1 -0
- package/bundles/types/api/api.d.ts +55 -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/bundles/types/canvas-3ds/canvas-3ds.d.ts +109 -0
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/index.d.ts +2 -0
- package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +43 -0
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/services/index.d.ts +2 -0
- package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +22 -0
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
- package/bundles/types/checkout/checkout.d.ts +107 -0
- package/bundles/types/checkout/checkout.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/instruction-handler.d.ts +25 -0
- package/bundles/types/checkout/helpers/instruction-handler.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/instruction-module.d.ts +6 -0
- package/bundles/types/checkout/helpers/instruction-module.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts +6 -0
- package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/instruction.decorator.d.ts +5 -0
- package/bundles/types/checkout/helpers/instruction.decorator.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/resource-helper.d.ts +6 -0
- package/bundles/types/checkout/helpers/resource-helper.d.ts.map +1 -0
- package/bundles/types/checkout/helpers/session-helper.d.ts +8 -0
- package/bundles/types/checkout/helpers/session-helper.d.ts.map +1 -0
- package/bundles/types/checkout/index.d.ts +2 -0
- package/bundles/types/checkout/index.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/index.d.ts +3 -0
- package/bundles/types/checkout/instructions/index.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/index.d.ts +4 -0
- package/bundles/types/checkout/instructions/v1/index.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts +20 -0
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts +14 -0
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts +18 -0
- package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts +15 -0
- package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts +11 -0
- package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts +19 -0
- package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts +20 -0
- package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.fraud_service.show.d.ts +21 -0
- package/bundles/types/checkout/instructions/v1/instruction.fraud_service.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts +26 -0
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts +18 -0
- package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts +18 -0
- package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts +18 -0
- package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts +21 -0
- package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts +19 -0
- package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/additionals.d.ts +3 -0
- package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts +9 -0
- package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/message.d.ts +34 -0
- package/bundles/types/checkout/layout-widgets/message.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +13 -0
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +55 -0
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -0
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts +3 -0
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -0
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +36 -0
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
- package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts +13 -0
- package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/checkout-button.d.ts +139 -0
- package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
- package/bundles/types/checkout-button/checkout-button.interface.d.ts +49 -0
- package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
- package/bundles/types/checkout-button/checkout-contextual-handler.d.ts +27 -0
- package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
- package/bundles/types/checkout-button/index.d.ts +85 -0
- package/bundles/types/checkout-button/index.d.ts.map +1 -0
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +21 -0
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
- package/bundles/types/checkout-button/paypal/paypal.runner.d.ts +6 -0
- package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/runner/base.runner.d.ts +18 -0
- package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/runner/contextual.runner.d.ts +39 -0
- package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/runner/index.d.ts +9 -0
- package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
- package/bundles/types/checkout-button/runner/popup.runner.d.ts +35 -0
- package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/runner/redirect.runner.d.ts +17 -0
- 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/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +49 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +39 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +26 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts +4 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts +10 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts +12 -0
- package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
- package/bundles/types/components/ability-guard.d.ts +12 -0
- package/bundles/types/components/ability-guard.d.ts.map +1 -0
- package/bundles/types/components/background.d.ts +43 -0
- package/bundles/types/components/background.d.ts.map +1 -0
- package/bundles/types/components/container.d.ts +12 -0
- package/bundles/types/components/container.d.ts.map +1 -0
- package/bundles/types/components/dispatcher.d.ts +14 -0
- package/bundles/types/components/dispatcher.d.ts.map +1 -0
- package/bundles/types/components/element-style.d.ts +17 -0
- package/bundles/types/components/element-style.d.ts.map +1 -0
- package/bundles/types/components/flypay-iframe-event.d.ts +15 -0
- package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
- package/{lib/widget/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +2 -1
- package/bundles/types/components/form-interceptor.d.ts.map +1 -0
- package/bundles/types/components/http-core.d.ts +14 -0
- package/bundles/types/components/http-core.d.ts.map +1 -0
- package/bundles/types/components/iframe-event.d.ts +72 -0
- package/bundles/types/components/iframe-event.d.ts.map +1 -0
- package/bundles/types/components/iframe.d.ts +20 -0
- package/bundles/types/components/iframe.d.ts.map +1 -0
- package/bundles/types/components/link.d.ts +27 -0
- package/bundles/types/components/link.d.ts.map +1 -0
- package/bundles/types/components/loader.d.ts +5 -0
- package/bundles/types/components/loader.d.ts.map +1 -0
- package/bundles/types/components/param.d.ts +430 -0
- package/bundles/types/components/param.d.ts.map +1 -0
- package/bundles/types/components/popup.d.ts +30 -0
- package/bundles/types/components/popup.d.ts.map +1 -0
- package/bundles/types/components/storage-dispatcher.d.ts +31 -0
- package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
- package/bundles/types/components/trigger.d.ts +48 -0
- package/bundles/types/components/trigger.d.ts.map +1 -0
- package/bundles/types/components/vault-display-iframe-event.d.ts +5 -0
- package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
- package/bundles/types/components/wallet-background.d.ts +13 -0
- package/bundles/types/components/wallet-background.d.ts.map +1 -0
- package/bundles/types/components/wallet-trigger.d.ts +19 -0
- package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
- package/bundles/types/configs/env/environment.cba.d.ts +30 -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/bundles/types/configs/env/environment.paydock.d.ts +49 -0
- 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/bundles/types/configs/sdk.d.ts +10 -0
- package/bundles/types/configs/sdk.d.ts.map +1 -0
- package/bundles/types/constants/validators.d.ts +45 -0
- package/bundles/types/constants/validators.d.ts.map +1 -0
- package/bundles/types/external-checkout/builder.d.ts +29 -0
- package/bundles/types/external-checkout/builder.d.ts.map +1 -0
- package/bundles/types/external-checkout/checker.d.ts +14 -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/bundles/types/fraud-prevention/fraud-prevention.constants.d.ts +9 -0
- package/bundles/types/fraud-prevention/fraud-prevention.constants.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/fraud-prevention.events.d.ts +42 -0
- package/bundles/types/fraud-prevention/fraud-prevention.events.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/fraud-prevention.service.d.ts +163 -0
- package/bundles/types/fraud-prevention/fraud-prevention.service.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/index.d.ts +3 -0
- package/bundles/types/fraud-prevention/index.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/providers/forter/forter-device-agent.service.d.ts +79 -0
- package/bundles/types/fraud-prevention/providers/forter/forter-device-agent.service.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-2025-02-06t14:19:34z.template.d.ts +2 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-2025-02-06t14:19:34z.template.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/resources/find-service-config.repository.d.ts +20 -0
- package/bundles/types/fraud-prevention/resources/find-service-config.repository.d.ts.map +1 -0
- package/bundles/types/helper/access-token.d.ts +26 -0
- package/bundles/types/helper/access-token.d.ts.map +1 -0
- package/bundles/types/helper/browser.d.ts +17 -0
- package/bundles/types/helper/browser.d.ts.map +1 -0
- package/bundles/types/helper/deep-clone.d.ts +13 -0
- package/bundles/types/helper/deep-clone.d.ts.map +1 -0
- package/bundles/types/helper/element-id.d.ts +5 -0
- package/bundles/types/helper/element-id.d.ts.map +1 -0
- package/bundles/types/helper/event-emitter.d.ts +7 -0
- package/bundles/types/helper/event-emitter.d.ts.map +1 -0
- package/bundles/types/helper/event-error.d.ts +55 -0
- package/bundles/types/helper/event-error.d.ts.map +1 -0
- package/bundles/types/helper/event.d.ts +10 -0
- package/bundles/types/helper/event.d.ts.map +1 -0
- package/bundles/types/helper/ms.d.ts +6 -0
- package/bundles/types/helper/ms.d.ts.map +1 -0
- package/{lib/widget → bundles/types}/helper/object.d.ts +1 -0
- package/bundles/types/helper/object.d.ts.map +1 -0
- package/bundles/types/helper/process-event-error.d.ts +9 -0
- package/bundles/types/helper/process-event-error.d.ts.map +1 -0
- package/bundles/types/helper/spiner.util.d.ts +6 -0
- package/bundles/types/helper/spiner.util.d.ts.map +1 -0
- package/bundles/types/helper/url.d.ts +5 -0
- package/bundles/types/helper/url.d.ts.map +1 -0
- package/bundles/types/helper/uuid.d.ts +6 -0
- package/bundles/types/helper/uuid.d.ts.map +1 -0
- package/bundles/types/index-cba.d.ts +52 -0
- package/bundles/types/index-cba.d.ts.map +1 -0
- package/bundles/types/index.d.ts +52 -0
- package/bundles/types/index.d.ts.map +1 -0
- package/bundles/types/payment-source/builder.d.ts +23 -0
- package/bundles/types/payment-source/builder.d.ts.map +1 -0
- package/bundles/types/payment-source/index.d.ts +2 -0
- package/bundles/types/payment-source/index.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +181 -0
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/index.d.ts +35 -0
- package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/interfaces.d.ts +12 -0
- package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts +93 -0
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/index.d.ts +23 -0
- package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +58 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +17 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +85 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +83 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +35 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/index.d.ts +105 -0
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +156 -0
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +25 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts +11 -0
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +86 -0
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
- package/bundles/types/shared/device/device-info.service.d.ts +13 -0
- package/bundles/types/shared/device/device-info.service.d.ts.map +1 -0
- package/bundles/types/shared/http/authorization-strategy.d.ts +41 -0
- package/bundles/types/shared/http/authorization-strategy.d.ts.map +1 -0
- package/bundles/types/shared/http/http-fetcher.d.ts +29 -0
- package/bundles/types/shared/http/http-fetcher.d.ts.map +1 -0
- package/bundles/types/shared/http/http-fetcher.factory.d.ts +17 -0
- package/bundles/types/shared/http/http-fetcher.factory.d.ts.map +1 -0
- package/bundles/types/shared/http/http-request.d.ts +14 -0
- package/bundles/types/shared/http/http-request.d.ts.map +1 -0
- package/bundles/types/shared/http/http-response.dto.d.ts +19 -0
- package/bundles/types/shared/http/http-response.dto.d.ts.map +1 -0
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts +12 -0
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map +1 -0
- package/bundles/types/shared/services/configuration-validation/types.d.ts +73 -0
- package/bundles/types/shared/services/configuration-validation/types.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
- package/bundles/types/shared/shared.constants.d.ts +6 -0
- package/bundles/types/shared/shared.constants.d.ts.map +1 -0
- package/bundles/types/vault-display-widget/index.d.ts +14 -0
- package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts +69 -0
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/enums.d.ts +12 -0
- package/bundles/types/wallet-buttons/enums.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
- package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +138 -0
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/interfaces.d.ts +128 -0
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +321 -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/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts +24 -0
- package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts +49 -0
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts +28 -0
- package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/flypay.wallet-service.d.ts +26 -0
- package/bundles/types/wallet-buttons/wallet-services/flypay.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts +35 -0
- package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/mastercard.wallet-service.d.ts +8 -0
- package/bundles/types/wallet-buttons/wallet-services/mastercard.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts +26 -0
- package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/stripe.wallet-service.d.ts +19 -0
- package/bundles/types/wallet-buttons/wallet-services/stripe.wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts +131 -0
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +252 -0
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts +12 -0
- package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/index.d.ts +245 -0
- package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts +44 -0
- package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +9 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +11 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts +9 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts +13 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-response.interface.d.ts +9 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-response.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +22 -0
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +58 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts +2 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-events.constant.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-events.constant.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +22 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts +2 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts +2 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-contact-editing-mode.type.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-contact-editing-mode.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts +4 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-sdk.interface.d.ts +164 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-sdk.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +32 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +53 -0
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts.map +1 -0
- package/bundles/types/widget/configuration.d.ts +165 -0
- package/bundles/types/widget/configuration.d.ts.map +1 -0
- package/bundles/types/widget/html-multi-widget.d.ts +337 -0
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
- package/bundles/types/widget/html-widget.d.ts +107 -0
- package/bundles/types/widget/html-widget.d.ts.map +1 -0
- package/bundles/types/widget/index.d.ts +132 -0
- package/bundles/types/widget/index.d.ts.map +1 -0
- package/bundles/types/widget/meta.d.ts +8 -0
- package/bundles/types/widget/meta.d.ts.map +1 -0
- package/bundles/types/widget/multi-widget.d.ts +241 -0
- package/bundles/types/widget/multi-widget.d.ts.map +1 -0
- package/bundles/types/widget/style.d.ts +177 -0
- package/bundles/types/widget/style.d.ts.map +1 -0
- package/bundles/widget.umd.js +38429 -767
- package/bundles/widget.umd.js.d.ts +4777 -0
- package/bundles/widget.umd.js.min.d.ts +4777 -0
- package/bundles/widget.umd.min.js +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 +2542 -0
- package/docs/api-wrapper.md +45 -0
- package/docs/canvas3ds-examples.md +242 -0
- package/docs/cba-header.md +13 -0
- package/docs/cba-license.md +2 -0
- package/docs/checkout-examples.md +248 -0
- package/docs/click-to-pay-examples.md +231 -0
- package/docs/click-to-pay.md +337 -0
- package/docs/fraud-prevention-examples.md +154 -0
- package/docs/fraud-prevention.md +0 -0
- package/docs/header.md +15 -0
- package/docs/html/layout.html +79 -0
- package/docs/html/marked.js +23 -0
- package/docs/html/style.css +365 -0
- package/docs/install/npm.content.md +16 -0
- package/docs/install/npm.example.md +24 -0
- package/docs/install/umd.content.md +20 -0
- package/docs/install/umd.example.md +6 -0
- package/docs/install.md +43 -0
- package/docs/install.readme.t.md +17 -0
- package/docs/install.slate.t.md +17 -0
- package/docs/license.md +2 -0
- package/docs/partials/header.hbs +3 -0
- package/docs/paypal-data-collector-examples.md +59 -0
- package/docs/paypal-data-collector.md +149 -0
- package/docs/paypal-save-payment-source-examples.md +63 -0
- package/docs/paypal-save-payment-source.md +256 -0
- package/docs/ps-examples.md +129 -0
- package/docs/vault-display-example.md +132 -0
- package/docs/wallet-buttons-examples.md +638 -0
- package/docs/wallet-buttons-express-examples.md +201 -0
- package/docs/wallet-buttons-express.md +1076 -0
- package/docs/wallet-buttons.md +625 -0
- package/docs/wallet-cba-buttons-examples.md +388 -0
- package/docs/widget-examples.md +271 -0
- package/examples/html-widget/actions.html +47 -0
- package/examples/html-widget/events.html +2 -2
- package/examples/html-widget/form.html +2 -3
- package/examples/html-widget/html-styles.html +29 -0
- package/examples/html-widget/insert-input.html +2 -2
- package/examples/html-widget/optional-settings.html +30 -0
- package/examples/html-widget/simple.html +3 -3
- package/examples/html-widget/styles.html +3 -3
- package/examples/multi-html-widget/extend.html +7 -2
- package/examples/multi-html-widget/simple.html +6 -8
- package/package.json +225 -55
- package/slate.md +2218 -0
- package/.npmignore +0 -15
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/widget/components/container.d.ts +0 -9
- package/lib/widget/components/container.js +0 -18
- package/lib/widget/components/container.js.map +0 -1
- package/lib/widget/components/env.d.ts +0 -19
- package/lib/widget/components/env.js +0 -33
- package/lib/widget/components/env.js.map +0 -1
- package/lib/widget/components/event.d.ts +0 -26
- package/lib/widget/components/event.js +0 -49
- package/lib/widget/components/event.js.map +0 -1
- package/lib/widget/components/form-Interceptor.js +0 -38
- package/lib/widget/components/form-Interceptor.js.map +0 -1
- package/lib/widget/components/iframe.d.ts +0 -11
- package/lib/widget/components/iframe.js +0 -31
- package/lib/widget/components/iframe.js.map +0 -1
- package/lib/widget/components/link.d.ts +0 -13
- package/lib/widget/components/link.js +0 -37
- package/lib/widget/components/link.js.map +0 -1
- package/lib/widget/components/param.d.ts +0 -39
- package/lib/widget/components/param.js +0 -21
- package/lib/widget/components/param.js.map +0 -1
- package/lib/widget/components/trigger.d.ts +0 -19
- package/lib/widget/components/trigger.js +0 -22
- package/lib/widget/components/trigger.js.map +0 -1
- package/lib/widget/configuration.d.ts +0 -59
- package/lib/widget/configuration.js +0 -134
- package/lib/widget/configuration.js.map +0 -1
- package/lib/widget/helper/event.d.ts +0 -8
- package/lib/widget/helper/event.js +0 -15
- package/lib/widget/helper/event.js.map +0 -1
- package/lib/widget/helper/object.js +0 -6
- package/lib/widget/helper/object.js.map +0 -1
- package/lib/widget/helper/url.d.ts +0 -3
- package/lib/widget/helper/url.js +0 -8
- package/lib/widget/helper/url.js.map +0 -1
- package/lib/widget/html-multi-widget.d.ts +0 -56
- package/lib/widget/html-multi-widget.js +0 -89
- package/lib/widget/html-multi-widget.js.map +0 -1
- package/lib/widget/html-widget.d.ts +0 -37
- package/lib/widget/html-widget.js +0 -50
- package/lib/widget/html-widget.js.map +0 -1
- package/lib/widget/index.d.ts +0 -5
- package/lib/widget/index.js +0 -6
- package/lib/widget/index.js.map +0 -1
- package/lib/widget/multi-widget.d.ts +0 -22
- package/lib/widget/multi-widget.js +0 -83
- package/lib/widget/multi-widget.js.map +0 -1
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
## Wallet Buttons
|
|
2
|
+
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#wallet-buttons-simple-example)
|
|
3
|
+
|
|
4
|
+
Wallet Buttons allow you to easily integrate different E-Wallets into your checkout.
|
|
5
|
+
Currently supports ApplePay, Google Pay, Google Pay and Apple Pay via Stripe, Flypay and Flypay V2 checkout, Paypal Smart Buttons Checkout and Afterpay.
|
|
6
|
+
|
|
7
|
+
If available in your client environment, you will display a simple button that upon clicking it the user will follow the standard flow for the appropriate Wallet. If not available an event will be raised and no button will be displayed.
|
|
8
|
+
|
|
9
|
+
## Wallet Buttons simple example
|
|
10
|
+
|
|
11
|
+
### Container
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<div id="widget"></div>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You must create a container for the Wallet Buttons. Inside this tag, the button will be initialized.
|
|
18
|
+
|
|
19
|
+
Before initializing the button, you must perform a POST request to `charges/wallet` from a secure environment like your server. This call will return a token that is required to load the button and securely complete the payment. You can find the documentation to this call in the PayDock API documentation.
|
|
20
|
+
|
|
21
|
+
### Initialization
|
|
22
|
+
The following is the minimum required initialization parameters for Apple Pay and Google Pay via Stripe:
|
|
23
|
+
```javascript
|
|
24
|
+
let button = new paydock.WalletButtons(
|
|
25
|
+
"#widget",
|
|
26
|
+
token,
|
|
27
|
+
{
|
|
28
|
+
amount_label: "Total",
|
|
29
|
+
country: "DE",
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
button.load();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// ES2015 | TypeScript
|
|
37
|
+
import { WalletButtons } from '@paydock/client-sdk';
|
|
38
|
+
|
|
39
|
+
var button = new WalletButtons(
|
|
40
|
+
'#widget',
|
|
41
|
+
token,
|
|
42
|
+
{
|
|
43
|
+
amount_label: 'Total',
|
|
44
|
+
country: 'DE',
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
button.load();
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Flypay and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
|
|
51
|
+
```javascript
|
|
52
|
+
let button = new paydock.WalletButtons(
|
|
53
|
+
"#widget",
|
|
54
|
+
token,
|
|
55
|
+
{}
|
|
56
|
+
);
|
|
57
|
+
button.load();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
// ES2015 | TypeScript
|
|
62
|
+
import { WalletButtons } from '@paydock/client-sdk';
|
|
63
|
+
|
|
64
|
+
var button = new WalletButtons(
|
|
65
|
+
'#widget',
|
|
66
|
+
token,
|
|
67
|
+
{}
|
|
68
|
+
);
|
|
69
|
+
button.load();
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For Afterpay wallet, the country code is required:
|
|
73
|
+
```javascript
|
|
74
|
+
let button = new paydock.WalletButtons(
|
|
75
|
+
"#widget",
|
|
76
|
+
token,
|
|
77
|
+
{
|
|
78
|
+
country: "AU",
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
button.load();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
// ES2015 | TypeScript
|
|
86
|
+
import { WalletButtons } from '@paydock/client-sdk';
|
|
87
|
+
|
|
88
|
+
var button = new WalletButtons(
|
|
89
|
+
'#widget',
|
|
90
|
+
token,
|
|
91
|
+
{
|
|
92
|
+
country: 'AU',
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
button.load();
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For Flypay v2 wallet, the client_id is required:
|
|
99
|
+
```javascript
|
|
100
|
+
let button = new paydock.WalletButtons(
|
|
101
|
+
"#widget",
|
|
102
|
+
token,
|
|
103
|
+
{
|
|
104
|
+
client_id: "client_id",
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
button.load();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
// ES2015 | TypeScript
|
|
112
|
+
import { WalletButtons } from '@paydock/client-sdk';
|
|
113
|
+
|
|
114
|
+
var button = new WalletButtons(
|
|
115
|
+
'#widget',
|
|
116
|
+
token,
|
|
117
|
+
{
|
|
118
|
+
client_id: "client_id",
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
button.load();
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Setting environment
|
|
125
|
+
|
|
126
|
+
Current method can change environment. By default environment = sandbox.
|
|
127
|
+
Bear in mind that you must set an environment before calling `button.load()`.
|
|
128
|
+
|
|
129
|
+
```javascript
|
|
130
|
+
button.setEnv('sandbox');
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Full example
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<!DOCTYPE html>
|
|
137
|
+
<html lang="en">
|
|
138
|
+
<head>
|
|
139
|
+
<meta charset="UTF-8">
|
|
140
|
+
<title>Title</title>
|
|
141
|
+
</head>
|
|
142
|
+
<body>
|
|
143
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
144
|
+
<div id="widget"></div>
|
|
145
|
+
</body>
|
|
146
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
147
|
+
<script>
|
|
148
|
+
let button = new paydock.WalletButtons(
|
|
149
|
+
"#widget",
|
|
150
|
+
token,
|
|
151
|
+
{
|
|
152
|
+
amount_label: "Total",
|
|
153
|
+
country: "DE",
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
button.load();
|
|
157
|
+
</script>
|
|
158
|
+
</html>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Wallet Buttons advanced example
|
|
162
|
+
|
|
163
|
+
### Checking for button availability
|
|
164
|
+
|
|
165
|
+
If the customer's browser is not supported, or the customer does not have any card added to their Google Pay or Apple Pay wallets, the button will not load. In this case the callback onUnavailable() will be called. You can define the behavior of this function before loading the button.
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Forcibly closing the checkout
|
|
172
|
+
|
|
173
|
+
In some situations you may want to forcibly close the checkout so that your user is back in your checkout screen, fow which you can use this method. Currently supported by Flypay wallet only.
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
button.close();
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Performing actions when the wallet button is clicked
|
|
180
|
+
|
|
181
|
+
In some situations you may want to perform some validations or actions when the user clicks on the wallet button, for which you can use this method. Currently supported by Paypal, ApplePay and GooglePay wallets.
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
button.onClick(() => console.log("Perform actions on button click"));
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Performing actions when shipping info is updated
|
|
188
|
+
|
|
189
|
+
In Flypay, Paypal, ApplePay via MPGS and GooglePay via MPGS integrations after each shipping info update the `onUpdate(data)` will be called with the selected shipping address information, plus selected shipping method when applicable for Paypal, ApplePay and GooglePay. Merchants should handle this callback, recalculate shipping costs in their server by analyzing the new data, and submit a backend to backend request to `POST charges/:id` with the new total amount and shipping amount (you can find the documentation of this call in the PayDock API documentation).
|
|
190
|
+
|
|
191
|
+
For Paypal integration specifically, if shipping is enabled for the wallet button and different shipping methods were provided in the create wallet charge call, Merchants must ensure that the posted `shipping.amount` to `POST charges/:id` matches the selected shipping option amount (value sent in when initializing the wallet charge). In other words, when providing shipping methods the shipping amount is bound to being one of the provided shipping method amount necessarily. Bear in mind that the total charge amount must include the `shipping.amount`, since it represents the full amount to be charged to the customer.
|
|
192
|
+
|
|
193
|
+
After analyzing the new shipping information, and making the post with the updated charge and shipping amounts if necessary, the `button.update({ success: true/false })` wallet button method needs to be called to resume the interactions with the customer. Not calling this will result in unexpected behavior.
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
button.onUpdate((data) => {
|
|
197
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
198
|
+
// call `POST charges/:id` to modify charge
|
|
199
|
+
button.update({ success: true });
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
For ApplePay via MPGS and GooglePay via MPGS integrations, you can also return a new `amount` and new `shipping_options` in case new options are needed based on the updated shipping data. Before the user authorizes the transaction, you receive redacted address information (address_country, address_city, address_state, address_postcode), and this data can be used to recalculate the new amount and new shipping options.
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
button.onUpdate((data) => {
|
|
207
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
208
|
+
// call `POST charges/:id` to modify charge
|
|
209
|
+
button.update({
|
|
210
|
+
success: true,
|
|
211
|
+
body: {
|
|
212
|
+
amount: 15,
|
|
213
|
+
shipping_options: [
|
|
214
|
+
{
|
|
215
|
+
id: "NEW-FreeShip",
|
|
216
|
+
label: "NEW - Free Shipping",
|
|
217
|
+
detail: "Arrives in 3 to 5 days",
|
|
218
|
+
amount: "0.00"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: "NEW-FastShip",
|
|
222
|
+
label: "NEW - Fast Shipping",
|
|
223
|
+
detail: "Arrives in less than 1 day",
|
|
224
|
+
amount: "10.00"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Performing actions after the payment is completed
|
|
233
|
+
|
|
234
|
+
After the payment is completed, the onPaymentSuccessful(data) will be called if the payment was successful. If the payment was not successful, the function onPaymentError(data) will be called. If fraud check is active for the gateway, a fraud body was sent in the wallet charge initialize call and the fraud service left the charge in review, then the onPaymentInReview(data) will be called.
|
|
235
|
+
All three callbacks return relevant data according to each one of the scenarios.
|
|
236
|
+
|
|
237
|
+
>*Note that these callbacks will not be triggered for the Afterpay wallet when Redirect mode is used, that is when the charge is initialized with the success_url and error_url parameters, since the payment completion is done through the Redirect method, and therefore this SDK will not be loaded once the payment is completed at checkout.*
|
|
238
|
+
|
|
239
|
+
```javascript
|
|
240
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```javascript
|
|
244
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
```javascript
|
|
248
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
249
|
+
```
|
|
250
|
+
### Events
|
|
251
|
+
The above events can be used in a more generic way via de `on` function, and making use
|
|
252
|
+
of the corresponding event names.
|
|
253
|
+
|
|
254
|
+
```javascript
|
|
255
|
+
button.on(EVENT.UNAVAILABLE, () => console.log("No wallet buttons available"));
|
|
256
|
+
button.on(EVENT.UPDATE, (data) => console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
257
|
+
button.on(EVENT.PAYMENT_SUCCESSFUL, (data) => console.log("The payment was successful"));
|
|
258
|
+
button.on(EVENT.PAYMENT_ERROR, (data) => console.log("The payment was not successful"));
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
This example shows how to use these functions for **Apple and Google Pay via Stripe**:
|
|
262
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wallets`)_
|
|
263
|
+
### Apple and Google Pay via Stripe Full example
|
|
264
|
+
|
|
265
|
+
```html
|
|
266
|
+
<!DOCTYPE html>
|
|
267
|
+
<html lang="en">
|
|
268
|
+
<head>
|
|
269
|
+
<meta charset="UTF-8">
|
|
270
|
+
<title>Title</title>
|
|
271
|
+
</head>
|
|
272
|
+
<body>
|
|
273
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
274
|
+
<div id="widget"></div>
|
|
275
|
+
</body>
|
|
276
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
277
|
+
<script>
|
|
278
|
+
let button = new paydock.WalletButtons(
|
|
279
|
+
"#widget",
|
|
280
|
+
charge_token,
|
|
281
|
+
{
|
|
282
|
+
amount_label: "Total",
|
|
283
|
+
country: "DE",
|
|
284
|
+
wallets: ["google", "apple"],
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
button.setEnv('sandbox');
|
|
288
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
289
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
290
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
291
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
292
|
+
button.load();
|
|
293
|
+
</script>
|
|
294
|
+
</html>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
This example shows how to use these functions for **Paypal Smart Checkout Buttons**:
|
|
298
|
+
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `standalone`, `style`)_
|
|
299
|
+
### Paypal Smart Checkout Buttons Full example
|
|
300
|
+
```html
|
|
301
|
+
<!DOCTYPE html>
|
|
302
|
+
<html lang="en">
|
|
303
|
+
<head>
|
|
304
|
+
<meta charset="UTF-8">
|
|
305
|
+
<title>Title</title>
|
|
306
|
+
</head>
|
|
307
|
+
<body>
|
|
308
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
309
|
+
<div id="widget"></div>
|
|
310
|
+
</body>
|
|
311
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
312
|
+
<script>
|
|
313
|
+
let button = new paydock.WalletButtons(
|
|
314
|
+
"#widget",
|
|
315
|
+
charge_token,
|
|
316
|
+
{
|
|
317
|
+
request_shipping: true,
|
|
318
|
+
pay_later: true,
|
|
319
|
+
standalone: false,
|
|
320
|
+
style: {
|
|
321
|
+
layout: 'horizontal',
|
|
322
|
+
color: 'blue',
|
|
323
|
+
shape: 'rect',
|
|
324
|
+
label: 'paypal',
|
|
325
|
+
},
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
button.setEnv('sandbox');
|
|
329
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
330
|
+
button.onUpdate((data) => {
|
|
331
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
332
|
+
// call `POST charges/:id` to modify charge
|
|
333
|
+
button.update({ success: true });
|
|
334
|
+
});
|
|
335
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
336
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
337
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
338
|
+
|
|
339
|
+
// Example 1: Asynchronous onClick handler
|
|
340
|
+
const asyncLogic = async () => {
|
|
341
|
+
// Perform asynchronous logic. Expectation is that a Promise is returned and attached to response via `attachResult`,
|
|
342
|
+
// and resolve or reject of it will dictate how wallet behaves.
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
button.onClick(({ data: { attachResult } }) => {
|
|
346
|
+
// Promise is attached to the result. On Paypal, when promise is resolved, the user Journey will continue.
|
|
347
|
+
// If no promise is attached then the Paypal journey will not depend on the promise being resolved or rejected
|
|
348
|
+
attachResult(asyncLogic());
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// Example 2: Synchronous onClick handler
|
|
352
|
+
// button.onClick(({ data: { attachResult } }) => {
|
|
353
|
+
// // Perform synchronous logic
|
|
354
|
+
// console.log("Synchronous onClick: Button clicked");
|
|
355
|
+
// // Optionally return a boolean flag to halt the operation
|
|
356
|
+
// attachResult(false);
|
|
357
|
+
// });
|
|
358
|
+
|
|
359
|
+
button.load();
|
|
360
|
+
</script>
|
|
361
|
+
</html>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
This example shows how to use these functions for **Flypay v1 Wallet**.
|
|
365
|
+
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `style`)_
|
|
366
|
+
### Flypay Full example
|
|
367
|
+
```html
|
|
368
|
+
<!DOCTYPE html>
|
|
369
|
+
<html lang="en">
|
|
370
|
+
<head>
|
|
371
|
+
<meta charset="UTF-8">
|
|
372
|
+
<title>Title</title>
|
|
373
|
+
</head>
|
|
374
|
+
<body>
|
|
375
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
376
|
+
<div id="widget"></div>
|
|
377
|
+
</body>
|
|
378
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
379
|
+
<script>
|
|
380
|
+
let button = new paydock.WalletButtons(
|
|
381
|
+
"#widget",
|
|
382
|
+
charge_token,
|
|
383
|
+
{
|
|
384
|
+
request_shipping: true
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
button.setEnv('sandbox');
|
|
388
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
389
|
+
button.onUpdate((data) => {
|
|
390
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
391
|
+
// call `POST charges/:id` to modify charge
|
|
392
|
+
button.update({ success: true });
|
|
393
|
+
});
|
|
394
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
395
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
396
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
397
|
+
button.load();
|
|
398
|
+
</script>
|
|
399
|
+
</html>
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
This example shows how to use these functions for **Flypay v2 Wallet**.
|
|
403
|
+
_(Required `meta` fields: - . Optional `meta` fields: -)_
|
|
404
|
+
### Flypay V2 Full example
|
|
405
|
+
```html
|
|
406
|
+
<!DOCTYPE html>
|
|
407
|
+
<html lang="en">
|
|
408
|
+
<head>
|
|
409
|
+
<meta charset="UTF-8">
|
|
410
|
+
<title>Title</title>
|
|
411
|
+
</head>
|
|
412
|
+
<body>
|
|
413
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
414
|
+
<div id="widget"></div>
|
|
415
|
+
</body>
|
|
416
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
417
|
+
<script>
|
|
418
|
+
let button = new paydock.WalletButtons(
|
|
419
|
+
"#widget",
|
|
420
|
+
charge_token,
|
|
421
|
+
{
|
|
422
|
+
access_token: 'TOKEN',
|
|
423
|
+
refresh_token: 'TOKEN',
|
|
424
|
+
client_id: 'CLIENT_ID',
|
|
425
|
+
},
|
|
426
|
+
);
|
|
427
|
+
button.setEnv('sandbox');
|
|
428
|
+
button.onUnavailable((data) => console.log("No wallet buttons available"));
|
|
429
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
430
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
431
|
+
button.onAuthTokensChanged((data) => console.log('Authentication tokens changed'));
|
|
432
|
+
button.load();
|
|
433
|
+
</script>
|
|
434
|
+
</html>
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
This example shows how to use these functions for **ApplePay via MPGS** and **GooglePay via MPGS**:
|
|
438
|
+
|
|
439
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`, `style.button_style`)_
|
|
440
|
+
### ApplePay and GooglePay via MPGS Full example
|
|
441
|
+
|
|
442
|
+
```html
|
|
443
|
+
<!DOCTYPE html>
|
|
444
|
+
<html lang="en">
|
|
445
|
+
<head>
|
|
446
|
+
<meta charset="UTF-8">
|
|
447
|
+
<title>Title</title>
|
|
448
|
+
</head>
|
|
449
|
+
<body>
|
|
450
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
451
|
+
<div id="widget"></div>
|
|
452
|
+
</body>
|
|
453
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
454
|
+
<script>
|
|
455
|
+
let button = new paydock.WalletButtons(
|
|
456
|
+
"#widget",
|
|
457
|
+
charge_token,
|
|
458
|
+
{
|
|
459
|
+
amount_label: "Total",
|
|
460
|
+
country: 'DE',
|
|
461
|
+
request_shipping: true,
|
|
462
|
+
show_billing_address: true,
|
|
463
|
+
style: {
|
|
464
|
+
google: {
|
|
465
|
+
button_type: 'buy',
|
|
466
|
+
button_size_mode: 'static',
|
|
467
|
+
button_color: 'white',
|
|
468
|
+
},
|
|
469
|
+
apple: {
|
|
470
|
+
button_type: 'buy',
|
|
471
|
+
button_style: 'black',
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
shipping_options: [
|
|
475
|
+
{
|
|
476
|
+
id: "FreeShip",
|
|
477
|
+
label: "Free Shipping",
|
|
478
|
+
detail: "Arrives in 5 to 7 days",
|
|
479
|
+
amount: "0.00"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
id: "FastShip",
|
|
483
|
+
label: "Fast Shipping",
|
|
484
|
+
detail: "Arrives in 1 day",
|
|
485
|
+
amount: "10.00"
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
button.setEnv('sandbox');
|
|
491
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
492
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
493
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
494
|
+
button.onClick(() => console.log("On WalletButton Click"));
|
|
495
|
+
button.onUpdate((data) => {
|
|
496
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
497
|
+
// call `POST charges/:id` to modify charge
|
|
498
|
+
button.update({
|
|
499
|
+
success: true,
|
|
500
|
+
body: {
|
|
501
|
+
amount: 15,
|
|
502
|
+
shipping_options: [
|
|
503
|
+
{
|
|
504
|
+
id: "NEW-FreeShip",
|
|
505
|
+
label: "NEW - Free Shipping",
|
|
506
|
+
detail: "Arrives in 3 to 5 days",
|
|
507
|
+
amount: "0.00"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
id: "NEW-FastShip",
|
|
511
|
+
label: "NEW - Fast Shipping",
|
|
512
|
+
detail: "Arrives in less than 1 day",
|
|
513
|
+
amount: "10.00"
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
button.load();
|
|
520
|
+
</script>
|
|
521
|
+
</html>
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest` with your own values instead of using the default ones. Below you can see an example on how to initialize the `ApplePayPaymentRequest` with the `raw_data_initialization` meta field.
|
|
525
|
+
|
|
526
|
+
Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpecification` with your own values instead of using the default ones. Below you can see an example on how to initialize the `PaymentMethodSpecification` with the `raw_data_initialization` meta field.
|
|
527
|
+
### ApplePay and GooglePay via MPGS Raw data initialization example
|
|
528
|
+
|
|
529
|
+
```html
|
|
530
|
+
<!DOCTYPE html>
|
|
531
|
+
<html lang="en">
|
|
532
|
+
<head>
|
|
533
|
+
<meta charset="UTF-8">
|
|
534
|
+
<title>Title</title>
|
|
535
|
+
</head>
|
|
536
|
+
<body>
|
|
537
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
538
|
+
<div id="widget"></div>
|
|
539
|
+
</body>
|
|
540
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
541
|
+
<script>
|
|
542
|
+
let button = new paydock.WalletButtons(
|
|
543
|
+
"#widget",
|
|
544
|
+
charge_token,
|
|
545
|
+
{
|
|
546
|
+
raw_data_initialization: {
|
|
547
|
+
apple: {
|
|
548
|
+
countryCode: "AU",
|
|
549
|
+
currencyCode: "AUD",
|
|
550
|
+
merchantCapabilities: ["supports3DS","supportsCredit","supportsDebit"],
|
|
551
|
+
supportedNetworks: ["visa","masterCard","amex","discover"],
|
|
552
|
+
requiredBillingContactFields: ["name","postalAddress"],
|
|
553
|
+
requiredShippingContactFields:["postalAddress","name","phone","email" ],
|
|
554
|
+
total: {
|
|
555
|
+
label: "Total",
|
|
556
|
+
amount: "10",
|
|
557
|
+
type: "final",
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
google: {
|
|
561
|
+
type: "CARD",
|
|
562
|
+
parameters: {
|
|
563
|
+
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
564
|
+
allowedCardNetworks: [
|
|
565
|
+
"AMEX",
|
|
566
|
+
"DISCOVER",
|
|
567
|
+
"INTERAC",
|
|
568
|
+
"JCB",
|
|
569
|
+
"MASTERCARD",
|
|
570
|
+
"VISA",
|
|
571
|
+
],
|
|
572
|
+
billingAddressRequired: true,
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
amount_label: "Total",
|
|
577
|
+
country: 'DE',
|
|
578
|
+
request_shipping: true,
|
|
579
|
+
show_billing_address: true,
|
|
580
|
+
style: {
|
|
581
|
+
google: {
|
|
582
|
+
button_type: 'buy',
|
|
583
|
+
button_size_mode: 'static',
|
|
584
|
+
button_color: 'white',
|
|
585
|
+
},
|
|
586
|
+
apple: {
|
|
587
|
+
button_type: 'buy',
|
|
588
|
+
button_style: 'black',
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
shipping_options: [
|
|
592
|
+
{
|
|
593
|
+
id: "FreeShip",
|
|
594
|
+
label: "Free Shipping",
|
|
595
|
+
detail: "Arrives in 5 to 7 days",
|
|
596
|
+
amount: "0.00"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "FastShip",
|
|
600
|
+
label: "Fast Shipping",
|
|
601
|
+
detail: "Arrives in 1 day",
|
|
602
|
+
amount: "10.00"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
button.setEnv('sandbox');
|
|
608
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
609
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
610
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
611
|
+
button.onUpdate((data) => {
|
|
612
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
613
|
+
// call `POST charges/:id` to modify charge
|
|
614
|
+
button.update({
|
|
615
|
+
success: true,
|
|
616
|
+
body: {
|
|
617
|
+
amount: 15,
|
|
618
|
+
shipping_options: [
|
|
619
|
+
{
|
|
620
|
+
id: "NEW-FreeShip",
|
|
621
|
+
label: "NEW - Free Shipping",
|
|
622
|
+
detail: "Arrives in 3 to 5 days",
|
|
623
|
+
amount: "0.00"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
id: "NEW-FastShip",
|
|
627
|
+
label: "NEW - Fast Shipping",
|
|
628
|
+
detail: "Arrives in less than 1 day",
|
|
629
|
+
amount: "10.00"
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
button.load();
|
|
636
|
+
</script>
|
|
637
|
+
</html>
|
|
638
|
+
```
|