@paydock/client-sdk 1.104.3-beta → 1.104.6-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 (99) hide show
  1. package/README.md +729 -405
  2. package/bundles/index.cjs +1689 -1907
  3. package/bundles/index.cjs.d.ts +420 -377
  4. package/bundles/index.cjs.map +1 -1
  5. package/bundles/index.mjs +1689 -1907
  6. package/bundles/index.mjs.d.ts +420 -377
  7. package/bundles/index.mjs.map +1 -1
  8. package/bundles/types/api/api-service-internal.d.ts +2 -1
  9. package/bundles/types/api/api-service-internal.d.ts.map +1 -1
  10. package/bundles/types/api/api.d.ts +1 -1
  11. package/bundles/types/api/api.d.ts.map +1 -1
  12. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +1 -1
  13. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  14. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -1
  15. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -1
  16. package/bundles/types/checkout-button/checkout-button.d.ts +1 -1
  17. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -1
  18. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +1 -1
  19. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -1
  20. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -1
  21. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -1
  22. package/bundles/types/components/container.d.ts +1 -0
  23. package/bundles/types/components/container.d.ts.map +1 -1
  24. package/bundles/types/components/iframe-event.d.ts +17 -11
  25. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  26. package/bundles/types/components/link.d.ts +3 -2
  27. package/bundles/types/components/link.d.ts.map +1 -1
  28. package/bundles/types/components/param.d.ts +6 -8
  29. package/bundles/types/components/param.d.ts.map +1 -1
  30. package/bundles/types/components/wallet-background.d.ts +2 -1
  31. package/bundles/types/components/wallet-background.d.ts.map +1 -1
  32. package/bundles/types/constants/validators.d.ts +45 -0
  33. package/bundles/types/constants/validators.d.ts.map +1 -0
  34. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +17 -13
  35. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -1
  36. package/bundles/types/payment-source-widget/payment-source-widget.d.ts +1 -1
  37. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -1
  38. package/bundles/types/secure-remote-commerce/index.d.ts +102 -1
  39. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  40. package/bundles/types/secure-remote-commerce/interfaces.d.ts +109 -32
  41. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  42. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +31 -0
  43. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +1 -0
  44. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  45. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  46. package/bundles/types/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +5 -8
  47. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  48. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
  49. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
  50. package/bundles/types/vault-display-widget/vault-display-widget.d.ts +1 -1
  51. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
  52. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts +2 -0
  53. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -1
  54. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -1
  55. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -1
  56. package/bundles/types/wallet-buttons/google.wallet-service.d.ts +3 -0
  57. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -1
  58. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +4 -0
  59. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  60. package/bundles/types/wallet-buttons/index.d.ts +126 -0
  61. package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
  62. package/bundles/types/wallet-buttons/interfaces.d.ts +3 -0
  63. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  64. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -1
  65. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +63 -121
  66. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
  67. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +1 -1
  68. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
  69. package/bundles/types/wallet-buttons/wallet-service.d.ts +7 -0
  70. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -1
  71. package/bundles/types/widget/configuration.d.ts +1 -1
  72. package/bundles/types/widget/configuration.d.ts.map +1 -1
  73. package/bundles/types/widget/html-multi-widget.d.ts +146 -75
  74. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
  75. package/bundles/types/widget/html-widget.d.ts +1 -1
  76. package/bundles/types/widget/html-widget.d.ts.map +1 -1
  77. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  78. package/bundles/widget.umd.js +1689 -1907
  79. package/bundles/widget.umd.js.d.ts +420 -377
  80. package/bundles/widget.umd.js.map +1 -1
  81. package/bundles/widget.umd.js.min.d.ts +420 -377
  82. package/bundles/widget.umd.min.js +1 -1
  83. package/bundles/widget.umd.min.js.map +1 -1
  84. package/docs/api-ps-widget.md +12 -12
  85. package/docs/api-widget.md +211 -156
  86. package/docs/license.md +1 -1
  87. package/docs/secure-remote-commerce-examples.md +75 -101
  88. package/docs/secure-remote-commerce.md +185 -114
  89. package/docs/wallet-buttons-examples.md +48 -19
  90. package/docs/wallet-buttons.md +197 -2
  91. package/package.json +1 -1
  92. package/slate.md +123 -120
  93. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
  94. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
  95. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
  96. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
  97. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
  98. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
  99. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
@@ -126,7 +126,7 @@ interface BrowserDetails {
126
126
  **/
127
127
  declare class Api extends ApiBase {
128
128
  publicKey: String;
129
- constructor(publicKey: string);
129
+ /** @constructs */ constructor(publicKey: string);
130
130
  /**
131
131
  * Method for getting browser details
132
132
  *
@@ -145,51 +145,48 @@ declare class Api extends ApiBase {
145
145
  charge(): ApiCharge;
146
146
  }
147
147
 
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
- }
148
+ /**
149
+ * List of available form field validators dedicated to cards and their definition
150
+ *
151
+ * @const CARD_VALIDATORS
152
+ *
153
+ * @type {Record<string, string>}
154
+ *
155
+ * @param {string} CVV=cardCvvValidation
156
+ * Asserts that CVV contains zero or more digits and is a number
157
+ * @param {string} EXPIRY_DATE=expireDateValidation
158
+ * Asserts value is a date in the future with format MM/YY
159
+ * @param {string} HOLDER_NAME=cardHoldernameValidation
160
+ * Asserts value is a name that respects the
161
+ ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en)
162
+ * @param {string} NUMBER=cardNumberValidation
163
+ Asserts the value matches a known card scheme and as a the correct length.
164
+ E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card
165
+ * @param {string} PIN=cardPinValidation
166
+ Asserts the value is a number with exactly 4 digits
167
+ */
168
+ declare const CARD_VALIDATORS: {
169
+ readonly CVV: "cardCvvValidator";
170
+ readonly EXPIRY_DATE: "expireDateValidation";
171
+ readonly HOLDER_NAME: "cardHoldernameValidator";
172
+ readonly NUMBER: "cardNumberValidator";
173
+ readonly PIN: "cardPinValidator";
174
+ };
175
+ type CardValidatorValue = typeof CARD_VALIDATORS[keyof typeof CARD_VALIDATORS];
176
+ /**
177
+ * List of available generic form field validators and their definition
178
+ *
179
+ * @const GENERIC_VALIDATORS
180
+ *
181
+ * @type {Record<string, string>}
182
+ *
183
+ * @param {string} REQUIRED=required
184
+ * Asserts the input or form field has a value defined truthy value
185
+ */
186
+ declare const GENERIC_VALIDATORS: {
187
+ readonly REQUIRED: "required";
188
+ };
189
+ type GenericValidatorValue = typeof GENERIC_VALIDATORS[keyof typeof GENERIC_VALIDATORS];
193
190
 
194
191
  declare const FORM_FIELD: {
195
192
  CARD_NAME: string;
@@ -310,18 +307,15 @@ interface IFormElement {
310
307
  placeholder?: string;
311
308
  value?: string;
312
309
  }
310
+ type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
311
+ type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
313
312
  interface IFormValidation {
314
313
  form_valid?: boolean;
315
314
  invalid_fields?: string[];
316
315
  invalid_showed_fields?: string[];
317
- validators?: IValidators;
318
- }
319
- interface IValidators {
320
- required?: string[];
321
- cardNumberValidator?: string[];
322
- expireDateValidation?: string[];
316
+ validators?: ValidatorFieldsMap;
323
317
  }
324
- interface IStyles {
318
+ interface IStyles$1 {
325
319
  background_color?: string;
326
320
  background_active_color?: string;
327
321
  text_color?: string;
@@ -350,18 +344,19 @@ interface ICommonParams {
350
344
  sdk_version?: string;
351
345
  sdk_type?: string;
352
346
  }
353
- interface IVisaSRCParams extends IVisaSRCMeta, ICommonParams {
347
+ interface ISRCParams extends ICommonParams {
354
348
  public_key?: string;
355
349
  service_id?: string;
350
+ meta?: string;
356
351
  }
357
- interface IWalletParams extends IStyles, ITexts, ICommonParams {
352
+ interface IWalletParams extends IStyles$1, ITexts, ICommonParams {
358
353
  token: string;
359
354
  credentials: string;
360
355
  currency: string;
361
356
  amount: number;
362
357
  gateway_mode: string;
363
358
  }
364
- interface IParams extends IStyles, ITexts, ICommonParams {
359
+ interface IParams extends IStyles$1, ITexts, ICommonParams {
365
360
  access_token?: string;
366
361
  public_key?: string;
367
362
  token?: string;
@@ -575,7 +570,7 @@ declare class Link {
575
570
  constructor(linkResource: string);
576
571
  getNetUrl(): string;
577
572
  getUrl(): string;
578
- setParams(params: IParams | IWalletParams | IVisaSRCParams): void;
573
+ setParams(params: IParams | IWalletParams | ISRCParams): void;
579
574
  concatParams(params: IParams): void;
580
575
  getParams(): IParams;
581
576
  setEnv(env: string, alias?: string): void;
@@ -591,6 +586,7 @@ declare class Container {
591
586
  on(name: any, cb: (event: MouseEvent) => void): void;
592
587
  getAttr<T>(allowValue: string[]): T | {};
593
588
  getElement(): Element;
589
+ getSelector(): string;
594
590
  private convertConfigs;
595
591
  }
596
592
 
@@ -611,23 +607,27 @@ declare class IFrame {
611
607
  setStyle(property: string, value: string): void;
612
608
  }
613
609
 
610
+ /**
611
+ * Contains basic information associated with the event.
612
+ *
613
+ * Including event (name), source of the message, purpose and a unique identifier
614
+ * for the event.
615
+ *
616
+ * @interface IEventData
617
+ *
618
+ * @param {string} event The name of the event.
619
+ * @param {string} message_source A system variable that identifies the event source.
620
+ * @param {string} purpose A system variable that states the purpose of the event.
621
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
622
+ */
614
623
  interface IEventData$1 {
615
624
  event: string;
616
- purpose: string;
617
625
  message_source: string;
618
- ref_id?: string;
626
+ purpose: string;
619
627
  widget_id: string;
620
628
  data?: any;
629
+ ref_id?: string;
621
630
  }
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
631
  declare const EVENT: {
632
632
  AFTER_LOAD: string;
633
633
  SUBMIT: string;
@@ -639,6 +639,8 @@ declare const EVENT: {
639
639
  CHECKOUT_READY: string;
640
640
  CHECKOUT_ERROR: string;
641
641
  CHECKOUT_COMPLETED: string;
642
+ CHECKOUT_POPUP_OPEN: string;
643
+ CHECKOUT_POPUP_CLOSE: string;
642
644
  VALIDATION: string;
643
645
  SELECT: string;
644
646
  UNSELECT: string;
@@ -733,7 +735,7 @@ declare class Configuration {
733
735
  private env;
734
736
  static createEachToken(accessToken: string, configs: Configuration[], cb: (tokens: string[]) => void, errorCb?: (errors: string[]) => void): void;
735
737
  private static finishCreatingEachToken;
736
- constructor(gatewayID?: string, paymentType?: string, purpose?: string);
738
+ /** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: string);
737
739
  /**
738
740
  * Destination, where customer will receive all successful responses.
739
741
  * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
@@ -907,7 +909,7 @@ declare class Canvas3ds {
907
909
  protected iFrame: IFrame;
908
910
  protected event: IFrameEvent;
909
911
  protected eventEmitter: EventEmitter;
910
- constructor(selector: string, token: string);
912
+ /** @constructs */ constructor(selector: string, token: string);
911
913
  protected static extractToken(token: string): {
912
914
  content: string;
913
915
  format: TOKEN_FORMAT;
@@ -1153,7 +1155,7 @@ declare class CheckoutButton {
1153
1155
  protected checkoutHandler?: CheckoutContextualHandler;
1154
1156
  protected env: string;
1155
1157
  protected alias?: string;
1156
- constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
1158
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
1157
1159
  protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
1158
1160
  protected buildAdditionalParams(): AdditionalParams;
1159
1161
  protected initCheckout(container: Container): void;
@@ -1276,7 +1278,7 @@ declare class ZipmoneyCheckoutButton extends CheckoutButton {
1276
1278
  protected publicKey: string;
1277
1279
  protected gatewayId: string;
1278
1280
  protected mode: CHECKOUT_MODE;
1279
- constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
1281
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
1280
1282
  /**
1281
1283
  * Method for setting suspended redirect uri. Redirect after referred checkout
1282
1284
  *
@@ -1320,7 +1322,7 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
1320
1322
  protected accessToken: string;
1321
1323
  protected gatewayId: string;
1322
1324
  protected showETP: boolean;
1323
- constructor(selector: string, accessToken: string, gatewayId?: string);
1325
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
1324
1326
  /**
1325
1327
  * Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
1326
1328
  *
@@ -1352,7 +1354,7 @@ declare class AfterpayCheckoutButton extends CheckoutButton {
1352
1354
  declare class PaypalCheckoutButton extends CheckoutButton {
1353
1355
  protected publicKey: string;
1354
1356
  protected gatewayId: string;
1355
- constructor(selector: string, publicKey: string, gatewayId?: string);
1357
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
1356
1358
  }
1357
1359
 
1358
1360
  /**
@@ -1374,7 +1376,7 @@ declare class PaymentSourceWidget {
1374
1376
  protected configs: Configuration[];
1375
1377
  protected configTokens: string[];
1376
1378
  protected publicKey: string;
1377
- constructor(accessToken: string, queryToken: string);
1379
+ /** @constructs */ constructor(accessToken: string, queryToken: string);
1378
1380
  /**
1379
1381
  * Object contain styles for widget
1380
1382
  *
@@ -1388,7 +1390,7 @@ declare class PaymentSourceWidget {
1388
1390
  * });
1389
1391
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1390
1392
  */
1391
- setStyles(styles: IStyles): void;
1393
+ setStyles(styles: IStyles$1): void;
1392
1394
  setStyle(param: string, value: string): void;
1393
1395
  /**
1394
1396
  * Current method can set custom ID to identify the data in the future
@@ -1473,6 +1475,7 @@ interface IEventSizeData extends IEventData$1 {
1473
1475
  }
1474
1476
  /**
1475
1477
  * Interface of data from event.
1478
+ *
1476
1479
  * @interface IEventSelectData
1477
1480
  *
1478
1481
  * @param {string} event
@@ -1494,6 +1497,7 @@ interface IEventSizeData extends IEventData$1 {
1494
1497
  * */
1495
1498
  /**
1496
1499
  * Interface of data from event.
1500
+ *
1497
1501
  * @interface IEventPaginationData
1498
1502
  *
1499
1503
  * @param {string} event
@@ -1506,12 +1510,13 @@ interface IEventSizeData extends IEventData$1 {
1506
1510
  * */
1507
1511
  /**
1508
1512
  * Interface of data from event.
1513
+ *
1509
1514
  * @interface IEventAfterLoadData
1510
1515
  *
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
1516
+ * @param {string} event The name of the event.
1517
+ * @param {string} purpose A system variable that states the purpose of the event.
1518
+ * @param {string} message_source A system variable that identifies the event source.
1519
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1515
1520
  * @param {number} total_item Pagination param. Total item count
1516
1521
  * @param {number} skip Pagination param. Skip items from first item
1517
1522
  * @param {number} limit Pagination param. Query limit
@@ -1520,24 +1525,25 @@ interface IEventSizeData extends IEventData$1 {
1520
1525
  * Interface of data from event.
1521
1526
  * @interface IEventFinishData
1522
1527
  *
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
1528
+ * @param {string} event The name of the event.
1529
+ * @param {string} purpose A system variable that states the purpose of the event.
1530
+ * @param {string} message_source A system variable that identifies the event source.
1531
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1527
1532
  * */
1528
1533
  /**
1529
1534
  * Interface of data from event.
1530
1535
  * @interface IEventSizeData
1531
1536
  *
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
1537
+ * @param {number} event The name of the event.
1538
+ * @param {number} purpose A system variable that states the purpose of the event.
1539
+ * @param {string} message_source A system variable that identifies the event source.
1540
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1536
1541
  * @param {number} height Height of iFrame
1537
1542
  * @param {number} width Width of iFrame
1538
1543
  * */
1539
1544
  /**
1540
1545
  * List of available event's name
1546
+ *
1541
1547
  * @const EVENT
1542
1548
  *
1543
1549
  * @type {object}
@@ -1566,7 +1572,7 @@ declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
1566
1572
  protected container: Container;
1567
1573
  protected iFrame: IFrame;
1568
1574
  protected event: IFrameEvent;
1569
- constructor(selector: string, publicKey: string, queryToken: string);
1575
+ /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
1570
1576
  /**
1571
1577
  * The final method to beginning, the load process of widget to html
1572
1578
  *
@@ -1636,6 +1642,79 @@ declare class Builder extends HttpCore {
1636
1642
  getConfigs(): IBody;
1637
1643
  }
1638
1644
 
1645
+ interface IBaseSRCMeta {
1646
+ customizations?: IStyles;
1647
+ dpa_data?: {
1648
+ dpa_presentation_name?: string;
1649
+ dpa_uri?: string;
1650
+ };
1651
+ dpa_transaction_options?: {
1652
+ dpa_locale?: string;
1653
+ dpa_accepted_billing_countries?: string[];
1654
+ consumer_name_requested?: boolean;
1655
+ consumer_email_address_requested?: boolean;
1656
+ consumer_phone_number_requested?: boolean;
1657
+ transaction_amount?: {
1658
+ transaction_amount?: number;
1659
+ transaction_currency_code?: string;
1660
+ };
1661
+ merchant_order_id?: string;
1662
+ merchant_category_code?: string;
1663
+ merchant_country_code?: string;
1664
+ };
1665
+ }
1666
+ interface PhoneNumber {
1667
+ country_code: string;
1668
+ phone_number: string;
1669
+ }
1670
+ interface Customer {
1671
+ email?: string;
1672
+ phone?: {
1673
+ country_code?: string;
1674
+ phone?: string;
1675
+ };
1676
+ first_name?: string;
1677
+ last_name?: string;
1678
+ }
1679
+ interface IMastercardSRCMeta extends IBaseSRCMeta {
1680
+ dpa_data?: IBaseSRCMeta['dpa_data'] & {
1681
+ dpa_address?: string;
1682
+ dpa_email_address?: string;
1683
+ dpa_phone_number?: PhoneNumber;
1684
+ dpa_logo_uri?: string;
1685
+ dpa_supported_email_address?: string;
1686
+ dpa_supported_phone_number?: PhoneNumber;
1687
+ dpa_uri?: string;
1688
+ dpa_support_uri?: string;
1689
+ application_type?: 'WEB_BROWSER' | 'MOBILE_APP';
1690
+ };
1691
+ disable_summary_screen?: boolean;
1692
+ co_brand_names?: string[];
1693
+ checkout_experience?: 'WITHIN_CHECKOUT' | 'PAYMENT_SETTINGS';
1694
+ services?: 'INLINE_CHECKOUT' | 'INLINE_INSTALLMENTS';
1695
+ dpa_transaction_options?: IBaseSRCMeta['dpa_transaction_options'] & {
1696
+ dpa_billing_preference?: MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE;
1697
+ payment_options?: Array<{
1698
+ dynamic_data_type?: string;
1699
+ }>;
1700
+ order_type?: MASTERCARD_ORDER_TYPE;
1701
+ three_ds_preference?: string;
1702
+ confirm_payment?: boolean;
1703
+ };
1704
+ customer?: Customer;
1705
+ unaccepted_card_type?: 'CREDIT' | 'DEBIT';
1706
+ }
1707
+ type MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE = 'FULL' | 'POSTAL_COUNTRY' | 'NONE';
1708
+ type MASTERCARD_ORDER_TYPE = 'SPLIT_SHIPMENT' | 'PREFERRED_CARD';
1709
+ interface IStyles {
1710
+ primary_button_color?: string;
1711
+ secondary_button_color?: string;
1712
+ primary_button_text_color?: string;
1713
+ secondary_button_text_color?: string;
1714
+ font_family?: string;
1715
+ enable_src_popup?: boolean;
1716
+ }
1717
+
1639
1718
  declare class ApiChargeInternal {
1640
1719
  protected api: ApiInternal;
1641
1720
  constructor(api: ApiInternal);
@@ -1762,98 +1841,35 @@ interface SRCProvider {
1762
1841
  useAutoResize?(): void;
1763
1842
  }
1764
1843
 
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;
1844
+ declare abstract class SRC {
1827
1845
  protected iframe_selector: string;
1828
1846
  protected service_id: string;
1829
1847
  protected public_key_or_access_token: string;
1830
- protected meta: IVisaSRCMeta;
1848
+ protected meta: IMastercardSRCMeta;
1831
1849
  protected eventEmitter: EventEmitter;
1832
1850
  protected env: string;
1833
- protected alias: string;
1851
+ protected alias?: string;
1834
1852
  protected api: ApiInternal;
1835
1853
  protected provider: SRCProvider;
1836
1854
  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);
1855
+ protected style: IStyles;
1856
+ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
1839
1857
  /**
1840
1858
  * Object contain styles for widget - call before `.load()`.
1841
1859
  *
1842
1860
  * @example
1843
1861
  * widget.setStyles({
1844
- * button_text_color: '#32a852',
1845
- * primary_color: '#32a852',
1846
- * font_family: 'sans-serif',
1847
- * card_schemes: ['visa']
1848
- * });
1862
+ * enable_src_popup: true
1863
+ * primary_button_color: 'red',
1864
+ * secondary_button_color: 'blue',
1865
+ * primary_button_text_color: 'white',
1866
+ * secondary_button_text_color: 'white',
1867
+ * font_family: 'Arial',
1868
+ * });
1849
1869
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1850
1870
  */
1851
- setStyles(styles: IStyles$1): void;
1871
+ setStyles(styles: IStyles): void;
1852
1872
  private setStyle;
1853
- /**
1854
- * The final method after configuring the SRC to start the load process of SRC checkout
1855
- *
1856
- */
1857
1873
  load(): void;
1858
1874
  /**
1859
1875
  * Current method can change environment. By default environment = sandbox.
@@ -1874,21 +1890,6 @@ declare class SRC {
1874
1890
  getEnv(): string;
1875
1891
  on(eventName: string): Promise<any>;
1876
1892
  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
1893
  /**
1893
1894
  * Using this method you can hide checkout after load and button click
1894
1895
  * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
@@ -1921,6 +1922,34 @@ declare class SRC {
1921
1922
  useAutoResize(): void;
1922
1923
  }
1923
1924
 
1925
+ /**
1926
+ * Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
1927
+ *
1928
+ * @extends SRC
1929
+ *
1930
+ * @constructor
1931
+ *
1932
+ * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
1933
+ * @param {string} service_id - Card Scheme Service ID
1934
+ * @param {string} public_key_or_access_token - Paydock public key or Access Token
1935
+ * @param {IMastercardSRCMeta} meta - Data that configures the SRC checkout
1936
+ * @example
1937
+ * var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
1938
+ *
1939
+ */
1940
+ declare class MastercardSRCClickToPay extends SRC {
1941
+ protected iframe_selector: string;
1942
+ protected service_id: string;
1943
+ protected public_key_or_access_token: string;
1944
+ protected meta: IMastercardSRCMeta;
1945
+ /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
1946
+ /**
1947
+ * The final method after configuring the SRC to start the load process of SRC checkout
1948
+ *
1949
+ */
1950
+ load(): void;
1951
+ }
1952
+
1924
1953
  interface ITriggerData {
1925
1954
  configuration_token?: string;
1926
1955
  tab_number?: number;
@@ -1986,7 +2015,7 @@ declare class VaultDisplayWidget {
1986
2015
  protected vaultDisplayToken: string;
1987
2016
  protected link: Link;
1988
2017
  protected configs: any[];
1989
- constructor(selector: string, token: string);
2018
+ /** @constructs */ constructor(selector: string, token: string);
1990
2019
  /**
1991
2020
  * Current method can change environment. By default environment = sandbox.
1992
2021
  * Also we can change domain alias for this environment. By default domain_alias = paydock.com
@@ -2019,7 +2048,7 @@ declare class VaultDisplayWidget {
2019
2048
  * });
2020
2049
  * @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
2021
2050
  */
2022
- setStyles(styles: IStyles): void;
2051
+ setStyles(styles: IStyles$1): void;
2023
2052
  setStyle(param: string, value: string): void;
2024
2053
  /**
2025
2054
  * The final method to beginning, the load process of widget to html
@@ -2040,6 +2069,9 @@ interface IWalletPaymentSuccessful {
2040
2069
  interface IWalletUnavailable {
2041
2070
  wallet?: WALLET_TYPE;
2042
2071
  }
2072
+ interface IWalletOnClick {
2073
+ attachResult: (result: Promise<void> | boolean) => void;
2074
+ }
2043
2075
  interface IWalletUpdate {
2044
2076
  wallet_response_code?: string;
2045
2077
  wallet_order_id?: string;
@@ -2133,135 +2165,19 @@ interface IWalletService {
2133
2165
  load(container: Container): Promise<void>;
2134
2166
  close?(): void;
2135
2167
  update(data: IWalletServiceUpdate): void;
2168
+ enable(): void;
2169
+ disable(): void;
2136
2170
  setEnv(env: string): any;
2137
2171
  on(eventName: string, cb?: (data: IUnavailableWalletEventBody | IPaymentMethodSelectedWalletEventBody | any) => void): any;
2138
2172
  }
2139
2173
 
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
2174
  interface IEventData {
2148
2175
  event: string;
2149
- data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | any;
2176
+ data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any;
2150
2177
  }
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
2178
  interface IWalletUpdateData {
2203
2179
  success: boolean;
2204
2180
  }
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
2181
  /**
2266
2182
  * 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
2183
  * @constructor
@@ -2279,7 +2195,7 @@ declare class WalletButtons {
2279
2195
  protected service: IWalletService;
2280
2196
  protected eventEmitter: EventEmitter;
2281
2197
  protected hasUpdateHandler: boolean;
2282
- constructor(selector: string, chargeToken: string, meta: IWalletMeta);
2198
+ /** @constructs */ constructor(selector: string, chargeToken: string, meta: IWalletMeta);
2283
2199
  /**
2284
2200
  * Initializes the availability checks and inserts the button if possible.
2285
2201
  * Otherwise function onUnavailable(handler: VoidFunction) will be called.
@@ -2361,6 +2277,20 @@ declare class WalletButtons {
2361
2277
  * @param {string} [alias] - Own domain alias
2362
2278
  */
2363
2279
  setEnv(env: string, alias?: string): void;
2280
+ /**
2281
+ * Current method can enable the payment button. This method is only supported for Flypay V2.
2282
+ *
2283
+ * @example
2284
+ * button.enable();
2285
+ */
2286
+ enable(): void;
2287
+ /**
2288
+ * Current method can disable the payment button. This method is only supported for Flypay V2.
2289
+ *
2290
+ * @example
2291
+ * button.disable('production', 'paydock.com');
2292
+ */
2293
+ disable(): void;
2364
2294
  /**
2365
2295
  * Closes the checkout forcibly. Currently supported in Flypay wallet.
2366
2296
  *
@@ -2467,9 +2397,51 @@ declare class WalletButtons {
2467
2397
  * @param {listener} [handler] - Function to be called when authentication tokens are changed.
2468
2398
  */
2469
2399
  onAuthTokensChanged(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2400
+ /**
2401
+ * Registers a callback function to be invoked when the wallet button gets clicked.
2402
+ * There are two operational modes supported, Synchronous and Asynchronous.
2403
+ * 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.
2404
+ * When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
2405
+ * Note this is supported for Paypal, GooglePay and ApplePay wallet buttons at the moment.
2406
+ *
2407
+ * @example
2408
+ * button.onClick((data) => {
2409
+ * performValidationLogic();
2410
+ * });
2411
+ *
2412
+ * @param {listener} handler - Function to be called when the wallet button is clicked.
2413
+ */
2414
+ onClick(handler: (data: IEventData) => void): () => void;
2415
+ /**
2416
+ * Registers a callback function to be invoked when the wallet checkout opens.
2417
+ * Note this is supported for FlypayV2 wallet button at the moment.
2418
+ *
2419
+ * @example
2420
+ * button.onCheckoutOpen((data) => {
2421
+ * console.log('Checkout opens');
2422
+ * });
2423
+ *
2424
+ * @param {listener} handler - Function to be called when the wallet checkout opens.
2425
+ */
2426
+ onCheckoutOpen(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2427
+ /**
2428
+ * Registers a callback function to be invoked when the wallet checkout closes.
2429
+ * Note this is supported for FlypayV2 wallet button at the moment.
2430
+ *
2431
+ * @example
2432
+ * button.onCheckoutClose(() => {
2433
+ * console.log('Wallet checkout closes');
2434
+ * });
2435
+ *
2436
+ * @param {listener} handler - Function to be called when the wallet checkout closes.
2437
+ */
2438
+ onCheckoutClose(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2470
2439
  private setupServiceCallbacks;
2471
2440
  private setupUnavailableCallback;
2472
2441
  private setupUpdateCallback;
2442
+ private setupOnClickCallback;
2443
+ private setupOnCheckoutOpenCallback;
2444
+ private setupOnCheckoutCloseCallback;
2473
2445
  private setupWalletCallback;
2474
2446
  private setupPaymentCallback;
2475
2447
  private setupPaymentSuccessCallback;
@@ -2619,7 +2591,7 @@ declare class MultiWidget {
2619
2591
  * });
2620
2592
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
2621
2593
  */
2622
- setStyles(styles: IStyles): void;
2594
+ setStyles(styles: IStyles$1): void;
2623
2595
  /**
2624
2596
  * Method to set a country code mask for the phone input.
2625
2597
  *
@@ -2803,42 +2775,46 @@ declare class MultiWidget {
2803
2775
  interface IEventMetaData extends IEventData$1 {
2804
2776
  configuration_token: string;
2805
2777
  type: string;
2806
- gateway_type?: string;
2807
- card_number_last4?: string;
2808
- card_scheme?: string;
2809
- card_number_length?: number;
2810
2778
  account_name?: string;
2811
2779
  account_number?: string;
2780
+ card_number_last4?: string;
2781
+ card_number_length?: number;
2782
+ card_scheme?: string;
2783
+ gateway_type?: string;
2812
2784
  }
2813
2785
  interface IEventFinishData extends IEventData$1 {
2814
2786
  payment_source: string;
2815
2787
  }
2816
2788
  /**
2817
2789
  * Interface of data from validation event.
2790
+ *
2818
2791
  * @interface IFormValidation
2819
2792
  *
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
- * */
2793
+ * @param {string} event The name of the event.
2794
+ * @param {string} message_source A system variable that identifies the event source.
2795
+ * @param {string} purpose A system variable that states the purpose of the event.
2796
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2797
+ * @param {boolean} [form_valid] Indicates wether or not the form is valid.
2798
+ * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
2799
+ * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
2800
+ * @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.
2801
+ * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
2802
+ */
2829
2803
  /**
2830
- * Interface of data from event.
2804
+ * Contains basic information associated with the event and additional meta data
2805
+ * specific to the event. E.g., card info, gateway info, etc.
2806
+ *
2831
2807
  * @interface IEventMetaData
2832
2808
  *
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
2809
+ * @param {string} event The name of the event.
2810
+ * @param {string} purpose A system variable that states the purpose of the event.
2811
+ * @param {string} message_source A system variable that identifies the event source.
2812
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2837
2813
  * @param {string} configuration_token Token received from our API with widget data
2838
2814
  * @param {string} type Payment type 'card', 'bank_account'
2839
2815
  * @param {string} gateway_type Gateway type
2840
2816
  * @param {string} [card_number_last4] Last 4 digit of your card
2841
- * @param {string} [card_scheme] Card scheme
2817
+ * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
2842
2818
  * @param {number} [card_number_length] Card number length
2843
2819
  * @param {string} [account_name] Bank account account name
2844
2820
  * @param {string} [account_number] Bank account account number
@@ -2847,19 +2823,19 @@ interface IEventFinishData extends IEventData$1 {
2847
2823
  * Interface of data from event.
2848
2824
  * @interface IEventAfterLoadData
2849
2825
  *
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
2826
+ * @param {string} event The name of the event.
2827
+ * @param {string} purpose A system variable that states the purpose of the event.
2828
+ * @param {string} message_source A system variable that identifies the event source.
2829
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2854
2830
  * */
2855
2831
  /**
2856
2832
  * Interface of data from event.
2857
2833
  * @interface IEventFinishData
2858
2834
  *
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
2835
+ * @param {string} event The name of the event.
2836
+ * @param {string} purpose A system variable that states the purpose of the event.
2837
+ * @param {string} message_source A system variable that identifies the event source.
2838
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2863
2839
  * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
2864
2840
  * */
2865
2841
  /**
@@ -2918,129 +2894,194 @@ declare class HtmlMultiWidget extends MultiWidget {
2918
2894
  protected triggerElement: Trigger;
2919
2895
  protected event: IFrameEvent;
2920
2896
  protected validationData: IFormValidation;
2921
- constructor(selector: string, publicKey: string, conf: any);
2897
+ /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
2922
2898
  /**
2923
- * The final method to beginning, the load process of widget to html
2899
+ * Loads the widget.
2924
2900
  *
2901
+ * Calling this method results in an iframe element being inserted and rendered in the DOM.
2925
2902
  */
2926
2903
  load(): void;
2904
+ /**
2905
+ * Registers a form validation callback for validation events.
2906
+ */
2927
2907
  protected afterLoad(): void;
2928
2908
  /**
2929
- * This callback will be called for each event in widget
2909
+ * Listen to events of widget
2930
2910
  *
2931
- * @callback listener
2932
- * @param {IEventData | IEventFinishData | IEventMetaData | IFormValidation} response
2911
+ * @example
2912
+ *
2913
+ * ```javascript
2914
+ * widget.on('form_submit', function (data) {
2915
+ * console.log(data);
2916
+ * });
2917
+ * ```
2918
+ *
2919
+ * @example
2920
+ *
2921
+ * ```javascript
2922
+ * widget.on('form_submit').then(function (data) {
2923
+ * console.log(data);
2924
+ * });
2925
+ * ```
2926
+ *
2927
+ * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
2928
+ *
2929
+ * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
2930
+ * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
2931
+ *
2932
+ * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
2933
2933
  */
2934
2934
  on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
2935
2935
  on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
2936
2936
  /**
2937
- * This callback will be called for every trigger
2937
+ * Registers callback that will be invoked for every trigger.
2938
2938
  *
2939
- * @param {triggerName} triggers - submit_form, tab
2940
- * @param {ITriggerData} data which will be sending to widget
2939
+ * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
2940
+ * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
2941
2941
  */
2942
2942
  trigger(triggerName: string, data?: ITriggerData): void;
2943
2943
  /**
2944
- * Using this method you can get validation state information
2944
+ * Gets a reference to the form current validation state.
2945
+ *
2946
+ * !Warning: do not directly modify the values of the returned object.
2947
+ *
2945
2948
  * @return {IFormValidation} Form validation object
2946
2949
  */
2947
2950
  getValidationState(): IFormValidation;
2948
2951
  /**
2949
- * Using this method you can check if the form is valid
2950
- * @return {boolean} Form is valid
2952
+ * Checks if a given form is valid.
2953
+ *
2954
+ * A form is valid if all form fields are valid.
2955
+ *
2956
+ * @return {boolean} Indicates wether or not form is valid.
2951
2957
  */
2952
2958
  isValidForm(): boolean;
2953
2959
  /**
2954
2960
  * Using this method you can check if a specific form field is invalid
2961
+ *
2955
2962
  * @param {string} field - Field name
2956
2963
  * @return {boolean} Field is invalid
2957
2964
  */
2958
2965
  isInvalidField(field?: string): boolean;
2959
2966
  /**
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
2967
+ * Checks if a given form field is displaying an error.
2968
+ *
2969
+ * @param {string} field - The form field name
2970
+ *
2971
+ * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
2963
2972
  */
2964
2973
  isFieldErrorShowed(field?: string): boolean;
2965
2974
  /**
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
2975
+ * Checks if a given form field is valid or invalid by name.
2976
+ *
2977
+ * @param {string} field - The form field name
2978
+ * @param validator - The name of the validator.
2979
+ *
2980
+ * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
2970
2981
  */
2971
- isInvalidFieldByValidator(field: string, validator: string): boolean;
2982
+ isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
2972
2983
  /**
2973
- * Using this method you can hide widget after load
2974
- * @param {boolean} [saveSize=false] - using this param you can save iframe's size
2984
+ * Hides the widget.
2985
+ *
2986
+ * E.g., use this method to hide the widget after it loads.
2987
+ *
2988
+ * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
2975
2989
  */
2976
2990
  hide(saveSize: boolean): void;
2977
2991
  /**
2978
- * Using this method you can show widget after using hide method
2992
+ * Shows the widget.
2979
2993
  *
2994
+ * E.g., use this method to show the widget after it was explicitly hidden.
2980
2995
  */
2981
2996
  show(): void;
2982
2997
  /**
2983
- * Using this method you can reload widget
2984
- *
2998
+ * Reloads the widget.
2985
2999
  */
2986
3000
  reload(): void;
2987
3001
  /**
2988
- * Using this method you can hide any elements inside widget
3002
+ * Hides the specified Widget elements by their identifier.
2989
3003
  *
2990
3004
  * @example
3005
+ *
3006
+ * ```javascript
2991
3007
  * widget.hideElements(['submit_button', 'email']);
3008
+ * ```
2992
3009
  *
2993
- * @param {string[]} elements - list of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3010
+ * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
2994
3011
  */
2995
3012
  hideElements(elements: string[]): void;
2996
3013
  /**
2997
- * Using this method you can show any elements inside widget
3014
+ * Shows the specified Widget elements by their identifier.
2998
3015
  *
2999
- * * @example
3000
- * widget.showElements(['submit_button', 'email']);
3016
+ * @example
3001
3017
  *
3002
- * @param {string[]} elements - list of element which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3018
+ * ```javascript
3019
+ * widget.showElements(['submit_button', 'email']);
3020
+ * ```
3003
3021
  *
3022
+ * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3004
3023
  */
3005
3024
  showElements(elements: string[]): void;
3006
3025
  /**
3007
- * Method for update values for form fields inside the widget
3026
+ * Updates the form field values inside the widget.
3008
3027
  *
3009
3028
  * @example
3029
+ *
3030
+ * ```javascript
3010
3031
  * widget.updateFormValues({
3011
- * email: 'predefined@email.com',
3012
- * card_name: 'Houston'
3013
- * });
3032
+ * email: 'predefined@email.com',
3033
+ * card_name: 'Houston'
3034
+ * });
3035
+ *```
3014
3036
  *
3015
3037
  * @param {IFormValues} fieldValues - Fields with values
3016
3038
  */
3017
3039
  updateFormValues(fieldValues: IFormValues): void;
3040
+ /**
3041
+ * Updates a single form field values inside the widget by the form field name.
3042
+ *
3043
+ * @example
3044
+ *
3045
+ * ```javascript
3046
+ * widget.updateFormValue("card_name", "John Doe");
3047
+ *```
3048
+ *
3049
+ * @param {string} key - The form field name
3050
+ * @param {string} value - The form field value
3051
+ */
3018
3052
  updateFormValue(key: string, value: string): void;
3019
3053
  /**
3020
- * After finish event of widget, data (dataType) will be insert to input (selector)
3054
+ * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
3021
3055
  *
3022
- * @param {string} selector - css selector . [] #
3023
- * @param {string} dataType - data type of IEventData object.
3056
+ * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
3057
+ * @param {string} dataType - The data type of IEventData object.
3024
3058
  */
3025
3059
  onFinishInsert(selector: string, dataType: string): void;
3026
3060
  /**
3027
- * Widget will intercept submit of your form for processing widget
3061
+ * Intercepts a form submission and delegates processing to the widget.
3028
3062
  *
3029
- * Process: click by submit button in your form --> submit widget ---> submit your form
3030
- * @note submit button in widget will be hidden.
3063
+ * An simplified example of the process:
3064
+ * - User clicks submit button in your form
3065
+ * - This implicitly triggers a submission to the widget
3066
+ * - The widget submits your form
3067
+ *
3068
+ * @note The widget's submit button will be hidden.
3031
3069
  *
3032
3070
  * @param {string} selector - css selector of your form
3033
3071
  *
3034
3072
  * @example
3073
+ *
3074
+ * ```html
3075
+ * <body>
3035
3076
  * <form id="myForm">
3036
3077
  * <input name="amount">
3037
3078
  * <button type="submit">Submit</button>
3038
3079
  * </form>
3039
- * <!--
3040
- * -->
3041
- * <script>
3080
+ * <script>
3042
3081
  * widget.interceptSubmitForm('#myForm');
3043
- * </script>
3082
+ * </script>
3083
+ * </body>
3084
+ * ```
3044
3085
  */
3045
3086
  interceptSubmitForm(selector: string): void;
3046
3087
  /**
@@ -3051,8 +3092,10 @@ declare class HtmlMultiWidget extends MultiWidget {
3051
3092
  * Use this method for resize iFrame according content height
3052
3093
  *
3053
3094
  * @example
3054
- * widget.useAutoResize();
3055
3095
  *
3096
+ * ```javascript
3097
+ * widget.useAutoResize();
3098
+ *```
3056
3099
  */
3057
3100
  useAutoResize(): void;
3058
3101
  }
@@ -3077,7 +3120,7 @@ declare class HtmlMultiWidget extends MultiWidget {
3077
3120
  * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
3078
3121
  */
3079
3122
  declare class HtmlWidget extends HtmlMultiWidget {
3080
- constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
3123
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
3081
3124
  /**
3082
3125
  * Destination, where customer will receive all successful responses.
3083
3126
  * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
@@ -3160,4 +3203,4 @@ declare class HtmlWidget extends HtmlMultiWidget {
3160
3203
  setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
3161
3204
  }
3162
3205
 
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 };
3206
+ 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 };