@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,388 @@
|
|
|
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 and Paypal Smart Buttons Checkout.
|
|
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:
|
|
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
|
+
Paypal wallet 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
|
+
### Setting environment
|
|
72
|
+
|
|
73
|
+
Current method can change environment. By default environment = sandbox.
|
|
74
|
+
Bear in mind that you must set an environment before calling `button.load()`.
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
button.setEnv('sandbox');
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Full example
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<!DOCTYPE html>
|
|
84
|
+
<html lang="en">
|
|
85
|
+
<head>
|
|
86
|
+
<meta charset="UTF-8">
|
|
87
|
+
<title>Title</title>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
91
|
+
<div id="widget"></div>
|
|
92
|
+
</body>
|
|
93
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
94
|
+
<script>
|
|
95
|
+
let button = new paydock.WalletButtons(
|
|
96
|
+
"#widget",
|
|
97
|
+
token,
|
|
98
|
+
{
|
|
99
|
+
amount_label: "Total",
|
|
100
|
+
country: "DE",
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
button.load();
|
|
104
|
+
</script>
|
|
105
|
+
</html>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Wallet Buttons advanced example
|
|
109
|
+
|
|
110
|
+
### Checking for button availability
|
|
111
|
+
|
|
112
|
+
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.
|
|
113
|
+
|
|
114
|
+
```javascript
|
|
115
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Forcibly closing the checkout
|
|
119
|
+
|
|
120
|
+
### Performing actions when shipping info is updated
|
|
121
|
+
|
|
122
|
+
In Paypal and ApplePay via MPGS integrations after each shipping info update the `onUpdate(data)` will be called with the selected shipping address information (plus selected shipping method for Paypal). 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).
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
button.onUpdate((data) => {
|
|
130
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
131
|
+
// call `POST charges/:id` to modify charge
|
|
132
|
+
button.update({ success: true });
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For ApplePay via MPGS integration specifically, you must return the new `amount` and new `shipping_options` If new options are needed based on the updated shipping data. Before the user authorizes the transaction with Touch ID, Face ID, or passcode, you receive redacted address information (address_country, address_city, address_state, address_postcode), this data can be used to recalculate the amount and new shipping options. (https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment/1916097-shippingcontact)
|
|
137
|
+
|
|
138
|
+
```javascript
|
|
139
|
+
button.onUpdate((data) => {
|
|
140
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
141
|
+
// call `POST charges/:id` to modify charge
|
|
142
|
+
button.update({
|
|
143
|
+
success: true,
|
|
144
|
+
body: {
|
|
145
|
+
amount: 15,
|
|
146
|
+
shipping_options: [
|
|
147
|
+
{
|
|
148
|
+
id: "NEW-FreeShip",
|
|
149
|
+
label: "NEW - Free Shipping",
|
|
150
|
+
detail: "Arrives in 3 to 5 days",
|
|
151
|
+
amount: "0.00"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "NEW - FastShip",
|
|
155
|
+
label: "NEW - Fast Shipping",
|
|
156
|
+
detail: "Arrives in less than 1 day",
|
|
157
|
+
amount: "10.00"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Performing actions after the payment is completed
|
|
166
|
+
|
|
167
|
+
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.
|
|
168
|
+
All three callbacks return relevant data according to each one of the scenarios.
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```javascript
|
|
179
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
180
|
+
```
|
|
181
|
+
### Events
|
|
182
|
+
The above events can be used in a more generic way via de `on` function, and making use
|
|
183
|
+
of the corresponding event names.
|
|
184
|
+
|
|
185
|
+
```javascript
|
|
186
|
+
button.on(EVENT.UNAVAILABLE, () => console.log("No wallet buttons available"));
|
|
187
|
+
button.on(EVENT.UPDATE, (data) => console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
188
|
+
button.on(EVENT.PAYMENT_SUCCESSFUL, (data) => console.log("The payment was successful"));
|
|
189
|
+
button.on(EVENT.PAYMENT_ERROR, (data) => console.log("The payment was not successful"));
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
This example shows how to use these functions for **Apple**:
|
|
193
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wallets`)_
|
|
194
|
+
### Full example
|
|
195
|
+
|
|
196
|
+
```html
|
|
197
|
+
<!DOCTYPE html>
|
|
198
|
+
<html lang="en">
|
|
199
|
+
<head>
|
|
200
|
+
<meta charset="UTF-8">
|
|
201
|
+
<title>Title</title>
|
|
202
|
+
</head>
|
|
203
|
+
<body>
|
|
204
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
205
|
+
<div id="widget"></div>
|
|
206
|
+
</body>
|
|
207
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
208
|
+
<script>
|
|
209
|
+
let button = new paydock.WalletButtons(
|
|
210
|
+
"#widget",
|
|
211
|
+
charge_token,
|
|
212
|
+
{
|
|
213
|
+
amount_label: "Total",
|
|
214
|
+
country: "DE",
|
|
215
|
+
wallets: ["google", "apple"],
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
button.setEnv('sandbox');
|
|
219
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
220
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
221
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
222
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
223
|
+
button.load();
|
|
224
|
+
</script>
|
|
225
|
+
</html>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
This example shows how to use these functions for **Paypal Smart Checkout Buttons**:
|
|
229
|
+
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `standalone`, `style`)_
|
|
230
|
+
### Full example
|
|
231
|
+
```html
|
|
232
|
+
<!DOCTYPE html>
|
|
233
|
+
<html lang="en">
|
|
234
|
+
<head>
|
|
235
|
+
<meta charset="UTF-8">
|
|
236
|
+
<title>Title</title>
|
|
237
|
+
</head>
|
|
238
|
+
<body>
|
|
239
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
240
|
+
<div id="widget"></div>
|
|
241
|
+
</body>
|
|
242
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
243
|
+
<script>
|
|
244
|
+
let button = new paydock.WalletButtons(
|
|
245
|
+
"#widget",
|
|
246
|
+
charge_token,
|
|
247
|
+
{
|
|
248
|
+
request_shipping: true,
|
|
249
|
+
pay_later: true,
|
|
250
|
+
style: {
|
|
251
|
+
layout: 'horizontal',
|
|
252
|
+
color: 'blue',
|
|
253
|
+
shape: 'rect',
|
|
254
|
+
label: 'paypal',
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
button.setEnv('sandbox');
|
|
259
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
260
|
+
button.onUpdate((data) => {
|
|
261
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
262
|
+
// call `POST charges/:id` to modify charge
|
|
263
|
+
button.update({ success: true });
|
|
264
|
+
});
|
|
265
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
266
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
267
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
268
|
+
button.load();
|
|
269
|
+
</script>
|
|
270
|
+
</html>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
This example shows how to use these functions for **ApplePay via MPGS**:
|
|
274
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`)_
|
|
275
|
+
### Full example
|
|
276
|
+
|
|
277
|
+
```html
|
|
278
|
+
<!DOCTYPE html>
|
|
279
|
+
<html lang="en">
|
|
280
|
+
<head>
|
|
281
|
+
<meta charset="UTF-8">
|
|
282
|
+
<title>Title</title>
|
|
283
|
+
</head>
|
|
284
|
+
<body>
|
|
285
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
286
|
+
<div id="widget"></div>
|
|
287
|
+
</body>
|
|
288
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
289
|
+
<script>
|
|
290
|
+
let button = new paydock.WalletButtons(
|
|
291
|
+
"#widget",
|
|
292
|
+
charge_token,
|
|
293
|
+
{
|
|
294
|
+
amount_label: "Total",
|
|
295
|
+
country: 'DE',
|
|
296
|
+
request_shipping: true,
|
|
297
|
+
style: {
|
|
298
|
+
button_type: 'buy',
|
|
299
|
+
},
|
|
300
|
+
shipping_options: [
|
|
301
|
+
{
|
|
302
|
+
id: "FreeShip",
|
|
303
|
+
label: "Free Shipping",
|
|
304
|
+
detail: "Arrives in 5 to 7 days",
|
|
305
|
+
amount: "0.00"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: "FastShip",
|
|
309
|
+
label: "Fast Shipping",
|
|
310
|
+
detail: "Arrives in 1 day",
|
|
311
|
+
amount: "10.00"
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
button.setEnv('sandbox');
|
|
317
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
318
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
319
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
320
|
+
button.load();
|
|
321
|
+
</script>
|
|
322
|
+
</html>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
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:
|
|
326
|
+
|
|
327
|
+
### Raw data initialization example
|
|
328
|
+
|
|
329
|
+
```html
|
|
330
|
+
<!DOCTYPE html>
|
|
331
|
+
<html lang="en">
|
|
332
|
+
<head>
|
|
333
|
+
<meta charset="UTF-8">
|
|
334
|
+
<title>Title</title>
|
|
335
|
+
</head>
|
|
336
|
+
<body>
|
|
337
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
338
|
+
<div id="widget"></div>
|
|
339
|
+
</body>
|
|
340
|
+
<script src="https://app-sandbox.paydock.com/v1/widget.umd.js" ></script>
|
|
341
|
+
<script>
|
|
342
|
+
let button = new paydock.WalletButtons(
|
|
343
|
+
"#widget",
|
|
344
|
+
charge_token,
|
|
345
|
+
{
|
|
346
|
+
raw_data_initialization: {
|
|
347
|
+
countryCode: "AU",
|
|
348
|
+
currencyCode: "AUD",
|
|
349
|
+
merchantCapabilities: ["supports3DS","supportsCredit","supportsDebit"],
|
|
350
|
+
supportedNetworks: ["visa","masterCard","amex","discover"],
|
|
351
|
+
requiredBillingContactFields: ["name","postalAddress"],
|
|
352
|
+
requiredShippingContactFields:["postalAddress","name","phone","email" ],
|
|
353
|
+
total: {
|
|
354
|
+
label: "Total",
|
|
355
|
+
amount: "10",
|
|
356
|
+
type: "final",
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
amount_label: "Total",
|
|
360
|
+
country: 'DE',
|
|
361
|
+
request_shipping: true,
|
|
362
|
+
style: {
|
|
363
|
+
button_type: 'buy',
|
|
364
|
+
},
|
|
365
|
+
shipping_options: [
|
|
366
|
+
{
|
|
367
|
+
id: "FreeShip",
|
|
368
|
+
label: "Free Shipping",
|
|
369
|
+
detail: "Arrives in 5 to 7 days",
|
|
370
|
+
amount: "0.00"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: "FastShip",
|
|
374
|
+
label: "Fast Shipping",
|
|
375
|
+
detail: "Arrives in 1 day",
|
|
376
|
+
amount: "10.00"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
button.setEnv('sandbox');
|
|
382
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
383
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
384
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
385
|
+
button.load();
|
|
386
|
+
</script>
|
|
387
|
+
</html>
|
|
388
|
+
```
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
## Widget
|
|
2
|
+
|
|
3
|
+
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#widget-simple-example)
|
|
4
|
+
|
|
5
|
+
A payment form where it is possible to enter card data/bank accounts and then receive a one-time
|
|
6
|
+
token for charges, subscriptions etc. This form can be customized, you can customize the fields and set styles.
|
|
7
|
+
It is possible in real-time to monitor the actions of user with widget and get information about payment-source using events.
|
|
8
|
+
|
|
9
|
+
## Widget simple example
|
|
10
|
+
|
|
11
|
+
### Container
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<div id="widget"></div>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You must create a container for the widget. Inside this tag, the widget will be initialized
|
|
18
|
+
|
|
19
|
+
### Initialization
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
var widget = new paydock.HtmlWidget('#widget', 'publicKey');
|
|
23
|
+
widget.load();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
// ES2015 | TypeScript
|
|
28
|
+
|
|
29
|
+
import { HtmlWidget } from '@paydock/client-sdk';
|
|
30
|
+
|
|
31
|
+
var widget = new HtmlWidget('#widget', 'publicKey');
|
|
32
|
+
widget.load();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then write only need 2 lines of code in js to initialize widget
|
|
36
|
+
|
|
37
|
+
### Full example
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<!DOCTYPE html>
|
|
41
|
+
<html lang="en">
|
|
42
|
+
<head>
|
|
43
|
+
<meta charset="UTF-8">
|
|
44
|
+
<title>Title</title>
|
|
45
|
+
<style>iframe {border: 0;width: 100%;height: 300px;}</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<form id="paymentForm">
|
|
49
|
+
<div id="widget"></div>
|
|
50
|
+
<input name="payment_source_token" id="payment_source_token" type="hidden">
|
|
51
|
+
</form>
|
|
52
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
53
|
+
<script>
|
|
54
|
+
var widget = new paydock.HtmlWidget('#widget', 'publicKey');
|
|
55
|
+
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
56
|
+
widget.load();
|
|
57
|
+
</script>
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Widget advanced example
|
|
63
|
+
|
|
64
|
+
### Customization
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
widget.setStyles({
|
|
68
|
+
background_color: 'rgb(0, 0, 0)',
|
|
69
|
+
border_color: 'yellow',
|
|
70
|
+
text_color: '#FFFFAA',
|
|
71
|
+
button_color: 'rgba(255, 255, 255, 0.9)',
|
|
72
|
+
font_size: '20px'
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This example shows how you can customize to your needs and design
|
|
77
|
+
|
|
78
|
+
### Customization from html
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<div id="widget"
|
|
82
|
+
widget-style="text-color: #FFFFAA; border-color: #yellow"
|
|
83
|
+
title="Payment form"
|
|
84
|
+
finish-text="Payment resource was successfully accepted"></div>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This example shows how you can set style and texts from html
|
|
88
|
+
|
|
89
|
+
### Settings
|
|
90
|
+
|
|
91
|
+
```javascript
|
|
92
|
+
widget.setRefId('id'); // your unique identifier to identify the data
|
|
93
|
+
|
|
94
|
+
widget.setFormFields(['phone', 'email']); // add additional fields for form of widget
|
|
95
|
+
|
|
96
|
+
widget.setSupportedCardIcons(['mastercard', 'visa']); // add icons of supported card types
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This example shows how you can use a lot of other methods to settings your form
|
|
100
|
+
|
|
101
|
+
### Error handling
|
|
102
|
+
|
|
103
|
+
## Overview
|
|
104
|
+
|
|
105
|
+
Error events are emitted when an error occurs during widget operations. These events provide detailed information about the error, including its category, cause, and contextual details.
|
|
106
|
+
|
|
107
|
+
## Error Event Structure
|
|
108
|
+
|
|
109
|
+
### Base Properties
|
|
110
|
+
|
|
111
|
+
| Property | Type | Description |
|
|
112
|
+
|----------|------|-------------|
|
|
113
|
+
| `event` | `string` | Always set to `"error"` |
|
|
114
|
+
| `purpose` | `string` | Indicates the purpose of the action that triggered the error event (e.g., `"payment_source"`) |
|
|
115
|
+
| `message_source` | `string` | Source of the message (e.g., `"widget.paydock"`) |
|
|
116
|
+
| `ref_id` | `string` | Reference ID for the operation |
|
|
117
|
+
| `widget_id` | `string` | Unique identifier of the widget instance |
|
|
118
|
+
| `error` | `object` | Error object containing error information |
|
|
119
|
+
|
|
120
|
+
### Error Object Properties
|
|
121
|
+
|
|
122
|
+
The `error` object contains detailed information about the error:
|
|
123
|
+
|
|
124
|
+
| Property | Type | Description |
|
|
125
|
+
|----------|------|-------------|
|
|
126
|
+
| `category` | `string` | High-level error classification |
|
|
127
|
+
| `cause` | `string` | Specific error cause |
|
|
128
|
+
| `retryable` | `boolean` | Indicates if the operation can be retried |
|
|
129
|
+
| `details` | `object` | Additional error context |
|
|
130
|
+
|
|
131
|
+
## Error Categories
|
|
132
|
+
|
|
133
|
+
| Category | Description |
|
|
134
|
+
|----------|-------------|
|
|
135
|
+
| `configuration` | Configuration-related errors |
|
|
136
|
+
| `identity_access_management` | Authentication and authorization errors |
|
|
137
|
+
| `internal` | Internal system errors |
|
|
138
|
+
| `process` | Process and operation errors |
|
|
139
|
+
| `resource` | Resource-related errors |
|
|
140
|
+
| `validation` | Input validation errors |
|
|
141
|
+
|
|
142
|
+
## Error Causes
|
|
143
|
+
|
|
144
|
+
| Cause | Category | Description |
|
|
145
|
+
|-------|----------|-------------|
|
|
146
|
+
| `aborted` | `process` | Operation was aborted |
|
|
147
|
+
| `access_forbidden` | `identity` | Access to resource is forbidden |
|
|
148
|
+
| `already_exists` | `validation` | Resource already exists |
|
|
149
|
+
| `canceled` | `process` | Operation was canceled |
|
|
150
|
+
| `invalid_configuration` | `configuration` | Invalid widget configuration |
|
|
151
|
+
| `invalid_input` | `validation` | Invalid input provided |
|
|
152
|
+
| `not_found` | `resource` | Requested resource not found |
|
|
153
|
+
| `not_implemented` | `process` | Requested feature not implemented |
|
|
154
|
+
| `rate_limited` | `process` | Too many requests |
|
|
155
|
+
| `server_busy` | `process` | Server is too busy to handle request |
|
|
156
|
+
| `service_unreachable` | `process` | Unable to reach required service |
|
|
157
|
+
| `unauthorized` | `identity` | Authentication required |
|
|
158
|
+
| `unknown_error` | `internal` | Unexpected error occurred |
|
|
159
|
+
| `unprocessable_entity` | `validation` | Valid input but cannot be processed |
|
|
160
|
+
|
|
161
|
+
## Error Details Object
|
|
162
|
+
|
|
163
|
+
| Property | Type | Description |
|
|
164
|
+
|----------|------|-------------|
|
|
165
|
+
| `cause` | `string` | Matches the top-level error cause |
|
|
166
|
+
| `contextId` | `string` | Context identifier (usually matches widget_id) |
|
|
167
|
+
| `message` | `string` | Human-readable error message |
|
|
168
|
+
| `timestamp` | `string` | ISO 8601 timestamp of when the error occurred |
|
|
169
|
+
|
|
170
|
+
## Example
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
widget.hideUiErrors(); // hide default UI errors and handle errors by listening to error events with widget.on('error')
|
|
174
|
+
|
|
175
|
+
widget.on('error', (error) => {
|
|
176
|
+
console.log(error);
|
|
177
|
+
// {
|
|
178
|
+
// "event": "error",
|
|
179
|
+
// "purpose": "payment_source",
|
|
180
|
+
// "message_source": "widget.paydock",
|
|
181
|
+
// "ref_id": "",
|
|
182
|
+
// "widget_id": "d4744f30-dcf5-168e-7f78-c8273a3401d4",
|
|
183
|
+
// "error": {
|
|
184
|
+
// "category": "process",
|
|
185
|
+
// "cause": "service_unreachable",
|
|
186
|
+
// "details": {
|
|
187
|
+
// "cause": "service_unreachable",
|
|
188
|
+
// "contextId": "d4744f30-dcf5-168e-7f78-c8273a3401d4",
|
|
189
|
+
// "message": "The service is not availabe",
|
|
190
|
+
// "timestamp": "2025-02-13T09:30:21.157Z"
|
|
191
|
+
// },
|
|
192
|
+
// "retryable": false
|
|
193
|
+
// }
|
|
194
|
+
// }
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Handling Errors (Tips)
|
|
199
|
+
|
|
200
|
+
When handling errors, consider:
|
|
201
|
+
|
|
202
|
+
1. Check the `retryable` flag to determine if the operation can be retried
|
|
203
|
+
2. Use the `category` for high-level error handling logic
|
|
204
|
+
3. Use the `cause` for specific error handling cases
|
|
205
|
+
4. The `contextId` can be used for error tracking and debugging
|
|
206
|
+
5. The `timestamp` helps with error logging and debugging
|
|
207
|
+
|
|
208
|
+
### Full example
|
|
209
|
+
|
|
210
|
+
```html
|
|
211
|
+
<!DOCTYPE html>
|
|
212
|
+
<html lang="en">
|
|
213
|
+
<head>
|
|
214
|
+
<meta charset="UTF-8">
|
|
215
|
+
<title>Title</title>
|
|
216
|
+
<style>iframe {border: 0;width: 100%;height: 400px;}</style>
|
|
217
|
+
</head>
|
|
218
|
+
<body>
|
|
219
|
+
<form id="paymentForm">
|
|
220
|
+
<div id="widget"
|
|
221
|
+
widget-style="text-color: #FFFFAA; border-color: #yellow"
|
|
222
|
+
title="Payment form"
|
|
223
|
+
finish-text="Payment resource was successfully accepted">
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div
|
|
227
|
+
id="error"
|
|
228
|
+
style="
|
|
229
|
+
display: none;
|
|
230
|
+
max-width: 600px;
|
|
231
|
+
margin: 16px auto;
|
|
232
|
+
padding: 16px 20px;
|
|
233
|
+
border-radius: 8px;
|
|
234
|
+
background-color: #FEF2F2;
|
|
235
|
+
border: 1px solid #FEE2E2;
|
|
236
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
237
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
238
|
+
color: #991B1B;
|
|
239
|
+
line-height: 1.5;
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
"
|
|
242
|
+
title="error"
|
|
243
|
+
>
|
|
244
|
+
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
|
245
|
+
<div>
|
|
246
|
+
<h4 style="margin: 0 0 4px 0; font-size: 14px; font-weight: 600;">Access Error</h4>
|
|
247
|
+
<div id="error-message"></div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</form>
|
|
252
|
+
|
|
253
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
254
|
+
<script>
|
|
255
|
+
var widget = new paydock.HtmlWidget('#widget', 'publicKey', 'gatewayId');
|
|
256
|
+
|
|
257
|
+
widget.setSupportedCardIcons(['mastercard', 'visa']);
|
|
258
|
+
widget.setFormFields(['phone', 'email']);
|
|
259
|
+
widget.setRefId('custom-ref-id');
|
|
260
|
+
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
261
|
+
|
|
262
|
+
widget.on('error', ({ error }) => {
|
|
263
|
+
document.getElementById('error-message').textContent = error.details.message;
|
|
264
|
+
document.getElementById('error').style.display = 'block';
|
|
265
|
+
});
|
|
266
|
+
widget.load();
|
|
267
|
+
</script>
|
|
268
|
+
|
|
269
|
+
</body>
|
|
270
|
+
</html>
|
|
271
|
+
```
|