@paydock/client-sdk 1.104.3-beta → 1.104.7-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.
Files changed (128) hide show
  1. package/README.md +729 -405
  2. package/bundles/index.cjs +29624 -8753
  3. package/bundles/index.cjs.d.ts +484 -381
  4. package/bundles/index.cjs.map +1 -1
  5. package/bundles/index.mjs +29624 -8753
  6. package/bundles/index.mjs.d.ts +484 -381
  7. package/bundles/index.mjs.map +1 -1
  8. package/bundles/types/api/api-base.d.ts +14 -6
  9. package/bundles/types/api/api-base.d.ts.map +1 -1
  10. package/bundles/types/api/api-service-internal.d.ts +2 -1
  11. package/bundles/types/api/api-service-internal.d.ts.map +1 -1
  12. package/bundles/types/api/api.d.ts +1 -1
  13. package/bundles/types/api/api.d.ts.map +1 -1
  14. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +1 -1
  15. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  16. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +3 -3
  17. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
  18. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -1
  19. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -1
  20. package/bundles/types/checkout-button/checkout-button.d.ts +1 -1
  21. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -1
  22. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +1 -1
  23. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -1
  24. package/bundles/types/checkout-button/runner/popup.runner.d.ts +1 -1
  25. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -1
  26. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -1
  27. package/bundles/types/components/container.d.ts +1 -0
  28. package/bundles/types/components/container.d.ts.map +1 -1
  29. package/bundles/types/components/http-core.d.ts.map +1 -1
  30. package/bundles/types/components/iframe-event.d.ts +17 -11
  31. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  32. package/bundles/types/components/link.d.ts +3 -2
  33. package/bundles/types/components/link.d.ts.map +1 -1
  34. package/bundles/types/components/param.d.ts +6 -8
  35. package/bundles/types/components/param.d.ts.map +1 -1
  36. package/bundles/types/components/wallet-background.d.ts +2 -1
  37. package/bundles/types/components/wallet-background.d.ts.map +1 -1
  38. package/bundles/types/configs/env/environment.cba.d.ts +1 -1
  39. package/bundles/types/configs/env/environment.cba.d.ts.map +1 -1
  40. package/bundles/types/configs/env/environment.paydock.d.ts +1 -1
  41. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -1
  42. package/bundles/types/constants/validators.d.ts +45 -0
  43. package/bundles/types/constants/validators.d.ts.map +1 -0
  44. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +17 -13
  45. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -1
  46. package/bundles/types/payment-source-widget/payment-source-widget.d.ts +1 -1
  47. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -1
  48. package/bundles/types/secure-remote-commerce/index.d.ts +102 -1
  49. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  50. package/bundles/types/secure-remote-commerce/interfaces.d.ts +109 -32
  51. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  52. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +31 -0
  53. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +1 -0
  54. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  55. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  56. package/bundles/types/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +5 -8
  57. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  58. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
  59. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
  60. package/bundles/types/shared/http/http-request.d.ts +14 -0
  61. package/bundles/types/shared/http/http-request.d.ts.map +1 -0
  62. package/bundles/types/shared/http/index.d.ts +2 -0
  63. package/bundles/types/shared/http/index.d.ts.map +1 -0
  64. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
  65. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
  66. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
  67. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
  68. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
  69. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
  70. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
  71. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
  72. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
  73. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
  74. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
  75. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
  76. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
  77. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
  78. package/bundles/types/vault-display-widget/vault-display-widget.d.ts +1 -1
  79. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
  80. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts +2 -0
  81. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -1
  82. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -1
  83. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -1
  84. package/bundles/types/wallet-buttons/google.wallet-service.d.ts +7 -4
  85. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -1
  86. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +4 -0
  87. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  88. package/bundles/types/wallet-buttons/index.d.ts +126 -0
  89. package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
  90. package/bundles/types/wallet-buttons/interfaces.d.ts +3 -0
  91. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  92. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -1
  93. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +63 -121
  94. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
  95. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +1 -1
  96. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
  97. package/bundles/types/wallet-buttons/wallet-service.d.ts +7 -0
  98. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -1
  99. package/bundles/types/widget/configuration.d.ts +1 -1
  100. package/bundles/types/widget/configuration.d.ts.map +1 -1
  101. package/bundles/types/widget/html-multi-widget.d.ts +147 -76
  102. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
  103. package/bundles/types/widget/html-widget.d.ts +1 -1
  104. package/bundles/types/widget/html-widget.d.ts.map +1 -1
  105. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  106. package/bundles/widget.umd.js +29624 -8753
  107. package/bundles/widget.umd.js.d.ts +484 -381
  108. package/bundles/widget.umd.js.map +1 -1
  109. package/bundles/widget.umd.js.min.d.ts +484 -381
  110. package/bundles/widget.umd.min.js +62 -1
  111. package/bundles/widget.umd.min.js.map +1 -1
  112. package/docs/api-ps-widget.md +12 -12
  113. package/docs/api-widget.md +211 -156
  114. package/docs/license.md +1 -1
  115. package/docs/secure-remote-commerce-examples.md +75 -101
  116. package/docs/secure-remote-commerce.md +185 -114
  117. package/docs/wallet-buttons-examples.md +48 -19
  118. package/docs/wallet-buttons.md +197 -2
  119. package/examples/multi-html-widget/simple.html +2 -1
  120. package/package.json +18 -15
  121. package/slate.md +123 -120
  122. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
  123. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
  124. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
  125. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
  126. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
  127. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
  128. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
@@ -1,3 +1,5 @@
1
+ import { MicroAgent } from '@newrelic/browser-agent/loaders/micro-agent';
2
+
1
3
  declare class ApiCharge {
2
4
  protected api: Api;
3
5
  constructor(api: Api);
@@ -54,6 +56,57 @@ declare class Env implements IEnvironment {
54
56
  private isValidMode;
55
57
  }
56
58
 
59
+ type HttpRequestMethod = 'DELETE' | 'GET' | 'OPTIONS' | 'POST' | 'PUT';
60
+
61
+ type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
62
+ type AgentMethodNames = keyof AgentPrototype;
63
+ type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
64
+ declare class InstrumentationAgent extends MicroAgent {
65
+ private static agent;
66
+ private static available;
67
+ private static initialized;
68
+ private constructor();
69
+ static get instance(): InstrumentationAgent;
70
+ isAvailable(): boolean;
71
+ call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
72
+ }
73
+
74
+ interface CustomEventDTO {
75
+ environment: string;
76
+ appId?: never;
77
+ timestamp?: never;
78
+ [x: string]: unknown;
79
+ }
80
+ interface ReportBaseContext {
81
+ environment: string;
82
+ sdkVersion: string | null;
83
+ description?: string;
84
+ [x: string]: SerializableValue | undefined;
85
+ }
86
+ type SerializableValue = string | number | symbol | object | null;
87
+
88
+ type ReportErrorFn = (repository: ErrorRepository, error: string | Error, ctx: ReportBaseContext & ({
89
+ className: string;
90
+ classMethod: string;
91
+ functionName?: never;
92
+ } | {
93
+ className?: never;
94
+ classMethod?: never;
95
+ functionName: string;
96
+ })) => void;
97
+ declare class ErrorRepository {
98
+ private readonly agent;
99
+ constructor();
100
+ createError(...args: Parameters<InstrumentationAgent['noticeError']>): Promise<void>;
101
+ }
102
+
103
+ type ReportEventFn = (repository: EventRepository, actionName: string, ctx: ReportBaseContext & CustomEventDTO) => void;
104
+ declare class EventRepository {
105
+ private readonly agent;
106
+ constructor();
107
+ createEvent(...args: Parameters<InstrumentationAgent['addPageAction']>): Promise<void>;
108
+ }
109
+
57
110
  declare enum API_AUTH_TYPE {
58
111
  PUBLIC_KEY = 0,
59
112
  TOKEN = 1
@@ -74,11 +127,11 @@ declare class ApiBase {
74
127
  */
75
128
  setEnv(env: string, alias?: string): ApiBase;
76
129
  setAuthType(): API_AUTH_TYPE;
77
- getClient(method: 'GET' | 'POST', link: string): {
130
+ getClient(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
78
131
  config: XMLHttpRequest;
79
- send: (body: any, cb?: (data: any) => void, errorCb?: (data: any) => void) => void;
132
+ send: (body: any, cb?: (data) => void, errorCb?: (data: any) => any) => void;
80
133
  };
81
- getClientPromise<Req extends object, Res>(method: 'GET' | 'POST', link: string): {
134
+ getClientPromise<Req extends object, Res>(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
82
135
  config: XMLHttpRequest;
83
136
  send: (body: Req) => Promise<Res>;
84
137
  };
@@ -90,7 +143,14 @@ declare class ApiBase {
90
143
  text: string;
91
144
  status: number;
92
145
  }): Promise<Res>;
93
- setAuthHeader(request: XMLHttpRequest): void;
146
+ reportEvent: ReportEventFn;
147
+ reportError: ReportErrorFn;
148
+ protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
149
+ protected get ctx(): {
150
+ sdkVersion: string;
151
+ className: string;
152
+ environment: string;
153
+ };
94
154
  }
95
155
 
96
156
  interface BrowserDetails {
@@ -126,7 +186,7 @@ interface BrowserDetails {
126
186
  **/
127
187
  declare class Api extends ApiBase {
128
188
  publicKey: String;
129
- constructor(publicKey: string);
189
+ /** @constructs */ constructor(publicKey: string);
130
190
  /**
131
191
  * Method for getting browser details
132
192
  *
@@ -145,51 +205,48 @@ declare class Api extends ApiBase {
145
205
  charge(): ApiCharge;
146
206
  }
147
207
 
148
- interface IVisaSRCMeta {
149
- srci_transaction_id?: string;
150
- dpa_data?: {
151
- dpa_presentation_name?: string;
152
- dpa_uri?: string;
153
- };
154
- dpa_transaction_options?: {
155
- dpa_locale?: string;
156
- dpa_accepted_billing_countries?: string[];
157
- dpa_accepted_shipping_countries?: string[];
158
- dpa_billing_preference?: DPA_SHIPPING_BILLING_PREFERENCE;
159
- dpa_shipping_preference?: DPA_SHIPPING_BILLING_PREFERENCE;
160
- consumer_name_requested?: boolean;
161
- consumer_email_address_requested?: boolean;
162
- consumer_phone_number_requested?: boolean;
163
- payment_options?: {
164
- dpa_dynamic_data_ttl_minutes?: number;
165
- dynamic_data_type?: DPA_DYNAMIC_DATA_TYPE;
166
- dpa_pan_requested?: boolean;
167
- };
168
- review_action?: REVIEW_ACTION;
169
- checkout_description?: string;
170
- transaction_type?: TRANSACTION_TYPE;
171
- order_type?: ORDER_TYPE;
172
- transaction_amount?: {
173
- transaction_amount?: number;
174
- transaction_currency_code?: string;
175
- };
176
- merchant_order_id?: string;
177
- merchant_category_code?: string;
178
- merchant_country_code?: string;
179
- };
180
- customizations: IStyles$1;
181
- }
182
- type DPA_SHIPPING_BILLING_PREFERENCE = 'ALL' | 'POSTAL_COUNTRY' | 'NONE';
183
- type DPA_DYNAMIC_DATA_TYPE = 'TAVV' | 'DTVV';
184
- type REVIEW_ACTION = 'pay' | 'continue';
185
- type TRANSACTION_TYPE = 'PURCHASE' | 'BILL_PAYMENT' | 'MONEY_TRANSFER';
186
- type ORDER_TYPE = 'REAUTHORIZATION' | 'RECURRING' | 'INSTALLMENT';
187
- interface IStyles$1 {
188
- button_text_color?: string;
189
- primary_color?: string;
190
- font_family?: string;
191
- card_schemes?: string[];
192
- }
208
+ /**
209
+ * List of available form field validators dedicated to cards and their definition
210
+ *
211
+ * @const CARD_VALIDATORS
212
+ *
213
+ * @type {Record<string, string>}
214
+ *
215
+ * @param {string} CVV=cardCvvValidation
216
+ * Asserts that CVV contains zero or more digits and is a number
217
+ * @param {string} EXPIRY_DATE=expireDateValidation
218
+ * Asserts value is a date in the future with format MM/YY
219
+ * @param {string} HOLDER_NAME=cardHoldernameValidation
220
+ * Asserts value is a name that respects the
221
+ ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en)
222
+ * @param {string} NUMBER=cardNumberValidation
223
+ Asserts the value matches a known card scheme and as a the correct length.
224
+ E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card
225
+ * @param {string} PIN=cardPinValidation
226
+ Asserts the value is a number with exactly 4 digits
227
+ */
228
+ declare const CARD_VALIDATORS: {
229
+ readonly CVV: "cardCvvValidator";
230
+ readonly EXPIRY_DATE: "expireDateValidation";
231
+ readonly HOLDER_NAME: "cardHoldernameValidator";
232
+ readonly NUMBER: "cardNumberValidator";
233
+ readonly PIN: "cardPinValidator";
234
+ };
235
+ type CardValidatorValue = typeof CARD_VALIDATORS[keyof typeof CARD_VALIDATORS];
236
+ /**
237
+ * List of available generic form field validators and their definition
238
+ *
239
+ * @const GENERIC_VALIDATORS
240
+ *
241
+ * @type {Record<string, string>}
242
+ *
243
+ * @param {string} REQUIRED=required
244
+ * Asserts the input or form field has a value defined truthy value
245
+ */
246
+ declare const GENERIC_VALIDATORS: {
247
+ readonly REQUIRED: "required";
248
+ };
249
+ type GenericValidatorValue = typeof GENERIC_VALIDATORS[keyof typeof GENERIC_VALIDATORS];
193
250
 
194
251
  declare const FORM_FIELD: {
195
252
  CARD_NAME: string;
@@ -310,18 +367,15 @@ interface IFormElement {
310
367
  placeholder?: string;
311
368
  value?: string;
312
369
  }
370
+ type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
371
+ type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
313
372
  interface IFormValidation {
314
373
  form_valid?: boolean;
315
374
  invalid_fields?: string[];
316
375
  invalid_showed_fields?: string[];
317
- validators?: IValidators;
376
+ validators?: ValidatorFieldsMap;
318
377
  }
319
- interface IValidators {
320
- required?: string[];
321
- cardNumberValidator?: string[];
322
- expireDateValidation?: string[];
323
- }
324
- interface IStyles {
378
+ interface IStyles$1 {
325
379
  background_color?: string;
326
380
  background_active_color?: string;
327
381
  text_color?: string;
@@ -350,18 +404,19 @@ interface ICommonParams {
350
404
  sdk_version?: string;
351
405
  sdk_type?: string;
352
406
  }
353
- interface IVisaSRCParams extends IVisaSRCMeta, ICommonParams {
407
+ interface ISRCParams extends ICommonParams {
354
408
  public_key?: string;
355
409
  service_id?: string;
410
+ meta?: string;
356
411
  }
357
- interface IWalletParams extends IStyles, ITexts, ICommonParams {
412
+ interface IWalletParams extends IStyles$1, ITexts, ICommonParams {
358
413
  token: string;
359
414
  credentials: string;
360
415
  currency: string;
361
416
  amount: number;
362
417
  gateway_mode: string;
363
418
  }
364
- interface IParams extends IStyles, ITexts, ICommonParams {
419
+ interface IParams extends IStyles$1, ITexts, ICommonParams {
365
420
  access_token?: string;
366
421
  public_key?: string;
367
422
  token?: string;
@@ -575,7 +630,7 @@ declare class Link {
575
630
  constructor(linkResource: string);
576
631
  getNetUrl(): string;
577
632
  getUrl(): string;
578
- setParams(params: IParams | IWalletParams | IVisaSRCParams): void;
633
+ setParams(params: IParams | IWalletParams | ISRCParams): void;
579
634
  concatParams(params: IParams): void;
580
635
  getParams(): IParams;
581
636
  setEnv(env: string, alias?: string): void;
@@ -591,6 +646,7 @@ declare class Container {
591
646
  on(name: any, cb: (event: MouseEvent) => void): void;
592
647
  getAttr<T>(allowValue: string[]): T | {};
593
648
  getElement(): Element;
649
+ getSelector(): string;
594
650
  private convertConfigs;
595
651
  }
596
652
 
@@ -611,23 +667,27 @@ declare class IFrame {
611
667
  setStyle(property: string, value: string): void;
612
668
  }
613
669
 
670
+ /**
671
+ * Contains basic information associated with the event.
672
+ *
673
+ * Including event (name), source of the message, purpose and a unique identifier
674
+ * for the event.
675
+ *
676
+ * @interface IEventData
677
+ *
678
+ * @param {string} event The name of the event.
679
+ * @param {string} message_source A system variable that identifies the event source.
680
+ * @param {string} purpose A system variable that states the purpose of the event.
681
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
682
+ */
614
683
  interface IEventData$1 {
615
684
  event: string;
616
- purpose: string;
617
685
  message_source: string;
618
- ref_id?: string;
686
+ purpose: string;
619
687
  widget_id: string;
620
688
  data?: any;
689
+ ref_id?: string;
621
690
  }
622
- /**
623
- * Interface of data from event.
624
- * @interface IEventData
625
- *
626
- * @param {string} event
627
- * @param {string} purpose
628
- * @param {string} message_source
629
- * @param {string} [ref_id]
630
- * */
631
691
  declare const EVENT: {
632
692
  AFTER_LOAD: string;
633
693
  SUBMIT: string;
@@ -639,6 +699,8 @@ declare const EVENT: {
639
699
  CHECKOUT_READY: string;
640
700
  CHECKOUT_ERROR: string;
641
701
  CHECKOUT_COMPLETED: string;
702
+ CHECKOUT_POPUP_OPEN: string;
703
+ CHECKOUT_POPUP_CLOSE: string;
642
704
  VALIDATION: string;
643
705
  SELECT: string;
644
706
  UNSELECT: string;
@@ -733,7 +795,7 @@ declare class Configuration {
733
795
  private env;
734
796
  static createEachToken(accessToken: string, configs: Configuration[], cb: (tokens: string[]) => void, errorCb?: (errors: string[]) => void): void;
735
797
  private static finishCreatingEachToken;
736
- constructor(gatewayID?: string, paymentType?: string, purpose?: string);
798
+ /** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: string);
737
799
  /**
738
800
  * Destination, where customer will receive all successful responses.
739
801
  * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
@@ -907,7 +969,7 @@ declare class Canvas3ds {
907
969
  protected iFrame: IFrame;
908
970
  protected event: IFrameEvent;
909
971
  protected eventEmitter: EventEmitter;
910
- constructor(selector: string, token: string);
972
+ /** @constructs */ constructor(selector: string, token: string);
911
973
  protected static extractToken(token: string): {
912
974
  content: string;
913
975
  format: TOKEN_FORMAT;
@@ -1153,7 +1215,7 @@ declare class CheckoutButton {
1153
1215
  protected checkoutHandler?: CheckoutContextualHandler;
1154
1216
  protected env: string;
1155
1217
  protected alias?: string;
1156
- constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
1218
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
1157
1219
  protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
1158
1220
  protected buildAdditionalParams(): AdditionalParams;
1159
1221
  protected initCheckout(container: Container): void;
@@ -1276,7 +1338,7 @@ declare class ZipmoneyCheckoutButton extends CheckoutButton {
1276
1338
  protected publicKey: string;
1277
1339
  protected gatewayId: string;
1278
1340
  protected mode: CHECKOUT_MODE;
1279
- constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
1341
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
1280
1342
  /**
1281
1343
  * Method for setting suspended redirect uri. Redirect after referred checkout
1282
1344
  *
@@ -1320,7 +1382,7 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
1320
1382
  protected accessToken: string;
1321
1383
  protected gatewayId: string;
1322
1384
  protected showETP: boolean;
1323
- constructor(selector: string, accessToken: string, gatewayId?: string);
1385
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
1324
1386
  /**
1325
1387
  * Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
1326
1388
  *
@@ -1352,7 +1414,7 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
1352
1414
  declare class PaypalCheckoutButton extends CheckoutButton {
1353
1415
  protected publicKey: string;
1354
1416
  protected gatewayId: string;
1355
- constructor(selector: string, publicKey: string, gatewayId?: string);
1417
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
1356
1418
  }
1357
1419
 
1358
1420
  /**
@@ -1374,7 +1436,7 @@ declare class PaymentSourceWidget {
1374
1436
  protected configs: Configuration[];
1375
1437
  protected configTokens: string[];
1376
1438
  protected publicKey: string;
1377
- constructor(accessToken: string, queryToken: string);
1439
+ /** @constructs */ constructor(accessToken: string, queryToken: string);
1378
1440
  /**
1379
1441
  * Object contain styles for widget
1380
1442
  *
@@ -1388,7 +1450,7 @@ declare class PaymentSourceWidget {
1388
1450
  * });
1389
1451
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1390
1452
  */
1391
- setStyles(styles: IStyles): void;
1453
+ setStyles(styles: IStyles$1): void;
1392
1454
  setStyle(param: string, value: string): void;
1393
1455
  /**
1394
1456
  * Current method can set custom ID to identify the data in the future
@@ -1473,6 +1535,7 @@ interface IEventSizeData extends IEventData$1 {
1473
1535
  }
1474
1536
  /**
1475
1537
  * Interface of data from event.
1538
+ *
1476
1539
  * @interface IEventSelectData
1477
1540
  *
1478
1541
  * @param {string} event
@@ -1494,6 +1557,7 @@ interface IEventSizeData extends IEventData$1 {
1494
1557
  * */
1495
1558
  /**
1496
1559
  * Interface of data from event.
1560
+ *
1497
1561
  * @interface IEventPaginationData
1498
1562
  *
1499
1563
  * @param {string} event
@@ -1506,12 +1570,13 @@ interface IEventSizeData extends IEventData$1 {
1506
1570
  * */
1507
1571
  /**
1508
1572
  * Interface of data from event.
1573
+ *
1509
1574
  * @interface IEventAfterLoadData
1510
1575
  *
1511
- * @param {string} event Event name
1512
- * @param {string} purpose System variable. Purpose of event
1513
- * @param {string} message_source System variable. Event source
1514
- * @param {string} [ref_id] Custom value for identify result of processed operation
1576
+ * @param {string} event The name of the event.
1577
+ * @param {string} purpose A system variable that states the purpose of the event.
1578
+ * @param {string} message_source A system variable that identifies the event source.
1579
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1515
1580
  * @param {number} total_item Pagination param. Total item count
1516
1581
  * @param {number} skip Pagination param. Skip items from first item
1517
1582
  * @param {number} limit Pagination param. Query limit
@@ -1520,24 +1585,25 @@ interface IEventSizeData extends IEventData$1 {
1520
1585
  * Interface of data from event.
1521
1586
  * @interface IEventFinishData
1522
1587
  *
1523
- * @param {string} event Event name
1524
- * @param {string} purpose System variable. Purpose of event
1525
- * @param {string} message_source System variable. Event source
1526
- * @param {string} [ref_id] Custom value for identify result of processed operation
1588
+ * @param {string} event The name of the event.
1589
+ * @param {string} purpose A system variable that states the purpose of the event.
1590
+ * @param {string} message_source A system variable that identifies the event source.
1591
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1527
1592
  * */
1528
1593
  /**
1529
1594
  * Interface of data from event.
1530
1595
  * @interface IEventSizeData
1531
1596
  *
1532
- * @param {number} event Event name
1533
- * @param {number} purpose System variable. Purpose of event
1534
- * @param {string} message_source System variable. Event source
1535
- * @param {string} [ref_id] Custom value for identify result of processed operation
1597
+ * @param {number} event The name of the event.
1598
+ * @param {number} purpose A system variable that states the purpose of the event.
1599
+ * @param {string} message_source A system variable that identifies the event source.
1600
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1536
1601
  * @param {number} height Height of iFrame
1537
1602
  * @param {number} width Width of iFrame
1538
1603
  * */
1539
1604
  /**
1540
1605
  * List of available event's name
1606
+ *
1541
1607
  * @const EVENT
1542
1608
  *
1543
1609
  * @type {object}
@@ -1566,7 +1632,7 @@ declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
1566
1632
  protected container: Container;
1567
1633
  protected iFrame: IFrame;
1568
1634
  protected event: IFrameEvent;
1569
- constructor(selector: string, publicKey: string, queryToken: string);
1635
+ /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
1570
1636
  /**
1571
1637
  * The final method to beginning, the load process of widget to html
1572
1638
  *
@@ -1636,6 +1702,79 @@ declare class Builder extends HttpCore {
1636
1702
  getConfigs(): IBody;
1637
1703
  }
1638
1704
 
1705
+ interface IBaseSRCMeta {
1706
+ customizations?: IStyles;
1707
+ dpa_data?: {
1708
+ dpa_presentation_name?: string;
1709
+ dpa_uri?: string;
1710
+ };
1711
+ dpa_transaction_options?: {
1712
+ dpa_locale?: string;
1713
+ dpa_accepted_billing_countries?: string[];
1714
+ consumer_name_requested?: boolean;
1715
+ consumer_email_address_requested?: boolean;
1716
+ consumer_phone_number_requested?: boolean;
1717
+ transaction_amount?: {
1718
+ transaction_amount?: number;
1719
+ transaction_currency_code?: string;
1720
+ };
1721
+ merchant_order_id?: string;
1722
+ merchant_category_code?: string;
1723
+ merchant_country_code?: string;
1724
+ };
1725
+ }
1726
+ interface PhoneNumber {
1727
+ country_code: string;
1728
+ phone_number: string;
1729
+ }
1730
+ interface Customer {
1731
+ email?: string;
1732
+ phone?: {
1733
+ country_code?: string;
1734
+ phone?: string;
1735
+ };
1736
+ first_name?: string;
1737
+ last_name?: string;
1738
+ }
1739
+ interface IMastercardSRCMeta extends IBaseSRCMeta {
1740
+ dpa_data?: IBaseSRCMeta['dpa_data'] & {
1741
+ dpa_address?: string;
1742
+ dpa_email_address?: string;
1743
+ dpa_phone_number?: PhoneNumber;
1744
+ dpa_logo_uri?: string;
1745
+ dpa_supported_email_address?: string;
1746
+ dpa_supported_phone_number?: PhoneNumber;
1747
+ dpa_uri?: string;
1748
+ dpa_support_uri?: string;
1749
+ application_type?: 'WEB_BROWSER' | 'MOBILE_APP';
1750
+ };
1751
+ disable_summary_screen?: boolean;
1752
+ co_brand_names?: string[];
1753
+ checkout_experience?: 'WITHIN_CHECKOUT' | 'PAYMENT_SETTINGS';
1754
+ services?: 'INLINE_CHECKOUT' | 'INLINE_INSTALLMENTS';
1755
+ dpa_transaction_options?: IBaseSRCMeta['dpa_transaction_options'] & {
1756
+ dpa_billing_preference?: MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE;
1757
+ payment_options?: Array<{
1758
+ dynamic_data_type?: string;
1759
+ }>;
1760
+ order_type?: MASTERCARD_ORDER_TYPE;
1761
+ three_ds_preference?: string;
1762
+ confirm_payment?: boolean;
1763
+ };
1764
+ customer?: Customer;
1765
+ unaccepted_card_type?: 'CREDIT' | 'DEBIT';
1766
+ }
1767
+ type MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE = 'FULL' | 'POSTAL_COUNTRY' | 'NONE';
1768
+ type MASTERCARD_ORDER_TYPE = 'SPLIT_SHIPMENT' | 'PREFERRED_CARD';
1769
+ interface IStyles {
1770
+ primary_button_color?: string;
1771
+ secondary_button_color?: string;
1772
+ primary_button_text_color?: string;
1773
+ secondary_button_text_color?: string;
1774
+ font_family?: string;
1775
+ enable_src_popup?: boolean;
1776
+ }
1777
+
1639
1778
  declare class ApiChargeInternal {
1640
1779
  protected api: ApiInternal;
1641
1780
  constructor(api: ApiInternal);
@@ -1762,98 +1901,35 @@ interface SRCProvider {
1762
1901
  useAutoResize?(): void;
1763
1902
  }
1764
1903
 
1765
- /**
1766
- * Interface of data used for the Visa Checkout.
1767
- * @interface IVisaSRCMeta
1768
- *
1769
- * @type {object}
1770
- * @param {string} [srci_transaction_id] Used to identify the SRC Id.
1771
- * @param {object} [dpa_data] Object where the DPA creation data is stored.
1772
- * @param {string} [dpa_data.dpa_presentation_name] Name in which the DPA is presented in.
1773
- * @param {string} [dpa_data.dpa_uri] Used for indicating the DPA URI.
1774
- * @param {object} [dpa_transaction_options] Object that stores options for creating a trasaction with DPA.
1775
- * @param {string} [dpa_transaction_options.dpa_locale] DPA’s preferred locale, example en_US.
1776
- * @param {Array} [dpa_transaction_options.dpa_accepted_billing_countries] Used to indicate list of accepted billing countries for DPA.
1777
- * @param {Array} [dpa_transaction_options.dpa_accepted_shipping_countries] Used to indicate list of accepted shipping countries for DPA.
1778
- * @param {string} [dpa_transaction_options.dpa_billing_preference] Used for listing the enumeration for billing preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
1779
- * @param {string} [dpa_transaction_options.dpa_shipping_preference] Used for listing the enumeration for shipping preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
1780
- * @param {boolean} [dpa_transaction_options.consumer_name_requested] Used to check if the name of the consumer is needed.
1781
- * @param {boolean} [dpa_transaction_options.consumer_email_address_requested] Used to check if the email of the consumer is needed.
1782
- * @param {boolean} [dpa_transaction_options.consumer_phone_number_requested] Used to check if the phone number of the consumer is needed.
1783
- * @param {object} [dpa_transaction_options.payment_options] Object used to check the payment options that are included.
1784
- * @param {number} [dpa_transaction_options.payment_options.dpa_dynamic_data_ttl_minutes] The minimum requested validity period for the transaction credentials.
1785
- * @param {string} [dpa_transaction_options.payment_options.dynamic_data_type] Used for listing the enumeration for dynamic data types. Options are 'TAVV' and 'DTVV'.
1786
- * @param {boolean} [dpa_transaction_options.payment_options.dpa_pan_requested] Used to check if PAN number was requested.
1787
- * @param {string} [dpa_transaction_options.review_action] Used for listing the enumeration of review actions. Options are 'pay' and 'continue'.
1788
- * @param {string} [dpa_transaction_options.checkout_description] Used for indicating the description of the checkout.
1789
- * @param {string} [dpa_transaction_options.transaction_type] Used for listing the enumeration of the type of the transaction. 'PURCHASE', 'BILL_PAYMENT' and 'MONEY_TRANSFER'
1790
- * @param {string} [dpa_transaction_options.order_type] Used for listing the enumeration of the type of the order. Options are 'REAUTHORIZATION', 'RECURRING' and 'INSTALLMENT'.
1791
- * @param {object} [dpa_transaction_options.transaction_amount] Object used to describe the details of the transaction.
1792
- * @param {number} [dpa_transaction_options.transaction_amount.transaction_amount] Used to indicate the amount of the transaction.
1793
- * @param {string} [dpa_transaction_options.transaction_amount.transaction_currency_code] Used to indicate the currency code of the transaction. 3 letter ISO code format.
1794
- * @param {string} [dpa_transaction_options.merchant_order_id] Used to indicate the merchants order Id.
1795
- * @param {string} [dpa_transaction_options.merchant_category_code] Used to indicate the merchants category code.
1796
- * @param {string} [dpa_transaction_options.merchant_country_code] Used to indicate the merchants country code. 2 letter ISO code format.
1797
- * @param {object} [customer] Object where the customer data is stored to prefill in the checkout.
1798
- * @param {string} [customer.email] Customer email.
1799
- * @param {string} [customer.first_name] Customer first name.
1800
- * @param {string} [customer.last_name] Customer last name.
1801
- * @param {object} [customer.phone] Object where the customer phone is stored.
1802
- * @param {string} [customer.phone.country_code] Customer phone country code (example "1" for US).
1803
- * @param {string} [customer.phone.phone] Customer phone number.
1804
- * @param {object} [customer.payment_source] Object where the customer billing address data is stored.
1805
- * @param {string} [customer.payment_source.address_line1] Customer billing address line 1.
1806
- * @param {string} [customer.payment_source.address_line2] Customer billing address line 2.
1807
- * @param {string} [customer.payment_source.address_city] Customer billing address city.
1808
- * @param {string} [customer.payment_source.address_postcode] Customer billing address postcode.
1809
- * @param {string} [customer.payment_source.address_state] Customer billing address state code (if applicable for the country, example "FL" for Florida).
1810
- * @param {string} [customer.payment_source.address_country] Customer billing address country code (example "US").
1811
- */
1812
- /**
1813
- * Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
1814
- * @constructor
1815
- *
1816
- * @param {string} button_selector - Selector of html element. Container for SRC checkout button.
1817
- * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
1818
- * @param {string} service_id - Card Scheme Service ID
1819
- * @param {string} public_key_or_access_token - Paydock public key or Access Token
1820
- * @param {IVisaSRCMeta} meta - Data that configures the SRC checkout
1821
- * @example
1822
- * var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
1823
- *
1824
- */
1825
- declare class SRC {
1826
- protected button_selector: string;
1904
+ declare abstract class SRC {
1827
1905
  protected iframe_selector: string;
1828
1906
  protected service_id: string;
1829
1907
  protected public_key_or_access_token: string;
1830
- protected meta: IVisaSRCMeta;
1908
+ protected meta: IMastercardSRCMeta;
1831
1909
  protected eventEmitter: EventEmitter;
1832
1910
  protected env: string;
1833
- protected alias: string;
1911
+ protected alias?: string;
1834
1912
  protected api: ApiInternal;
1835
1913
  protected provider: SRCProvider;
1836
1914
  protected autoResize: boolean;
1837
- protected style: IStyles$1;
1838
- constructor(button_selector: string, iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IVisaSRCMeta);
1915
+ protected style: IStyles;
1916
+ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
1839
1917
  /**
1840
1918
  * Object contain styles for widget - call before `.load()`.
1841
1919
  *
1842
1920
  * @example
1843
1921
  * widget.setStyles({
1844
- * button_text_color: '#32a852',
1845
- * primary_color: '#32a852',
1846
- * font_family: 'sans-serif',
1847
- * card_schemes: ['visa']
1848
- * });
1922
+ * enable_src_popup: true
1923
+ * primary_button_color: 'red',
1924
+ * secondary_button_color: 'blue',
1925
+ * primary_button_text_color: 'white',
1926
+ * secondary_button_text_color: 'white',
1927
+ * font_family: 'Arial',
1928
+ * });
1849
1929
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1850
1930
  */
1851
- setStyles(styles: IStyles$1): void;
1931
+ setStyles(styles: IStyles): void;
1852
1932
  private setStyle;
1853
- /**
1854
- * The final method after configuring the SRC to start the load process of SRC checkout
1855
- *
1856
- */
1857
1933
  load(): void;
1858
1934
  /**
1859
1935
  * Current method can change environment. By default environment = sandbox.
@@ -1874,21 +1950,6 @@ declare class SRC {
1874
1950
  getEnv(): string;
1875
1951
  on(eventName: string): Promise<any>;
1876
1952
  on(eventName: string, cb: (data: any) => void): any;
1877
- /**
1878
- * Using this method you can hide button
1879
- * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
1880
- *
1881
- * @example
1882
- * SRC.hideButton();
1883
- */
1884
- hideButton(saveSize: boolean): void;
1885
- /**
1886
- * Using this method you can show the SRC button after using hideButton method
1887
- *
1888
- * @example
1889
- * SRC.showButton();
1890
- */
1891
- showButton(): void;
1892
1953
  /**
1893
1954
  * Using this method you can hide checkout after load and button click
1894
1955
  * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
@@ -1921,6 +1982,34 @@ declare class SRC {
1921
1982
  useAutoResize(): void;
1922
1983
  }
1923
1984
 
1985
+ /**
1986
+ * Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
1987
+ *
1988
+ * @extends SRC
1989
+ *
1990
+ * @constructor
1991
+ *
1992
+ * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
1993
+ * @param {string} service_id - Card Scheme Service ID
1994
+ * @param {string} public_key_or_access_token - Paydock public key or Access Token
1995
+ * @param {IMastercardSRCMeta} meta - Data that configures the SRC checkout
1996
+ * @example
1997
+ * var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
1998
+ *
1999
+ */
2000
+ declare class MastercardSRCClickToPay extends SRC {
2001
+ protected iframe_selector: string;
2002
+ protected service_id: string;
2003
+ protected public_key_or_access_token: string;
2004
+ protected meta: IMastercardSRCMeta;
2005
+ /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
2006
+ /**
2007
+ * The final method after configuring the SRC to start the load process of SRC checkout
2008
+ *
2009
+ */
2010
+ load(): void;
2011
+ }
2012
+
1924
2013
  interface ITriggerData {
1925
2014
  configuration_token?: string;
1926
2015
  tab_number?: number;
@@ -1986,7 +2075,7 @@ declare class VaultDisplayWidget {
1986
2075
  protected vaultDisplayToken: string;
1987
2076
  protected link: Link;
1988
2077
  protected configs: any[];
1989
- constructor(selector: string, token: string);
2078
+ /** @constructs */ constructor(selector: string, token: string);
1990
2079
  /**
1991
2080
  * Current method can change environment. By default environment = sandbox.
1992
2081
  * Also we can change domain alias for this environment. By default domain_alias = paydock.com
@@ -2019,7 +2108,7 @@ declare class VaultDisplayWidget {
2019
2108
  * });
2020
2109
  * @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
2021
2110
  */
2022
- setStyles(styles: IStyles): void;
2111
+ setStyles(styles: IStyles$1): void;
2023
2112
  setStyle(param: string, value: string): void;
2024
2113
  /**
2025
2114
  * The final method to beginning, the load process of widget to html
@@ -2040,6 +2129,9 @@ interface IWalletPaymentSuccessful {
2040
2129
  interface IWalletUnavailable {
2041
2130
  wallet?: WALLET_TYPE;
2042
2131
  }
2132
+ interface IWalletOnClick {
2133
+ attachResult: (result: Promise<void> | boolean) => void;
2134
+ }
2043
2135
  interface IWalletUpdate {
2044
2136
  wallet_response_code?: string;
2045
2137
  wallet_order_id?: string;
@@ -2133,135 +2225,19 @@ interface IWalletService {
2133
2225
  load(container: Container): Promise<void>;
2134
2226
  close?(): void;
2135
2227
  update(data: IWalletServiceUpdate): void;
2228
+ enable(): void;
2229
+ disable(): void;
2136
2230
  setEnv(env: string): any;
2137
2231
  on(eventName: string, cb?: (data: IUnavailableWalletEventBody | IPaymentMethodSelectedWalletEventBody | any) => void): any;
2138
2232
  }
2139
2233
 
2140
- /**
2141
- * Interface of data from events.
2142
- * @interface IEventData
2143
- *
2144
- * @param {string} event
2145
- * @param {void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | any} data
2146
- * */
2147
2234
  interface IEventData {
2148
2235
  event: string;
2149
- data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | any;
2236
+ data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any;
2150
2237
  }
2151
- /**
2152
- * Interface of data from a successful payment result.
2153
- * @interface IWalletPaymentSuccessful
2154
- *
2155
- * @param {string} id
2156
- * @param {number} amount
2157
- * @param {string} currency
2158
- * @param {string} status
2159
- * @param {string} [payer_name]
2160
- * @param {string} [payer_email]
2161
- * @param {string} [payer_phone]
2162
- * */
2163
- /**
2164
- * Interface of data from an update event.
2165
- * @interface IWalletUpdate
2166
- *
2167
- * @param {string} [wallet_response_code]
2168
- * @param {string} [wallet_session_id]
2169
- * @param {object} [payment_source]
2170
- * @param {string} [payment_source.wallet_payment_method_id]
2171
- * @param {string} [payment_source.card_number_last4]
2172
- * @param {string} [payment_source.card_scheme]
2173
- * @param {object} [wallet_loyalty_account]
2174
- * @param {string} [wallet_loyalty_account.id]
2175
- * @param {string} [wallet_loyalty_account.barcode]
2176
- * @param {object} [shipping]
2177
- * @param {string} [shipping.address_line1]
2178
- * @param {string} [shipping.address_line2]
2179
- * @param {string} [shipping.address_postcode]
2180
- * @param {string} [shipping.address_city]
2181
- * @param {string} [shipping.address_state]
2182
- * @param {string} [shipping.address_country]
2183
- * @param {string} [shipping.address_company]
2184
- * @param {string} [shipping.post_office_box_number]
2185
- * @param {string} [shipping.wallet_address_id]
2186
- * @param {string} [shipping.wallet_address_name]
2187
- * @param {string} [shipping.wallet_address_created_timestamp]
2188
- * @param {string} [shipping.wallet_address_updated_timestamp]
2189
- * */
2190
- /**
2191
- * Interface of data from an unavailable event.
2192
- * @interface IWalletUnavailable
2193
- *
2194
- * @param {string} [wallet] For gateways with more than one wallet button available (e.g: MPGS with ApplePay and GooglePay). Possible values for wallet are 'apple' or 'google'.
2195
- * */
2196
- /**
2197
- * Interface of data for wallet button `update` call.
2198
- * @interface IWalletUpdateData
2199
- *
2200
- * @param {boolean} success
2201
- * */
2202
2238
  interface IWalletUpdateData {
2203
2239
  success: boolean;
2204
2240
  }
2205
- /**
2206
- * Interface of data used by the wallet checkout and payment proccess.
2207
- * @interface IWalletMeta
2208
- *
2209
- * @type {object}
2210
- * @param {string} [amount_label] Label shown next to the total amount to be paid. Required for [Stripe, ApplePay, GooglePay]. N/A for [FlyPay, Flypay V2, PayPal, Afterpay].
2211
- * @param {string} [country] Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay, GooglePay, Afterpay]. N/A for [FlyPay, Flypay V2, PayPal].
2212
- * @param {boolean} [pay_later] Used to enable Pay Later feature in PayPal Smart Checkout WalletButton integration when available. Optional for [PayPal]. N/A for other wallets.
2213
- * @param {boolean} [standalone] Used to enable Standalone Buttons feature in PayPal Smart Checkout WalletButton integration. Used together with `pay_later`. Optional for [PayPal]. N/A for other wallets.
2214
- * @param {boolean} [show_billing_address] Used to hide/show the billing address on ApplePay and GooglePay popups. Default value is false. Optional for [ApplePay, GooglePay]. N/A for other wallets.
2215
- * @param {boolean} [request_payer_name] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
2216
- * @param {boolean} [request_payer_email] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
2217
- * @param {boolean} [request_payer_phone] Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets.
2218
- * @param {string} [access_token] Used for Flypay V2 express flow. Optional for [Flypay V2]. N/A for other wallets.
2219
- * @param {string} [refresh_token] Used for Flypay V2 express flow. Optional for [Flypay V2]. N/A for other wallets.
2220
- * @param {boolean} [request_shipping] Used to request or not shipping address in the Wallet checkout, being able to handle amount changes via the `update` event. Optional for [FlyPay, PayPal, ApplePay, GooglePay]. N/A for [Flypay V2, Stripe, Afterpay].
2221
- * @param {IApplePayShippingOption[] | IPayPalShippingOption[]} [shipping_options] Used to provide available shipping options.(To use shipping_options the request_shipping flag should be true). Optional for [ApplePay]. N/A for the other wallets.
2222
- * @param {string} [merchant_name] Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets.
2223
- * @param {object} [raw_data_initialization] Used to provide values to initialize wallet with raw data. Optional for [ApplePay]. N/A for the other wallets.
2224
- * @param {object} [style] For **Paypal**: used to style the buttons, check possible values in the [style guide](https://developer.paypal.com/docs/business/checkout/reference/style-guide).
2225
- * When `standalone` and `pay_later`, extra options can be provided in `style.messages` with the [messages style options](https://developer.paypal.com/docs/checkout/pay-later/us/integrate/reference/#stylelayout).
2226
- * Also used at **ApplePay**, **GooglePay** and **Afterpay** to select button type.
2227
- * Optional for [PayPal, ApplePay, GooglePay, Afterpay]. N/A for [Stripe, FlyPay, Flypay V2].
2228
- * @param {object} [style.button_type] Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values at https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css.
2229
- * Also select button type for GooglePay (check GooglePayStyles) and Afterpay (check AfterpayStyles). Optional for [ApplePay, GooglePay, Afterpay]. N/A for other wallets.
2230
- * @param {object} [style.height] Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets.
2231
- * @param {array} [wallets] By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe, ApplePay, GooglePay]. N/A for other wallets.
2232
- */
2233
- /**
2234
- * Interface of Shipping Options for ApplePay
2235
- * @interface IApplePayShippingOption
2236
- *
2237
- * @type {object}
2238
- * @param {string} [id] Identifier of the Shipping Option. Required.
2239
- * @param {string} [label] Identifier of the Shipping Option. Required.
2240
- * @param {string} [amount] Amount of the Shipping Option. Required.
2241
- * @param {string} [detail] Details of the Shipping Option. Required.
2242
- * @param {string} [type] Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional.
2243
- */
2244
- /**
2245
- * Interface of Shipping Options for GooglePay
2246
- * @interface IGooglePayShippingOption
2247
- *
2248
- * @type {object}
2249
- * @param {string} [id] Identifier of the Shipping Option. Required.
2250
- * @param {string} [label] Identifier of the Shipping Option. Required.
2251
- * @param {string} [detail] Details of the Shipping Option. Optional.
2252
- * @param {string} [type] Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional.
2253
- */
2254
- /**
2255
- * Interface of Shipping Options for PayPal
2256
- * @interface IPayPalShippingOption
2257
- *
2258
- * @type {object}
2259
- * @param {string} [id] Identifier of the Shipping Option. Required.
2260
- * @param {string} [label] Identifier of the Shipping Option. Required.
2261
- * @param {string} [amount] Amount of the Shipping Option. Required.
2262
- * @param {string} [currency] Currency of the Shipping Option. Required.
2263
- * @param {string} [type] Type of the Shipping Option. Values can be 'SHIPPING' or 'PICKUP'. Required.
2264
- */
2265
2241
  /**
2266
2242
  * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
2267
2243
  * @constructor
@@ -2279,7 +2255,7 @@ declare class WalletButtons {
2279
2255
  protected service: IWalletService;
2280
2256
  protected eventEmitter: EventEmitter;
2281
2257
  protected hasUpdateHandler: boolean;
2282
- constructor(selector: string, chargeToken: string, meta: IWalletMeta);
2258
+ /** @constructs */ constructor(selector: string, chargeToken: string, meta: IWalletMeta);
2283
2259
  /**
2284
2260
  * Initializes the availability checks and inserts the button if possible.
2285
2261
  * Otherwise function onUnavailable(handler: VoidFunction) will be called.
@@ -2361,6 +2337,20 @@ declare class WalletButtons {
2361
2337
  * @param {string} [alias] - Own domain alias
2362
2338
  */
2363
2339
  setEnv(env: string, alias?: string): void;
2340
+ /**
2341
+ * Current method can enable the payment button. This method is only supported for Flypay V2.
2342
+ *
2343
+ * @example
2344
+ * button.enable();
2345
+ */
2346
+ enable(): void;
2347
+ /**
2348
+ * Current method can disable the payment button. This method is only supported for Flypay V2.
2349
+ *
2350
+ * @example
2351
+ * button.disable('production', 'paydock.com');
2352
+ */
2353
+ disable(): void;
2364
2354
  /**
2365
2355
  * Closes the checkout forcibly. Currently supported in Flypay wallet.
2366
2356
  *
@@ -2467,9 +2457,51 @@ declare class WalletButtons {
2467
2457
  * @param {listener} [handler] - Function to be called when authentication tokens are changed.
2468
2458
  */
2469
2459
  onAuthTokensChanged(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2460
+ /**
2461
+ * Registers a callback function to be invoked when the wallet button gets clicked.
2462
+ * There are two operational modes supported, Synchronous and Asynchronous.
2463
+ * When asynchronous operations need to occur on the callback handler, attaching the Promise via `attachResult` is required to have the wallet wait for a result.
2464
+ * When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
2465
+ * Note this is supported for Paypal, GooglePay and ApplePay wallet buttons at the moment.
2466
+ *
2467
+ * @example
2468
+ * button.onClick((data) => {
2469
+ * performValidationLogic();
2470
+ * });
2471
+ *
2472
+ * @param {listener} handler - Function to be called when the wallet button is clicked.
2473
+ */
2474
+ onClick(handler: (data: IEventData) => void): () => void;
2475
+ /**
2476
+ * Registers a callback function to be invoked when the wallet checkout opens.
2477
+ * Note this is supported for FlypayV2 wallet button at the moment.
2478
+ *
2479
+ * @example
2480
+ * button.onCheckoutOpen((data) => {
2481
+ * console.log('Checkout opens');
2482
+ * });
2483
+ *
2484
+ * @param {listener} handler - Function to be called when the wallet checkout opens.
2485
+ */
2486
+ onCheckoutOpen(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2487
+ /**
2488
+ * Registers a callback function to be invoked when the wallet checkout closes.
2489
+ * Note this is supported for FlypayV2 wallet button at the moment.
2490
+ *
2491
+ * @example
2492
+ * button.onCheckoutClose(() => {
2493
+ * console.log('Wallet checkout closes');
2494
+ * });
2495
+ *
2496
+ * @param {listener} handler - Function to be called when the wallet checkout closes.
2497
+ */
2498
+ onCheckoutClose(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2470
2499
  private setupServiceCallbacks;
2471
2500
  private setupUnavailableCallback;
2472
2501
  private setupUpdateCallback;
2502
+ private setupOnClickCallback;
2503
+ private setupOnCheckoutOpenCallback;
2504
+ private setupOnCheckoutCloseCallback;
2473
2505
  private setupWalletCallback;
2474
2506
  private setupPaymentCallback;
2475
2507
  private setupPaymentSuccessCallback;
@@ -2619,7 +2651,7 @@ declare class MultiWidget {
2619
2651
  * });
2620
2652
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
2621
2653
  */
2622
- setStyles(styles: IStyles): void;
2654
+ setStyles(styles: IStyles$1): void;
2623
2655
  /**
2624
2656
  * Method to set a country code mask for the phone input.
2625
2657
  *
@@ -2803,42 +2835,46 @@ declare class MultiWidget {
2803
2835
  interface IEventMetaData extends IEventData$1 {
2804
2836
  configuration_token: string;
2805
2837
  type: string;
2806
- gateway_type?: string;
2807
- card_number_last4?: string;
2808
- card_scheme?: string;
2809
- card_number_length?: number;
2810
2838
  account_name?: string;
2811
2839
  account_number?: string;
2840
+ card_number_last4?: string;
2841
+ card_number_length?: number;
2842
+ card_scheme?: string;
2843
+ gateway_type?: string;
2812
2844
  }
2813
2845
  interface IEventFinishData extends IEventData$1 {
2814
2846
  payment_source: string;
2815
2847
  }
2816
2848
  /**
2817
2849
  * Interface of data from validation event.
2850
+ *
2818
2851
  * @interface IFormValidation
2819
2852
  *
2820
- * @param {string} event Event name
2821
- * @param {string} purpose System variable. Purpose of event
2822
- * @param {string} message_source System variable. Event source
2823
- * @param {string} [ref_id] Custom value for identify result of processed operation
2824
- * @param {boolean} [form_valid] Form is valid
2825
- * @param {array} [invalid_fields] Invalid form fields
2826
- * @param {array} [invalid_showed_fields] List of fields on which the error is already displayed
2827
- * @param {array} [validators] List of validators with fields
2828
- * */
2853
+ * @param {string} event The name of the event.
2854
+ * @param {string} message_source A system variable that identifies the event source.
2855
+ * @param {string} purpose A system variable that states the purpose of the event.
2856
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2857
+ * @param {boolean} [form_valid] Indicates wether or not the form is valid.
2858
+ * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
2859
+ * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
2860
+ * @param {Partial<Record<CardValidatorValue | GenericValidatorValue, Array<string>>>} [validators] Object containing validator identifiers as keys and the fields subject to that validator as an array of form field names.
2861
+ * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
2862
+ */
2829
2863
  /**
2830
- * Interface of data from event.
2864
+ * Contains basic information associated with the event and additional meta data
2865
+ * specific to the event. E.g., card info, gateway info, etc.
2866
+ *
2831
2867
  * @interface IEventMetaData
2832
2868
  *
2833
- * @param {string} event Event name
2834
- * @param {string} purpose System variable. Purpose of event
2835
- * @param {string} message_source System variable. Event source
2836
- * @param {string} [ref_id] Custom value for identify result of processed operation
2869
+ * @param {string} event The name of the event.
2870
+ * @param {string} purpose A system variable that states the purpose of the event.
2871
+ * @param {string} message_source A system variable that identifies the event source.
2872
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2837
2873
  * @param {string} configuration_token Token received from our API with widget data
2838
2874
  * @param {string} type Payment type 'card', 'bank_account'
2839
2875
  * @param {string} gateway_type Gateway type
2840
2876
  * @param {string} [card_number_last4] Last 4 digit of your card
2841
- * @param {string} [card_scheme] Card scheme
2877
+ * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
2842
2878
  * @param {number} [card_number_length] Card number length
2843
2879
  * @param {string} [account_name] Bank account account name
2844
2880
  * @param {string} [account_number] Bank account account number
@@ -2847,19 +2883,19 @@ interface IEventFinishData extends IEventData$1 {
2847
2883
  * Interface of data from event.
2848
2884
  * @interface IEventAfterLoadData
2849
2885
  *
2850
- * @param {string} event Event name
2851
- * @param {string} purpose System variable. Purpose of event
2852
- * @param {string} message_source System variable. Event source
2853
- * @param {string} [ref_id] Custom value for identify result of processed operation
2886
+ * @param {string} event The name of the event.
2887
+ * @param {string} purpose A system variable that states the purpose of the event.
2888
+ * @param {string} message_source A system variable that identifies the event source.
2889
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2854
2890
  * */
2855
2891
  /**
2856
2892
  * Interface of data from event.
2857
2893
  * @interface IEventFinishData
2858
2894
  *
2859
- * @param {string} event Event name
2860
- * @param {string} purpose System variable. Purpose of event
2861
- * @param {string} message_source System variable. Event source
2862
- * @param {string} [ref_id] Custom value for identify result of processed operation
2895
+ * @param {string} event The name of the event.
2896
+ * @param {string} purpose A system variable that states the purpose of the event.
2897
+ * @param {string} message_source A system variable that identifies the event source.
2898
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2863
2899
  * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
2864
2900
  * */
2865
2901
  /**
@@ -2918,129 +2954,194 @@ declare class HtmlMultiWidget extends MultiWidget {
2918
2954
  protected triggerElement: Trigger;
2919
2955
  protected event: IFrameEvent;
2920
2956
  protected validationData: IFormValidation;
2921
- constructor(selector: string, publicKey: string, conf: any);
2957
+ /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
2922
2958
  /**
2923
- * The final method to beginning, the load process of widget to html
2959
+ * Loads the widget.
2924
2960
  *
2961
+ * Calling this method results in an iframe element being inserted and rendered in the DOM.
2925
2962
  */
2926
2963
  load(): void;
2964
+ /**
2965
+ * Registers a form validation callback for validation events.
2966
+ */
2927
2967
  protected afterLoad(): void;
2928
2968
  /**
2929
- * This callback will be called for each event in widget
2969
+ * Listen to events of widget
2930
2970
  *
2931
- * @callback listener
2932
- * @param {IEventData | IEventFinishData | IEventMetaData | IFormValidation} response
2971
+ * @example
2972
+ *
2973
+ * ```javascript
2974
+ * widget.on('form_submit', function (data) {
2975
+ * console.log(data);
2976
+ * });
2977
+ * ```
2978
+ *
2979
+ * @example
2980
+ *
2981
+ * ```javascript
2982
+ * widget.on('form_submit').then(function (data) {
2983
+ * console.log(data);
2984
+ * });
2985
+ * ```
2986
+ *
2987
+ * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
2988
+ *
2989
+ * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
2990
+ * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
2991
+ *
2992
+ * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
2933
2993
  */
2934
2994
  on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
2935
2995
  on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
2936
2996
  /**
2937
- * This callback will be called for every trigger
2997
+ * Registers callback that will be invoked for every trigger.
2938
2998
  *
2939
- * @param {triggerName} triggers - submit_form, tab
2940
- * @param {ITriggerData} data which will be sending to widget
2999
+ * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
3000
+ * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
2941
3001
  */
2942
3002
  trigger(triggerName: string, data?: ITriggerData): void;
2943
3003
  /**
2944
- * Using this method you can get validation state information
3004
+ * Gets a reference to the form current validation state.
3005
+ *
3006
+ * !Warning: do not directly modify the values of the returned object.
3007
+ *
2945
3008
  * @return {IFormValidation} Form validation object
2946
3009
  */
2947
3010
  getValidationState(): IFormValidation;
2948
3011
  /**
2949
- * Using this method you can check if the form is valid
2950
- * @return {boolean} Form is valid
3012
+ * Checks if a given form is valid.
3013
+ *
3014
+ * A form is valid if all form fields are valid.
3015
+ *
3016
+ * @return {boolean} Indicates wether or not form is valid.
2951
3017
  */
2952
3018
  isValidForm(): boolean;
2953
3019
  /**
2954
3020
  * Using this method you can check if a specific form field is invalid
3021
+ *
2955
3022
  * @param {string} field - Field name
2956
3023
  * @return {boolean} Field is invalid
2957
3024
  */
2958
3025
  isInvalidField(field?: string): boolean;
2959
3026
  /**
2960
- * Using this method you can check if an error is displayed on a specific field
2961
- * @param {string} field - Field name
2962
- * @return {boolean} Error is showed on field
3027
+ * Checks if a given form field is displaying an error.
3028
+ *
3029
+ * @param {string} field - The form field name
3030
+ *
3031
+ * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
2963
3032
  */
2964
3033
  isFieldErrorShowed(field?: string): boolean;
2965
3034
  /**
2966
- * Using this method you can check if a specific field is invalid
2967
- * @param {string} field - Field name
2968
- * @param {string} validator - Validator name. Available validators: `required, cardNumberValidator, expireDateValidation`
2969
- * @return {boolean} Field is invalid by validator
3035
+ * Checks if a given form field is valid or invalid by name.
3036
+ *
3037
+ * @param {string} field - The form field name
3038
+ * @param validator - The name of the validator.
3039
+ *
3040
+ * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
2970
3041
  */
2971
- isInvalidFieldByValidator(field: string, validator: string): boolean;
3042
+ isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
2972
3043
  /**
2973
- * Using this method you can hide widget after load
2974
- * @param {boolean} [saveSize=false] - using this param you can save iframe's size
3044
+ * Hides the widget.
3045
+ *
3046
+ * E.g., use this method to hide the widget after it loads.
3047
+ *
3048
+ * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
2975
3049
  */
2976
3050
  hide(saveSize: boolean): void;
2977
3051
  /**
2978
- * Using this method you can show widget after using hide method
3052
+ * Shows the widget.
2979
3053
  *
3054
+ * E.g., use this method to show the widget after it was explicitly hidden.
2980
3055
  */
2981
3056
  show(): void;
2982
3057
  /**
2983
- * Using this method you can reload widget
2984
- *
3058
+ * Reloads the widget.
2985
3059
  */
2986
3060
  reload(): void;
2987
3061
  /**
2988
- * Using this method you can hide any elements inside widget
3062
+ * Hides the specified Widget elements by their identifier.
2989
3063
  *
2990
3064
  * @example
3065
+ *
3066
+ * ```javascript
2991
3067
  * widget.hideElements(['submit_button', 'email']);
3068
+ * ```
2992
3069
  *
2993
- * @param {string[]} elements - list of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3070
+ * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
2994
3071
  */
2995
3072
  hideElements(elements: string[]): void;
2996
3073
  /**
2997
- * Using this method you can show any elements inside widget
3074
+ * Shows the specified Widget elements by their identifier.
2998
3075
  *
2999
- * * @example
3000
- * widget.showElements(['submit_button', 'email']);
3076
+ * @example
3001
3077
  *
3002
- * @param {string[]} elements - list of element which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3078
+ * ```javascript
3079
+ * widget.showElements(['submit_button', 'email']);
3080
+ * ```
3003
3081
  *
3082
+ * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3004
3083
  */
3005
3084
  showElements(elements: string[]): void;
3006
3085
  /**
3007
- * Method for update values for form fields inside the widget
3086
+ * Updates the form field values inside the widget.
3008
3087
  *
3009
3088
  * @example
3089
+ *
3090
+ * ```javascript
3010
3091
  * widget.updateFormValues({
3011
- * email: 'predefined@email.com',
3012
- * card_name: 'Houston'
3013
- * });
3092
+ * email: 'predefined@email.com',
3093
+ * card_name: 'Houston'
3094
+ * });
3095
+ *```
3014
3096
  *
3015
3097
  * @param {IFormValues} fieldValues - Fields with values
3016
3098
  */
3017
3099
  updateFormValues(fieldValues: IFormValues): void;
3100
+ /**
3101
+ * Updates a single form field values inside the widget by the form field name.
3102
+ *
3103
+ * @example
3104
+ *
3105
+ * ```javascript
3106
+ * widget.updateFormValue("card_name", "John Doe");
3107
+ *```
3108
+ *
3109
+ * @param {string} key - The form field name
3110
+ * @param {string} value - The form field value
3111
+ */
3018
3112
  updateFormValue(key: string, value: string): void;
3019
3113
  /**
3020
- * After finish event of widget, data (dataType) will be insert to input (selector)
3114
+ * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
3021
3115
  *
3022
- * @param {string} selector - css selector . [] #
3023
- * @param {string} dataType - data type of IEventData object.
3116
+ * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
3117
+ * @param {string} dataType - The data type of IEventData object.
3024
3118
  */
3025
3119
  onFinishInsert(selector: string, dataType: string): void;
3026
3120
  /**
3027
- * Widget will intercept submit of your form for processing widget
3121
+ * Intercepts a form submission and delegates processing to the widget.
3028
3122
  *
3029
- * Process: click by submit button in your form --> submit widget ---> submit your form
3030
- * @note submit button in widget will be hidden.
3123
+ * An simplified example of the process:
3124
+ * - User clicks submit button in your form
3125
+ * - This implicitly triggers a submission to the widget
3126
+ * - The widget submits your form
3127
+ *
3128
+ * @note The widget's submit button will be hidden.
3031
3129
  *
3032
3130
  * @param {string} selector - css selector of your form
3033
3131
  *
3034
3132
  * @example
3133
+ *
3134
+ * ```html
3135
+ * <body>
3035
3136
  * <form id="myForm">
3036
3137
  * <input name="amount">
3037
3138
  * <button type="submit">Submit</button>
3038
3139
  * </form>
3039
- * <!--
3040
- * -->
3041
- * <script>
3140
+ * <script>
3042
3141
  * widget.interceptSubmitForm('#myForm');
3043
- * </script>
3142
+ * </script>
3143
+ * </body>
3144
+ * ```
3044
3145
  */
3045
3146
  interceptSubmitForm(selector: string): void;
3046
3147
  /**
@@ -3051,8 +3152,10 @@ declare class HtmlMultiWidget extends MultiWidget {
3051
3152
  * Use this method for resize iFrame according content height
3052
3153
  *
3053
3154
  * @example
3054
- * widget.useAutoResize();
3055
3155
  *
3156
+ * ```javascript
3157
+ * widget.useAutoResize();
3158
+ *```
3056
3159
  */
3057
3160
  useAutoResize(): void;
3058
3161
  }
@@ -3077,7 +3180,7 @@ declare class HtmlMultiWidget extends MultiWidget {
3077
3180
  * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
3078
3181
  */
3079
3182
  declare class HtmlWidget extends HtmlMultiWidget {
3080
- constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
3183
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
3081
3184
  /**
3082
3185
  * Destination, where customer will receive all successful responses.
3083
3186
  * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
@@ -3160,4 +3263,4 @@ declare class HtmlWidget extends HtmlMultiWidget {
3160
3263
  setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
3161
3264
  }
3162
3265
 
3163
- export { AfterpayCheckoutButton, Api, CHECKOUT_BUTTON_EVENT, Canvas3ds, Configuration, ELEMENT, 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, type ITexts, MultiWidget, PAYMENT_TYPE, PURPOSE, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, SRC, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };
3266
+ export { AfterpayCheckoutButton, Api, CHECKOUT_BUTTON_EVENT, Canvas3ds, Configuration, ELEMENT, 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, MastercardSRCClickToPay, MultiWidget, PAYMENT_TYPE, PURPOSE, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };