@paydock/client-sdk 1.117.0 → 1.118.0

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 (47) hide show
  1. package/README.md +14 -11
  2. package/bundles/index.cjs +373 -68
  3. package/bundles/index.cjs.d.ts +46 -13
  4. package/bundles/index.mjs +373 -68
  5. package/bundles/index.mjs.d.ts +46 -13
  6. package/bundles/types/api/api-checkout-internal.d.ts +1 -0
  7. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
  8. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
  9. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +1 -0
  10. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
  11. package/bundles/types/components/param.d.ts +2 -0
  12. package/bundles/types/components/param.d.ts.map +1 -1
  13. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -1
  14. package/bundles/types/index-cba.d.ts +2 -1
  15. package/bundles/types/index-cba.d.ts.map +1 -1
  16. package/bundles/types/index.d.ts +1 -1
  17. package/bundles/types/index.d.ts.map +1 -1
  18. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +4 -4
  19. package/bundles/types/secure-remote-commerce/index.d.ts +1 -0
  20. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  21. package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts +12 -0
  22. package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map +1 -0
  23. package/bundles/types/shared/services/configuration-validation/types.d.ts +73 -0
  24. package/bundles/types/shared/services/configuration-validation/types.d.ts.map +1 -0
  25. package/bundles/types/wallet-buttons/enums.d.ts +12 -0
  26. package/bundles/types/wallet-buttons/enums.d.ts.map +1 -0
  27. package/bundles/types/wallet-buttons/index.d.ts +2 -1
  28. package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
  29. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +28 -15
  30. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
  31. package/bundles/types/wallet-buttons-express/index.d.ts +1 -0
  32. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
  33. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +1 -0
  34. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
  35. package/bundles/types/widget/configuration.d.ts +6 -2
  36. package/bundles/types/widget/configuration.d.ts.map +1 -1
  37. package/bundles/types/widget/multi-widget.d.ts +1 -0
  38. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  39. package/bundles/widget.umd.js +373 -68
  40. package/bundles/widget.umd.js.d.ts +46 -13
  41. package/bundles/widget.umd.js.min.d.ts +46 -13
  42. package/bundles/widget.umd.min.js +1 -61
  43. package/docs/paypal-data-collector-examples.md +6 -5
  44. package/docs/paypal-data-collector.md +6 -6
  45. package/docs/wallet-buttons-express.md +1 -0
  46. package/docs/wallet-buttons.md +1 -0
  47. package/package.json +2 -2
@@ -58,6 +58,7 @@ declare class Env implements IEnvironment {
58
58
  }
59
59
 
60
60
  type HttpRequestMethod = 'DELETE' | 'GET' | 'OPTIONS' | 'POST' | 'PUT';
61
+ type HttpRequestUrl = string | URL;
61
62
 
62
63
  type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
63
64
  type AgentMethodNames = keyof AgentPrototype;
@@ -449,6 +450,7 @@ interface IParams extends IStyles$1, ITexts, ICommonParams {
449
450
  phone_mask_only_countries?: string;
450
451
  language?: string;
451
452
  vault_display_token?: string;
453
+ sdk_origin?: boolean;
452
454
  }
453
455
  interface ICountryPhoneMask {
454
456
  preferred_countries?: string[];
@@ -612,6 +614,7 @@ interface IWalletMeta {
612
614
  amount_label?: string;
613
615
  country?: string;
614
616
  pay_later?: boolean;
617
+ hide_message?: boolean;
615
618
  standalone?: boolean;
616
619
  show_billing_address?: boolean;
617
620
  request_payer_name?: boolean;
@@ -755,6 +758,7 @@ declare const PAYMENT_TYPE: {
755
758
  GIFT_CARD: string;
756
759
  BANK_ACCOUNT: string;
757
760
  CHECKOUT: string;
761
+ BSB: string;
758
762
  };
759
763
  /**
760
764
  * Purposes
@@ -803,8 +807,8 @@ interface IPredefinedFields {
803
807
  declare class Configuration {
804
808
  private configs;
805
809
  private env;
806
- static createEachToken(accessToken: string, configs: Configuration[], cb: (tokens: string[]) => void, errorCb?: (errors: string[]) => void): void;
807
- private static finishCreatingEachToken;
810
+ static createEachToken(accessToken: string, configs: Configuration[]): Promise<string[]>;
811
+ private static addTokenInBase64;
808
812
  /** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: string);
809
813
  /**
810
814
  * Destination, where customer will receive all successful responses.
@@ -895,9 +899,11 @@ declare class Configuration {
895
899
  * @param {createToken~requestCallback} errorCb - The callback that handles the failed response.
896
900
  */
897
901
  createToken(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
902
+ getDefaultGateway<T>(accessToken: string, method: HttpRequestMethod, url: HttpRequestUrl): Promise<T>;
898
903
  private send;
899
904
  getConfigs(): IGeneral;
900
905
  private getUrl;
906
+ private getDefaultGatewayUrl;
901
907
  setGiftCardSchemeData(giftCardScheme: any, processingNetwork: any): void;
902
908
  }
903
909
 
@@ -1918,6 +1924,7 @@ declare class ApiCheckoutInternal {
1918
1924
  protected api: ApiInternal;
1919
1925
  constructor(api: ApiInternal);
1920
1926
  instructions(session_id: string): Observable<object>;
1927
+ private getInstructionLink;
1921
1928
  callback(payload: Object): Promise<Object>;
1922
1929
  status(id: string): Promise<Object>;
1923
1930
  }
@@ -2270,9 +2277,33 @@ interface IWalletUpdate {
2270
2277
  selected_shipping_option?: IShippingOption;
2271
2278
  }
2272
2279
 
2273
- interface IEventData {
2280
+ declare enum EventEnum {
2281
+ UNAVAILABLE = "unavailable",
2282
+ UPDATE = "update",
2283
+ PAYMENT_SUCCESSFUL = "paymentSuccessful",
2284
+ PAYMENT_ERROR = "paymentError",
2285
+ PAYMENT_IN_REVIEW = "paymentInReview",
2286
+ AUTH_TOKENS_CHANGED = "authTokensChanged",
2287
+ ON_CLICK = "onClick",
2288
+ ON_CHECKOUT_OPEN = "onCheckoutOpen",
2289
+ ON_CHECKOUT_CLOSE = "onCheckoutClose"
2290
+ }
2291
+
2292
+ interface IEventData<T = any> {
2274
2293
  event: string;
2275
- data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any;
2294
+ data: T;
2295
+ }
2296
+ interface IWalletPaymentSuccessfulEvent extends IEventData<IWalletPaymentSuccessful> {
2297
+ event: EventEnum.PAYMENT_SUCCESSFUL;
2298
+ }
2299
+ interface IWalletUpdateEvent extends IEventData<IWalletUpdate> {
2300
+ event: EventEnum.UPDATE;
2301
+ }
2302
+ interface IWalletUnavailableEvent extends IEventData<IWalletUnavailable> {
2303
+ event: EventEnum.UNAVAILABLE;
2304
+ }
2305
+ interface IWalletOnClickEvent extends IEventData<IWalletOnClick> {
2306
+ event: EventEnum.ON_CLICK;
2276
2307
  }
2277
2308
  interface IWalletUpdateData {
2278
2309
  success: boolean;
@@ -2417,7 +2448,7 @@ declare class WalletButtons {
2417
2448
  *
2418
2449
  * @param {listener} [handler] - Function to be called when no button is available.
2419
2450
  */
2420
- onUnavailable(handler?: (data: IEventData) => void): Promise<void> | (() => void);
2451
+ onUnavailable(handler?: (data: IWalletUnavailableEvent) => void): Promise<void> | (() => void);
2421
2452
  /**
2422
2453
  * If the wallet performs some update in the checkout process, the function passed as parameter will be called.
2423
2454
  *
@@ -2433,7 +2464,7 @@ declare class WalletButtons {
2433
2464
  *
2434
2465
  * @param {listener} [handler] - Function to be called when the payment was successful.
2435
2466
  */
2436
- onUpdate(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
2467
+ onUpdate(handler?: (data: IWalletUpdateEvent) => void): Promise<unknown> | (() => void);
2437
2468
  /**
2438
2469
  * If the payment was successful, the function passed as parameter will be called.
2439
2470
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
@@ -2448,7 +2479,7 @@ declare class WalletButtons {
2448
2479
  *
2449
2480
  * @param {listener} [handler] - Function to be called when the payment was successful.
2450
2481
  */
2451
- onPaymentSuccessful(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
2482
+ onPaymentSuccessful(handler?: (data: IWalletPaymentSuccessfulEvent) => void): Promise<unknown> | (() => void);
2452
2483
  /**
2453
2484
  * If the payment was left in fraud review, the function passed as parameter will be called.
2454
2485
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
@@ -2510,7 +2541,7 @@ declare class WalletButtons {
2510
2541
  *
2511
2542
  * @param {listener} handler - Function to be called when the wallet button is clicked.
2512
2543
  */
2513
- onClick(handler: (data: IEventData) => void): () => void;
2544
+ onClick(handler: (data: IWalletOnClickEvent) => void): () => void;
2514
2545
  /**
2515
2546
  * Registers a callback function to be invoked when the wallet checkout opens.
2516
2547
  * Note this is supported for FlypayV2 wallet button at the moment.
@@ -2869,6 +2900,7 @@ declare class MultiWidget {
2869
2900
  * @param {string} code - ISO 639-1
2870
2901
  */
2871
2902
  setLanguage(code: any): void;
2903
+ getLink(): Link;
2872
2904
  }
2873
2905
 
2874
2906
  interface IEventMetaData extends IEventData$1 {
@@ -3733,6 +3765,7 @@ declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalle
3733
3765
 
3734
3766
  interface PaypalWalletMeta extends BaseWalletMeta {
3735
3767
  pay_later?: boolean;
3768
+ hide_message?: boolean;
3736
3769
  standalone?: boolean;
3737
3770
  capture?: boolean;
3738
3771
  style?: {
@@ -3826,8 +3859,8 @@ interface IOnErrorEventData$1 {
3826
3859
  /**
3827
3860
  * PayPal Data Collector Widget constructor
3828
3861
  *
3829
- * @param {string} flowId - This string identifies the source website of the FraudNet request.
3830
- * @param {PayPalDataCollectorConfig} config - Extra configuration for the widget.
3862
+ * @param {string} [flowId] - This string identifies the source website of the FraudNet request.
3863
+ * @param {PayPalDataCollectorConfig} [config] - Extra configuration for the widget.
3831
3864
  *
3832
3865
  * @example
3833
3866
  * var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
@@ -3838,9 +3871,9 @@ declare class PayPalDataCollector {
3838
3871
  /** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
3839
3872
  /**
3840
3873
  * After configuring the PayPalDataCollector Widget, starts the process and returns
3841
- * the correlation id used among the requests.
3874
+ * the correlation id used among the requests asynchronously.
3842
3875
  *
3843
- * @returns {Promise<CollectedDeviceData>} Promise when resolved, returnsa an object
3876
+ * @returns {Promise<CollectedDeviceData>} Promise when resolved, returns an object
3844
3877
  * that contains the `correlation_id` key.
3845
3878
  *
3846
3879
  * @example
@@ -4016,4 +4049,4 @@ declare class PayPalSavePaymentSourceWidget {
4016
4049
  onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
4017
4050
  }
4018
4051
 
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 };
4052
+ 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 IClickToPayMeta, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IEventData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, type IWalletMeta, type IWalletOnClickEvent, type IWalletPaymentSuccessfulEvent, type IWalletUnavailableEvent, type IWalletUpdateData, type IWalletUpdateEvent, 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 };