@paydock/client-sdk 1.115.0 → 1.116.2

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.
Files changed (53) hide show
  1. package/README.md +531 -40
  2. package/bundles/index.cjs +515 -87
  3. package/bundles/index.cjs.d.ts +214 -1
  4. package/bundles/index.mjs +514 -88
  5. package/bundles/index.mjs.d.ts +214 -1
  6. package/bundles/types/api/api-charge-internal.d.ts +1 -0
  7. package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
  8. package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -1
  9. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +0 -1
  10. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
  11. package/bundles/types/index-cba.d.ts +2 -0
  12. package/bundles/types/index-cba.d.ts.map +1 -1
  13. package/bundles/types/index.d.ts +2 -0
  14. package/bundles/types/index.d.ts.map +1 -1
  15. package/bundles/types/paypal-data-collector/index.d.ts +23 -0
  16. package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
  17. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +58 -0
  18. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
  19. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
  20. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
  21. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +17 -0
  22. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
  23. package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
  24. package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
  25. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +85 -0
  26. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
  27. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +84 -0
  28. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
  29. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +36 -0
  30. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
  31. package/bundles/types/secure-remote-commerce/index.d.ts +0 -1
  32. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  33. package/bundles/types/secure-remote-commerce/interfaces.d.ts +1 -5
  34. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  35. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
  36. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -1
  37. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +1 -0
  38. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -1
  39. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
  40. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -1
  41. package/bundles/widget.umd.js +515 -87
  42. package/bundles/widget.umd.js.d.ts +214 -1
  43. package/bundles/widget.umd.js.min.d.ts +214 -1
  44. package/bundles/widget.umd.min.js +7 -7
  45. package/docs/click-to-pay-examples.md +0 -36
  46. package/docs/click-to-pay.md +0 -3
  47. package/docs/paypal-data-collector-examples.md +58 -0
  48. package/docs/paypal-data-collector.md +149 -0
  49. package/docs/paypal-save-payment-source-examples.md +63 -0
  50. package/docs/paypal-save-payment-source.md +256 -0
  51. package/docs/wallet-buttons-express-examples.md +1 -1
  52. package/package.json +1 -1
  53. package/slate.md +0 -36
@@ -1824,6 +1824,7 @@ interface WalletCaptureBody {
1824
1824
  address_country?: string;
1825
1825
  external_payer_id?: string;
1826
1826
  ref_token?: string;
1827
+ wallet_express?: boolean;
1827
1828
  };
1828
1829
  };
1829
1830
  }
@@ -3459,6 +3460,7 @@ interface WalletCaptureRequest {
3459
3460
  address_state?: string;
3460
3461
  ref_token?: string;
3461
3462
  external_payer_id?: string;
3463
+ wallet_express?: boolean;
3462
3464
  };
3463
3465
  };
3464
3466
  }
@@ -3803,4 +3805,215 @@ declare class PaypalWalletButtonExpress extends BaseWalletButton<PaypalWalletMet
3803
3805
  private paypalSharedProps;
3804
3806
  }
3805
3807
 
3806
- export { AfterpayCheckoutButton, Api, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, ClickToPay, Configuration, ELEMENT, EVENT$1 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, type ICheckout, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, InstructionDebugger, MultiWidget, PAYMENT_TYPE, PURPOSE, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };
3808
+ declare enum ErrorCodes$1 {
3809
+ PROMISE_NOT_ENABLED = "promise_not_enabled",
3810
+ SCRIPT_ERROR = "script_error"
3811
+ }
3812
+ interface PayPalDataCollectorConfig {
3813
+ mouse_movement?: boolean;
3814
+ }
3815
+ interface IPayPalDataCollector {
3816
+ collectDeviceData(): Promise<CollectedDeviceData>;
3817
+ setEnv(env: string): void;
3818
+ }
3819
+ interface CollectedDeviceData {
3820
+ correlation_id: string;
3821
+ }
3822
+ interface IOnErrorEventData$1 {
3823
+ error_code: ErrorCodes$1;
3824
+ }
3825
+
3826
+ /**
3827
+ * PayPal Data Collector Widget constructor
3828
+ *
3829
+ * @param {string} flowId - This string identifies the source website of the FraudNet request.
3830
+ * @param {PayPalDataCollectorConfig} config - Extra configuration for the widget.
3831
+ *
3832
+ * @example
3833
+ * var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
3834
+ */
3835
+ declare class PayPalDataCollector {
3836
+ protected service: IPayPalDataCollector;
3837
+ protected eventEmitter: EventEmitter;
3838
+ /** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
3839
+ /**
3840
+ * After configuring the PayPalDataCollector Widget, starts the process and returns
3841
+ * the correlation id used among the requests.
3842
+ *
3843
+ * @returns {Promise<CollectedDeviceData>} Promise when resolved, returnsa an object
3844
+ * that contains the `correlation_id` key.
3845
+ *
3846
+ * @example
3847
+ * const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
3848
+ * console.log(collectedDeviceData.correlation_id)
3849
+ */
3850
+ collectDeviceData(): Promise<CollectedDeviceData>;
3851
+ /**
3852
+ * Callback for onError method.
3853
+ *
3854
+ * @callback OnErrorCallback
3855
+ * @param {IOnErrorEventData|null} data
3856
+ */
3857
+ /**
3858
+ * If the process fails, the function passed as parameter will be called.
3859
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3860
+ *
3861
+ * @example
3862
+ * PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
3863
+ *
3864
+ * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
3865
+ */
3866
+ onError(callback?: (data?: IOnErrorEventData$1) => void): () => void;
3867
+ /**
3868
+ * Current method can change environment. By default environment = test.
3869
+ * This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
3870
+ * script, in order to know if the script is injected on a live server or is a testing
3871
+ * environment. The available values are `test` and `live`. This should match with the used
3872
+ * `gateway.mode` in Paydock to process the transaction.
3873
+ *
3874
+ * @example
3875
+ * PayPalDataCollector.setEnv('live');
3876
+ * @param {string} env - test, live
3877
+ */
3878
+ setEnv(env: string): void;
3879
+ }
3880
+
3881
+ interface PayPalStyleConfig {
3882
+ layout?: 'vertical' | 'horizontal';
3883
+ color?: 'blue' | 'gold' | 'silver' | 'black' | 'white';
3884
+ shape?: 'rect' | 'sharp' | 'pill';
3885
+ label?: 'paypal' | 'checkout' | 'buynow' | 'pay';
3886
+ disableMaxWidth?: boolean;
3887
+ disableMaxHeight?: boolean;
3888
+ height?: number;
3889
+ borderRadius?: number;
3890
+ tagline?: boolean;
3891
+ }
3892
+ interface PayPalMessageConfig {
3893
+ amount?: number;
3894
+ align?: 'center' | 'left' | 'right';
3895
+ color?: 'black' | 'white';
3896
+ position?: 'top' | 'bottom';
3897
+ }
3898
+ interface PayPalSavePaymentSourceWidgetConfig {
3899
+ style?: PayPalStyleConfig;
3900
+ message?: PayPalMessageConfig;
3901
+ }
3902
+ interface IPayPalSavePaymentSourceWidget {
3903
+ load(container: Container): void;
3904
+ setEnv(env: string, alias?: string): void;
3905
+ }
3906
+ declare enum ErrorCodes {
3907
+ UNAVAILABLE = "unavailable",
3908
+ ON_PAYPAL_VAULT_SETUP_TOKEN_ERROR = "onPaypalVaultSetupTokenError",
3909
+ ON_GET_ID_TOKEN_ERROR = "onGetIdTokenError",
3910
+ ON_GET_WALLET_CONFIG_ERROR = "onGetWalletConfigError",
3911
+ ON_GET_SETUP_TOKEN_ERROR = "onGetSetupTokenError",
3912
+ ON_ONE_TIME_TOKEN_ERROR = "onOneTimeTokenError"
3913
+ }
3914
+ declare enum EVENTS {
3915
+ ON_SUCCESS = "ON_SUCCESS",
3916
+ ON_ERROR = "ON_ERROR",
3917
+ ON_CANCEL = "ON_CANCEL"
3918
+ }
3919
+ interface IOnSuccessEventData {
3920
+ event: EVENTS.ON_SUCCESS;
3921
+ data: {
3922
+ token: string;
3923
+ email: string;
3924
+ };
3925
+ }
3926
+ interface IOnErrorEventData {
3927
+ event: EVENTS.ON_ERROR;
3928
+ data: {
3929
+ error_code: ErrorCodes;
3930
+ details?: string;
3931
+ message?: string;
3932
+ };
3933
+ }
3934
+ interface IOnCancelEventData {
3935
+ event: EVENTS.ON_CANCEL;
3936
+ }
3937
+
3938
+ /**
3939
+ * PayPal Save Payment Source Widget constructor
3940
+ *
3941
+ * @param {string} selector - Selector of html element. Container for PayPal Save Payment Source Widget.
3942
+ * @param {string} publicKey - PayDock users public key.
3943
+ * @param {string} gatewayId - PayDock's PayPal gatewayId.
3944
+ * @param {PayPalSavePaymentSourceWidgetConfig} config - Extra configuration for the widget, like styles.
3945
+ *
3946
+ * @example
3947
+ * var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
3948
+ */
3949
+ declare class PayPalSavePaymentSourceWidget {
3950
+ protected container: Container;
3951
+ protected service: IPayPalSavePaymentSourceWidget;
3952
+ protected eventEmitter: EventEmitter;
3953
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId: string, config?: PayPalSavePaymentSourceWidgetConfig);
3954
+ /**
3955
+ * The final method after configuring the PayPalSavePaymentSource Widget to
3956
+ * start the load process.
3957
+ */
3958
+ load(): void;
3959
+ /**
3960
+ * Current method can change environment. By default environment = sandbox.
3961
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
3962
+ *
3963
+ * @example
3964
+ * payPalSavePaymentSourceWidget.setEnv('production');
3965
+ * @param {string} env - sandbox, production
3966
+ * @param {string} [alias] - Own domain alias
3967
+ */
3968
+ setEnv(env: string, alias?: string): void;
3969
+ /**
3970
+ * Callback for onSuccess method.
3971
+ *
3972
+ * @callback OnSuccessCallback
3973
+ * @param {IOnSuccessEventData} data
3974
+ */
3975
+ /**
3976
+ * If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
3977
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3978
+ *
3979
+ * @example
3980
+ * payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
3981
+ *
3982
+ * @param {OnSuccessCallback} [callback] - Function to be called when the result is successful.
3983
+ */
3984
+ onSuccess(callback?: (data: IOnSuccessEventData) => void): () => void;
3985
+ /**
3986
+ * Callback for onError method.
3987
+ *
3988
+ * @callback OnErrorCallback
3989
+ * @param {IOnErrorEventData} data
3990
+ */
3991
+ /**
3992
+ * If in the process for obtaining the setup token fails, the function passed as parameter will be called.
3993
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3994
+ *
3995
+ * @example
3996
+ * payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
3997
+ *
3998
+ * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
3999
+ */
4000
+ onError(callback?: (data: IOnErrorEventData) => void): () => void;
4001
+ /**
4002
+ * Callback for onCancel method.
4003
+ *
4004
+ * @callback OnCancelCallback
4005
+ * @param {IOnCancelEventData} data
4006
+ */
4007
+ /**
4008
+ * If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
4009
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
4010
+ *
4011
+ * @example
4012
+ * payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
4013
+ *
4014
+ * @param {OnCancelCallback} [callback] - Function to be called when the operation is cancelled.
4015
+ */
4016
+ onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
4017
+ }
4018
+
4019
+ export { AfterpayCheckoutButton, Api, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, ClickToPay, Configuration, ELEMENT, EVENT$1 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, type ICheckout, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, InstructionDebugger, MultiWidget, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };