@paydock/client-sdk 1.142.0 → 1.144.0-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 (92) hide show
  1. package/README.md +243 -0
  2. package/bundles/index.cjs +846 -504
  3. package/bundles/index.cjs.d.ts +1466 -778
  4. package/bundles/index.mjs +675 -338
  5. package/bundles/index.mjs.d.ts +1466 -778
  6. package/bundles/types/api/api-charge-internal.d.ts +3 -49
  7. package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
  8. package/bundles/types/api/api-checkout-internal.d.ts +1 -47
  9. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
  10. package/bundles/types/api/api-shared-types.d.ts +53 -0
  11. package/bundles/types/api/api-shared-types.d.ts.map +1 -0
  12. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts +95 -0
  13. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts.map +1 -0
  14. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +10 -7
  15. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  16. package/bundles/types/canvas-3ds/index.d.ts +4 -0
  17. package/bundles/types/canvas-3ds/index.d.ts.map +1 -1
  18. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +41 -12
  19. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
  20. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +20 -2
  21. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -1
  22. package/bundles/types/checkout/checkout-event-map.d.ts +43 -0
  23. package/bundles/types/checkout/checkout-event-map.d.ts.map +1 -0
  24. package/bundles/types/checkout/checkout.d.ts +25 -9
  25. package/bundles/types/checkout/checkout.d.ts.map +1 -1
  26. package/bundles/types/checkout/v1/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
  27. package/bundles/types/checkout/v3/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
  28. package/bundles/types/components/apple-pay-version.d.ts +29 -0
  29. package/bundles/types/components/apple-pay-version.d.ts.map +1 -0
  30. package/bundles/types/components/param.d.ts +29 -0
  31. package/bundles/types/components/param.d.ts.map +1 -1
  32. package/bundles/types/helper/event-error.d.ts +49 -1
  33. package/bundles/types/helper/event-error.d.ts.map +1 -1
  34. package/bundles/types/index-cba.d.ts +3 -1
  35. package/bundles/types/index-cba.d.ts.map +1 -1
  36. package/bundles/types/index.d.ts +14 -3
  37. package/bundles/types/index.d.ts.map +1 -1
  38. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +37 -0
  39. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
  40. package/bundles/types/open-wallets/base/open-wallet.service.d.ts +12 -0
  41. package/bundles/types/open-wallets/base/open-wallet.service.d.ts.map +1 -1
  42. package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
  43. package/bundles/types/open-wallets/index.d.ts +26 -1
  44. package/bundles/types/open-wallets/index.d.ts.map +1 -1
  45. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts +2 -2
  46. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts.map +1 -1
  47. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -1
  48. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
  49. package/bundles/types/open-wallets/interfaces/events.interface.d.ts +1 -1
  50. package/bundles/types/open-wallets/interfaces/events.interface.d.ts.map +1 -1
  51. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts +46 -0
  52. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts.map +1 -1
  53. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +48 -2
  54. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
  55. package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
  56. package/bundles/types/open-wallets/types/index.d.ts +1 -1
  57. package/bundles/types/open-wallets/types/index.d.ts.map +1 -1
  58. package/bundles/types/open-wallets/types/payment-source.type.d.ts +104 -0
  59. package/bundles/types/open-wallets/types/payment-source.type.d.ts.map +1 -1
  60. package/bundles/types/payment-source-widget/index.d.ts +1 -1
  61. package/bundles/types/payment-source-widget/index.d.ts.map +1 -1
  62. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
  63. package/bundles/types/wallet-buttons/interfaces.d.ts +55 -1
  64. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  65. package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -1
  66. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +16 -0
  67. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -1
  68. package/bundles/types/wallet-buttons-express/index.d.ts +36 -0
  69. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
  70. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +7 -0
  71. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -1
  72. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
  73. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +23 -0
  74. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
  75. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  76. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
  77. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +1 -1
  78. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -1
  79. package/bundles/types/widget/html-multi-widget.d.ts +4 -1
  80. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
  81. package/bundles/types/widget/index.d.ts +2 -1
  82. package/bundles/types/widget/index.d.ts.map +1 -1
  83. package/bundles/types/widget/widget-event-map.d.ts +37 -0
  84. package/bundles/types/widget/widget-event-map.d.ts.map +1 -0
  85. package/bundles/widget.umd.js +846 -504
  86. package/bundles/widget.umd.js.d.ts +1466 -778
  87. package/bundles/widget.umd.js.min.d.ts +1466 -778
  88. package/bundles/widget.umd.min.js +1 -1
  89. package/docs/api-canvas3ds.md +19 -12
  90. package/docs/open-wallet-buttons.md +158 -0
  91. package/docs/wallet-buttons-express.md +85 -0
  92. package/package.json +6 -3
@@ -291,6 +291,65 @@ declare class Api extends ApiBase {
291
291
  charge(): ApiCharge;
292
292
  }
293
293
 
294
+ /**
295
+ * Decoded payload of the Standalone 3DS charge token (the JWT body) the SDK
296
+ * receives in `Canvas3ds`'s constructor when the token format is `standalone_3ds`.
297
+ *
298
+ * This shape is set by the Paydock backend when minting the token. Integrators
299
+ * who decode the token themselves can use this interface to type the result.
300
+ */
301
+ interface ITokenStandalone3DS {
302
+ /** Optional merchant-side correlation identifier carried through from the original charge request. */
303
+ external_id?: string;
304
+ /** URL of the first iframe the SDK loads to bootstrap the 3DS provider's authentication flow. */
305
+ initialization_url: string;
306
+ /**
307
+ * @deprecated No longer read by the Standalone 3DS flow. The field is kept
308
+ * on the interface for backwards compatibility with tokens minted by older
309
+ * API versions; it will be removed in a future major release. Prefer
310
+ * `initialization_url` + `secondary_url`.
311
+ */
312
+ authorization_url?: string;
313
+ /** Optional URL of a secondary iframe used by some providers (e.g. GPayments) for monitoring/polling alongside the main flow. */
314
+ secondary_url?: string;
315
+ /** The Paydock 3DS charge identifier this token authorizes. Echoed back in every event payload emitted during the flow. */
316
+ charge_3ds_id: string;
317
+ /** Identifier of the 3DS gateway the SDK should delegate to. Currently only `'GPayments'` is handled; other values fall through. */
318
+ service_type: string;
319
+ }
320
+ declare class Standalone3dsService {
321
+ protected container: Container;
322
+ protected eventEmitter: EventEmitter;
323
+ protected env: string;
324
+ protected alias: string;
325
+ constructor(container: Container, eventEmitter: any);
326
+ load(token: string, options: {
327
+ title: string;
328
+ }): void;
329
+ setEnv(env: string, alias?: string): void;
330
+ }
331
+
332
+ declare class IFrame {
333
+ protected container: Container;
334
+ constructor(container: Container);
335
+ load(link: string, options?: {
336
+ title?: string;
337
+ attributes?: Record<string, string>;
338
+ styles?: Record<string, string>;
339
+ }, iframeClass?: string): void;
340
+ loadFromHtml(content: string, options?: {
341
+ title?: string;
342
+ }, iframeClass?: string): void;
343
+ remove(): void;
344
+ show(): void;
345
+ hide(saveSize?: boolean): void;
346
+ isExist(): boolean;
347
+ getElement(): HTMLIFrameElement;
348
+ setStyle(property: string, value: string): void;
349
+ setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
350
+ private setStyles;
351
+ }
352
+
294
353
  /**
295
354
  * List of available form field validators dedicated to cards and their definition
296
355
  *
@@ -704,65 +763,57 @@ type WalletRawDataInitialization = {
704
763
  } | object;
705
764
  type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
706
765
  type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
766
+ /**
767
+ * Metadata for the multi-wallet `WalletButtons` container (chargeToken-based flow).
768
+ * Drives the appearance and behavior of every wallet button rendered by the container.
769
+ *
770
+ * Most fields are optional because their defaults are derived from the chargeToken
771
+ * the constructor decodes; set them explicitly only to override.
772
+ */
707
773
  interface IWalletMeta {
774
+ /** Label shown next to the total in the wallet sheet (e.g. `'TOTAL'`). */
708
775
  amount_label?: string;
776
+ /** ISO 3166-1 alpha-2 country code for the transaction (e.g. `'AU'`). */
709
777
  country?: string;
778
+ /** Enable PayPal's Pay Later messaging when the PayPal wallet is rendered. */
710
779
  pay_later?: boolean;
780
+ /** Hide PayPal's Pay Later message copy. */
711
781
  hide_message?: boolean;
782
+ /** Render the PayPal standalone button instead of the smart button group. */
712
783
  standalone?: boolean;
784
+ /** Whether to surface billing address fields in the wallet sheet. */
713
785
  show_billing_address?: boolean;
786
+ /** Whether to collect the payer's name. */
714
787
  request_payer_name?: boolean;
788
+ /** Whether to collect the payer's email. */
715
789
  request_payer_email?: boolean;
790
+ /** Whether to collect the payer's phone number. */
716
791
  request_payer_phone?: boolean;
792
+ /** Whether to collect a shipping address. */
717
793
  request_shipping?: boolean;
794
+ /** Available shipping options to display. The first item is selected by default. */
718
795
  shipping_options?: IShippingOption[];
796
+ /** Merchant display name shown in the wallet sheet. */
719
797
  merchant_name?: string;
798
+ /** Wallet-native payment request objects passed through verbatim (advanced — overrides SDK defaults). */
720
799
  raw_data_initialization?: WalletRawDataInitialization;
800
+ /** Optional access token for wallets that require additional auth beyond the chargeToken. */
721
801
  access_token?: string;
802
+ /** Optional refresh token paired with `access_token`. */
722
803
  refresh_token?: string;
804
+ /** Visual styling overrides for the wallet buttons. */
723
805
  style?: WalletStyles;
806
+ /** Restrict which wallets the container should render. Defaults to all wallets the chargeToken authorizes. */
724
807
  wallets?: WALLET_TYPE[];
808
+ /** Optional client identifier passed through to the wallet provider when required. */
725
809
  client_id?: string;
810
+ /**
811
+ * Apple Pay device capabilities allowed for the button to be considered available.
812
+ * Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
813
+ */
726
814
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
727
815
  }
728
816
 
729
- declare class Link {
730
- protected env: Env;
731
- protected linkResource: string;
732
- protected params: IParams;
733
- protected widgetId: string;
734
- constructor(linkResource: string);
735
- getNetUrl(): string;
736
- getUrl(): string;
737
- setParams(params: IParams | IWalletParams | ISRCParams): void;
738
- concatParams(params: IParams): void;
739
- getParams(): IParams;
740
- setEnv(env: string, alias?: string): void;
741
- getEnv(): string;
742
- getBaseUrl(): string;
743
- }
744
-
745
- declare class IFrame {
746
- protected container: Container;
747
- constructor(container: Container);
748
- load(link: string, options?: {
749
- title?: string;
750
- attributes?: Record<string, string>;
751
- styles?: Record<string, string>;
752
- }, iframeClass?: string): void;
753
- loadFromHtml(content: string, options?: {
754
- title?: string;
755
- }, iframeClass?: string): void;
756
- remove(): void;
757
- show(): void;
758
- hide(saveSize?: boolean): void;
759
- isExist(): boolean;
760
- getElement(): HTMLIFrameElement;
761
- setStyle(property: string, value: string): void;
762
- setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
763
- private setStyles;
764
- }
765
-
766
817
  /**
767
818
  * List of available payment source types
768
819
  *
@@ -971,6 +1022,22 @@ declare class Trigger {
971
1022
  push(triggerName: string, data?: ITriggerData): void;
972
1023
  }
973
1024
 
1025
+ declare class Link {
1026
+ protected env: Env;
1027
+ protected linkResource: string;
1028
+ protected params: IParams;
1029
+ protected widgetId: string;
1030
+ constructor(linkResource: string);
1031
+ getNetUrl(): string;
1032
+ getUrl(): string;
1033
+ setParams(params: IParams | IWalletParams | ISRCParams): void;
1034
+ concatParams(params: IParams): void;
1035
+ getParams(): IParams;
1036
+ setEnv(env: string, alias?: string): void;
1037
+ getEnv(): string;
1038
+ getBaseUrl(): string;
1039
+ }
1040
+
974
1041
  /**
975
1042
  * Current constant include available type of element for styling
976
1043
  * @const STYLABLE_ELEMENT
@@ -1069,42 +1136,90 @@ interface IElementStyleTitleDescription {
1069
1136
  margin?: string;
1070
1137
  }
1071
1138
 
1139
+ /**
1140
+ * Top-level classification of an error. Used by the SDK to route errors to the
1141
+ * right category in instrumentation and to give consumers a coarse-grained
1142
+ * tag for grouping/filtering. See {@link getErrorCategory} for the mapping
1143
+ * between {@link ERROR_CAUSE} and {@link ERROR_CATEGORY}.
1144
+ */
1072
1145
  declare const ERROR_CATEGORY: {
1146
+ /** SDK was misconfigured (missing keys, invalid options, etc.). */
1073
1147
  readonly CONFIGURATION: "configuration";
1148
+ /** Authentication or authorization failure. */
1074
1149
  readonly IDENTITY: "identity_access_management";
1150
+ /** SDK internal failure or upstream service problem. */
1075
1151
  readonly INTERNAL: "internal";
1152
+ /** Flow lifecycle event (user cancelled, aborted, etc.) — not a real fault. */
1076
1153
  readonly PROCESS: "process";
1154
+ /** Resource lookup failed or was rate-limited. */
1077
1155
  readonly RESOURCE: "resource";
1156
+ /** Invalid input or business-rule validation failure. */
1078
1157
  readonly VALIDATION: "validation";
1079
1158
  };
1080
1159
  type ErrorCategory = (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATEGORY];
1160
+ /**
1161
+ * Concrete cause of an error. More specific than {@link ERROR_CATEGORY} —
1162
+ * useful for deciding programmatic responses (e.g. show a retry button only
1163
+ * when `cause` is `'service_unreachable'` or `'server_busy'`).
1164
+ */
1081
1165
  declare const ERROR_CAUSE: {
1166
+ /** Operation was aborted programmatically. */
1082
1167
  readonly ABORTED: "aborted";
1168
+ /** Caller has insufficient permissions for the operation. */
1083
1169
  readonly ACCESS_FORBIDDEN: "access_forbidden";
1170
+ /** Resource already exists when create was expected. */
1084
1171
  readonly ALREADY_EXISTS: "already_exists";
1172
+ /** User cancelled the flow (e.g. closed the wallet sheet). */
1085
1173
  readonly CANCELED: "canceled";
1174
+ /** SDK was instantiated or invoked with invalid configuration. */
1086
1175
  readonly INVALID_CONFIGURATION: "invalid_configuration";
1176
+ /** Input failed structural or business-rule validation. */
1087
1177
  readonly INVALID_INPUT: "invalid_input";
1178
+ /** Resource was not found by the backend. */
1088
1179
  readonly NOT_FOUND: "not_found";
1180
+ /** Operation is not supported in the current context or version. */
1089
1181
  readonly NOT_IMPLEMENTED: "not_implemented";
1182
+ /** Caller exceeded the allowed request rate. */
1090
1183
  readonly RATE_LIMITED: "rate_limited";
1184
+ /** Backend is healthy but currently overloaded — typically retryable. */
1091
1185
  readonly SERVER_BUSY: "server_busy";
1186
+ /** Backend or third-party service could not be reached — typically retryable. */
1092
1187
  readonly SERVICE_UNREACHABLE: "service_unreachable";
1188
+ /** Caller is not authenticated. */
1093
1189
  readonly UNAUTHORIZED: "unauthorized";
1190
+ /** Catch-all when no other cause applies. */
1094
1191
  readonly UNKNOWN: "unknown_error";
1192
+ /** Request was syntactically valid but semantically rejected. */
1095
1193
  readonly UNPROCESSABLE_ENTITY: "unprocessable_entity";
1096
1194
  };
1097
1195
  type ErrorCause = (typeof ERROR_CAUSE)[keyof typeof ERROR_CAUSE];
1196
+ /**
1197
+ * Diagnostic detail attached to every {@link IEventError}.
1198
+ * Useful for logging, surfacing user-facing messages, and correlating with
1199
+ * server-side logs via `contextId`.
1200
+ */
1098
1201
  interface ErrorDetails {
1202
+ /** Concrete cause classification (mirrors the top-level `cause` on `IEventError`). */
1099
1203
  cause: ErrorCause;
1204
+ /** Correlation identifier — typically a request id or trace id from the backend. Empty string when none is available. */
1100
1205
  contextId: string;
1206
+ /** Human-readable message safe to surface to developers (NOT necessarily safe for end-users). */
1101
1207
  message: string;
1208
+ /** ISO 8601 UTC timestamp captured at error creation time. */
1102
1209
  timestamp: string;
1103
1210
  }
1211
+ /**
1212
+ * Standard error envelope emitted by the SDK on event payloads (`IEventData.error`)
1213
+ * and exposed publicly so integrators can `instanceof`/structurally narrow against it.
1214
+ */
1104
1215
  interface IEventError {
1216
+ /** Concrete cause of the error. See {@link ERROR_CAUSE} for the full list. */
1105
1217
  cause: ErrorCause;
1218
+ /** Coarse-grained category derived from `cause`. See {@link ERROR_CATEGORY}. */
1106
1219
  category: ErrorCategory;
1220
+ /** Whether the operation can be retried as-is. Must be set explicitly by the producer; `EventError.create()` defaults it to `false`. The intended candidates for `true` are transient causes such as `service_unreachable` and `server_busy`. */
1107
1221
  retryable: boolean;
1222
+ /** Diagnostic detail (message, timestamp, correlation id). */
1108
1223
  details: ErrorDetails;
1109
1224
  }
1110
1225
 
@@ -1361,346 +1476,646 @@ declare class MultiWidget {
1361
1476
  }): void;
1362
1477
  }
1363
1478
 
1364
- interface IEventMetaData extends IEventData$1 {
1365
- configuration_token: string;
1366
- type: string;
1367
- account_name?: string;
1368
- account_number?: string;
1369
- card_number_last4?: string;
1370
- card_number_length?: number;
1371
- card_scheme?: string;
1372
- gateway_type?: string;
1373
- }
1374
- interface IEventFinishData extends IEventData$1 {
1375
- address_city?: string;
1376
- address_country?: string;
1377
- address_line1?: string;
1378
- address_line2?: string;
1379
- address_postcode?: string;
1380
- address_state?: string;
1381
- card_scheme?: string;
1382
- email?: string;
1383
- expire_month?: string;
1384
- expire_year?: string;
1385
- first_name?: string;
1386
- last_name?: string;
1387
- payment_source: string;
1388
- payment_source_token?: string;
1389
- phone?: string;
1390
- save_card_consent_accepted?: boolean;
1391
- }
1392
- /**
1393
- * Interface of data from validation event.
1394
- *
1395
- * @interface IFormValidation
1396
- *
1397
- * @param {string} event The name of the event.
1398
- * @param {string} message_source A system variable that identifies the event source.
1399
- * @param {string} purpose A system variable that states the purpose of the event.
1400
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1401
- * @param {boolean} [form_valid] Indicates wether or not the form is valid.
1402
- * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
1403
- * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
1404
- * @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.
1405
- * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
1406
- */
1407
- /**
1408
- * Contains basic information associated with the event and additional meta data
1409
- * specific to the event. E.g., card info, gateway info, etc.
1410
- *
1411
- * @interface IEventMetaData
1412
- *
1413
- * @param {string} event The name of the event.
1414
- * @param {string} purpose A system variable that states the purpose of the event.
1415
- * @param {string} message_source A system variable that identifies the event source.
1416
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1417
- * @param {string} configuration_token Token received from our API with widget data
1418
- * @param {string} type Payment type 'card', 'bank_account'
1419
- * @param {string} gateway_type Gateway type
1420
- * @param {string} [card_number_last4] Last 4 digit of your card
1421
- * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
1422
- * @param {number} [card_number_length] Card number length
1423
- * @param {string} [account_name] Bank account account name
1424
- * @param {string} [account_number] Bank account account number
1425
- * */
1426
- /**
1427
- * Interface of data from event.
1428
- * @interface IEventAfterLoadData
1429
- *
1430
- * @param {string} event The name of the event.
1431
- * @param {string} purpose A system variable that states the purpose of the event.
1432
- * @param {string} message_source A system variable that identifies the event source.
1433
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1434
- * */
1435
- /**
1436
- * Interface of data from event.
1437
- * @interface IEventFinishData
1438
- *
1439
- * @param {string} event The name of the event.
1440
- * @param {string} purpose A system variable that states the purpose of the event.
1441
- * @param {string} message_source A system variable that identifies the event source.
1442
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1443
- * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
1444
- * */
1445
- /**
1446
- * List of available event's name
1447
- * @const EVENT
1448
- *
1449
- * @type {object}
1450
- * @param {string} AFTER_LOAD=afterLoad
1451
- * @param {string} SUBMIT=submit
1452
- * @param {string} FINISH=finish
1453
- * @param {string} VALIDATION=validation
1454
- * @param {string} VALIDATION_ERROR=validationError
1455
- * @param {string} SYSTEM_ERROR=systemError
1456
- * @param {string} META_CHANGE=metaChange
1457
- * @param {string} RESIZE=resize
1458
- */
1459
1479
  /**
1460
- * List of available event's name
1461
- * @const VAULT_DISPLAY_EVENT
1462
1480
  *
1463
- * @type {object}
1464
- * @param {string} AFTER_LOAD=afterLoad
1465
- * @param {string} SYSTEM_ERROR=system_error
1466
- * @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
1467
- * @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
1468
- * @param {string} ACCESS_FORBIDDEN=access_forbidden
1469
- * @param {string} SESSION_EXPIRED=systemError
1470
- * @param {string} SYSTEM_ERROR=session_expired
1471
- * @param {string} OPERATION_FORBIDDEN=operation_forbidden
1472
- */
1473
- /**
1474
- * Class HtmlMultiWidget include method for working with html
1481
+ * Class PaymentSourceWidget include method for for creating iframe url
1475
1482
  * @constructor
1476
- * @extends MultiWidget
1477
1483
  *
1478
- * @param {string} selector - Selector of html element. Container for widget
1479
1484
  * @param {string} publicKey - PayDock users public key
1480
- * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
1481
- * @example
1482
- * var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
1483
- *
1484
- * var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
1485
- *
1486
- * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
1485
+ * @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true)
1486
+ * @param {boolean} [useReference=false]
1487
1487
  *
1488
- * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
1489
- * Configuration(), // default gateway_id,
1490
- * Configuration('not_configured'), // without gateway,
1491
- * Configuration('gatewayId'),
1492
- * Configuration('gatewayId', 'bank_account')
1493
- * ]);
1488
+ * @example
1489
+ * var widget = new PaymentSourceWidget('publicKey','customerId');
1490
+ * // or
1491
+ * var widget = new PaymentSourceWidget('publicKey', customerReference, true);
1494
1492
  */
1495
- declare class HtmlMultiWidget extends MultiWidget {
1496
- protected container: Container;
1497
- protected iFrame: IFrame;
1498
- protected triggerElement: Trigger;
1499
- protected validationData: IFormValidation;
1500
- /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
1493
+ declare class PaymentSourceWidget {
1494
+ protected link: Link;
1495
+ protected configs: Configuration[];
1496
+ protected configTokens: string[];
1497
+ protected publicKey: string;
1498
+ /** @constructs */ constructor(accessToken: string, queryToken: string);
1501
1499
  /**
1502
- * Loads the widget.
1503
- *
1504
- * Calling this method results in an iframe element being inserted and rendered in the DOM.
1505
- */
1506
- load(): void;
1507
- /**
1508
- * Registers a form validation callback for validation events.
1509
- */
1510
- protected afterLoad(): void;
1511
- /**
1512
- * Listen to events of widget
1500
+ * Object contain styles for widget
1513
1501
  *
1514
1502
  * @example
1515
- *
1516
- * ```javascript
1517
- * widget.on('form_submit', function (data) {
1518
- * console.log(data);
1519
- * });
1520
- * ```
1503
+ * widget.setStyles({
1504
+ * background_color: 'rgb(0, 0, 0)',
1505
+ * border_color: 'yellow',
1506
+ * text_color: '#FFFFAA',
1507
+ * icon_size: 'small',
1508
+ * font_size: '20px'
1509
+ * });
1510
+ * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1511
+ */
1512
+ setStyles(styles: IStyles$1): void;
1513
+ setStyle(param: string, value: string): void;
1514
+ /**
1515
+ * Current method can set custom ID to identify the data in the future
1521
1516
  *
1522
1517
  * @example
1518
+ * widget.setRefId('id');
1523
1519
  *
1524
- * ```javascript
1525
- * widget.on('form_submit').then(function (data) {
1526
- * console.log(data);
1527
- * });
1528
- * ```
1529
- *
1530
- * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
1531
- *
1532
- * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
1533
- * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
1520
+ * @param {string} refId - custom id
1521
+ */
1522
+ setRefId(refId: string): void;
1523
+ /**
1524
+ * Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next.
1534
1525
  *
1535
- * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
1526
+ * @param {string} count - payment source count
1536
1527
  */
1537
- on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
1538
- on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
1528
+ setLimit(count: number): void;
1539
1529
  /**
1540
- * Registers callback that will be invoked for every trigger.
1530
+ * Current method can change environment. By default environment = sandbox
1531
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
1541
1532
  *
1542
- * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
1543
- * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
1533
+ * @example
1534
+ * widget.setEnv('production');
1535
+ * @param {string} env - sandbox, production
1536
+ * @param {string} [alias] - Own domain alias
1544
1537
  */
1545
- trigger(triggerName: string, data?: ITriggerData): void;
1538
+ setEnv(env: string, alias?: string): void;
1539
+ getEnv(): void;
1546
1540
  /**
1547
- * Gets a reference to the form current validation state.
1541
+ * Method for getting iframe's url
1542
+ */
1543
+ getIFrameUrl(): string;
1544
+ /**
1545
+ * Show payment source inside widget only with requested gateway ids
1548
1546
  *
1549
- * !Warning: do not directly modify the values of the returned object.
1550
1547
  *
1551
- * @return {IFormValidation} Form validation object
1548
+ * @param {string[]} ids - List of gateway_id
1552
1549
  */
1553
- getValidationState(): IFormValidation;
1550
+ filterByGatewayIds(ids: string[]): void;
1554
1551
  /**
1555
- * Checks if a given form is valid.
1556
1552
  *
1557
- * A form is valid if all form fields are valid.
1553
+ * Show payment source inside widget only with requested payment source types
1558
1554
  *
1559
- * @return {boolean} Indicates wether or not form is valid.
1555
+ * @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
1560
1556
  */
1561
- isValidForm(): boolean;
1557
+ filterByTypes(types: string[]): void;
1562
1558
  /**
1563
- * Using this method you can check if a specific form field is invalid
1559
+ * Method for setting a custom language code
1564
1560
  *
1565
- * @param {string} field - Field name
1566
- * @return {boolean} Field is invalid
1561
+ * @example
1562
+ * config.setLanguage('en');
1563
+ * @param {string} code - ISO 639-1
1567
1564
  */
1568
- isInvalidField(field?: string): boolean;
1565
+ setLanguage(code: any): void;
1566
+ }
1567
+
1568
+ interface IEventSelectData extends IEventData$1 {
1569
+ customer_id: string;
1570
+ payment_source_id: string;
1571
+ gateway_id: string;
1572
+ primary: boolean;
1573
+ card_number_last4?: string;
1574
+ card_scheme?: string;
1575
+ checkout_email?: string;
1576
+ gateway_type?: string;
1577
+ payment_source_type: string;
1578
+ account_name?: string;
1579
+ account_number?: string;
1580
+ }
1581
+ interface IEventPaginationData extends IEventData$1 {
1582
+ total_item: number;
1583
+ skip: number;
1584
+ limit: number;
1585
+ }
1586
+ interface IEventAfterLoadData$1 extends IEventData$1 {
1587
+ total_item: number;
1588
+ skip: number;
1589
+ limit: number;
1590
+ }
1591
+ interface IEventSizeData extends IEventData$1 {
1592
+ height: number;
1593
+ width: number;
1594
+ }
1595
+ /**
1596
+ * Interface of data from event.
1597
+ *
1598
+ * @interface IEventSelectData
1599
+ *
1600
+ * @param {string} event
1601
+ * @param {string} purpose
1602
+ * @param {string} message_source
1603
+ * @param {string} [ref_id]
1604
+ * @param {string} customer_id
1605
+ * @param {string} payment_source_id
1606
+ * @param {string} gateway_id
1607
+ * @param {boolean} primary
1608
+ * @param {string} [widget_id]
1609
+ * @param {string} [card_number_last4]
1610
+ * @param {string} [card_scheme]
1611
+ * @param {string} gateway_type
1612
+ * @param {string} [checkout_email]
1613
+ * @param {string} payment_source_type
1614
+ * @param {string} [account_name]
1615
+ * @param {string} [account_number]
1616
+ * */
1617
+ /**
1618
+ * Interface of data from event.
1619
+ *
1620
+ * @interface IEventPaginationData
1621
+ *
1622
+ * @param {string} event
1623
+ * @param {string} purpose
1624
+ * @param {string} message_source
1625
+ * @param {string} [ref_id]
1626
+ * @param {number} total_item
1627
+ * @param {number} skip
1628
+ * @param {number} limit
1629
+ * */
1630
+ /**
1631
+ * Interface of data from event.
1632
+ *
1633
+ * @interface IEventAfterLoadData
1634
+ *
1635
+ * @param {string} event The name of the event.
1636
+ * @param {string} purpose A system variable that states the purpose of the event.
1637
+ * @param {string} message_source A system variable that identifies the event source.
1638
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1639
+ * @param {number} total_item Pagination param. Total item count
1640
+ * @param {number} skip Pagination param. Skip items from first item
1641
+ * @param {number} limit Pagination param. Query limit
1642
+ * */
1643
+ /**
1644
+ * Interface of data from event.
1645
+ * @interface IEventFinishData
1646
+ *
1647
+ * @param {string} event The name of the event.
1648
+ * @param {string} purpose A system variable that states the purpose of the event.
1649
+ * @param {string} message_source A system variable that identifies the event source.
1650
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1651
+ * */
1652
+ /**
1653
+ * Interface of data from event.
1654
+ * @interface IEventSizeData
1655
+ *
1656
+ * @param {number} event The name of the event.
1657
+ * @param {number} purpose A system variable that states the purpose of the event.
1658
+ * @param {string} message_source A system variable that identifies the event source.
1659
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1660
+ * @param {number} height Height of iFrame
1661
+ * @param {number} width Width of iFrame
1662
+ * */
1663
+ /**
1664
+ * List of available event's name
1665
+ *
1666
+ * @const EVENT
1667
+ *
1668
+ * @type {object}
1669
+ * @param {string} AFTER_LOAD=afterLoad
1670
+ * @param {string} SYSTEM_ERROR=systemError
1671
+ * @param {string} SELECT=select
1672
+ * @param {string} UNSELECT=unselect
1673
+ * @param {string} NEXT=next
1674
+ * @param {string} PREV=prev
1675
+ * @param {string} META_CHANGE=metaChange
1676
+ * @param {string} RESIZE=resize
1677
+ */
1678
+ /**
1679
+ * Class HtmlPaymentSourceWidget include method for working on html
1680
+ * @constructor
1681
+ * @extends PaymentSourceWidget
1682
+ *
1683
+ * @param {string} selector - Selector of html element. Container for widget
1684
+ * @param {string} publicKey - PayDock users public key
1685
+ * @param {string} queryToken - PayDock's query token that represents params to search customer by id or reference
1686
+ * @example
1687
+ * * var widget = new HtmlPaymentSourceWidget('#widget', 'publicKey','queryToken');
1688
+
1689
+ */
1690
+ declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
1691
+ protected container: Container;
1692
+ protected iFrame: IFrame;
1693
+ protected event: IFrameEvent;
1694
+ /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
1569
1695
  /**
1570
- * Checks if a given form field is displaying an error.
1571
- *
1572
- * @param {string} field - The form field name
1696
+ * The final method to beginning, the load process of widget to html
1573
1697
  *
1574
- * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
1575
1698
  */
1576
- isFieldErrorShowed(field?: string): boolean;
1699
+ load(): void;
1577
1700
  /**
1578
- * Checks if a given form field is valid or invalid by name.
1579
- *
1580
- * @param {string} field - The form field name
1581
- * @param validator - The name of the validator.
1701
+ * This callback will be called for each event in payment source widget
1582
1702
  *
1583
- * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
1703
+ * @callback listener--PaymentSourceWidget
1704
+ * @param {IEventData | IEventSelectData | IEventPaginationData | IEventAfterLoadData} response
1584
1705
  */
1585
- isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
1586
1706
  /**
1587
- * Hides the widget.
1707
+ * Listen to events of widget
1588
1708
  *
1589
- * E.g., use this method to hide the widget after it loads.
1709
+ * @example
1590
1710
  *
1591
- * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
1711
+ * widget.on('select', function (data) {
1712
+ * console.log(data);
1713
+ * });
1714
+ * @param {string} eventName - Available event names [EVENT]{@link EVENT}
1715
+ * @param {listener--PaymentSourceWidget} cb
1716
+ */
1717
+ on(eventName: string, cb: (data: IEventData$1 | IEventSelectData | IEventPaginationData | IEventAfterLoadData$1 | IEventSizeData) => void): void;
1718
+ /**
1719
+ * Using this method you can hide widget after load
1720
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size
1592
1721
  */
1593
1722
  hide(saveSize: boolean): void;
1594
1723
  /**
1595
- * Shows the widget.
1724
+ * Using this method you can show widget after using hide method
1596
1725
  *
1597
- * E.g., use this method to show the widget after it was explicitly hidden.
1598
1726
  */
1599
1727
  show(): void;
1600
1728
  /**
1601
- * Reloads the widget.
1729
+ * Using this method you can reload widget
1730
+ *
1602
1731
  */
1603
1732
  reload(): void;
1604
1733
  /**
1605
- * Hides the specified Widget elements by their identifier.
1606
- *
1607
- * @example
1608
- *
1609
- * ```javascript
1610
- * widget.hideElements(['submit_button', 'email']);
1611
- * ```
1734
+ * After select event of widget, data (dataType) will be insert to input (selector)
1612
1735
  *
1613
- * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
1736
+ * @param {string} selector - css selector . [] #
1737
+ * @param {string} dataType - data type of [IEventSelectData]{@link IEventSelectData}.
1614
1738
  */
1615
- hideElements(elements: string[]): void;
1739
+ onSelectInsert(selector: string, dataType: string): void;
1740
+ }
1741
+
1742
+ /**
1743
+ * Maps widget event names to their callback data types.
1744
+ *
1745
+ * When using `widget.on(EVENT.FINISH, (data) => { ... })`, TypeScript will
1746
+ * automatically narrow `data` to `IEventFinishData` based on this map.
1747
+ */
1748
+ interface WidgetEventMap {
1749
+ afterLoad: IEventAfterLoadData;
1750
+ submit: IEventData$1;
1751
+ finish: IEventFinishData;
1752
+ validationError: IEventData$1;
1753
+ systemError: IEventData$1;
1754
+ error: IEventData$1;
1755
+ /** @deprecated Use checkoutReady instead */
1756
+ checkoutSuccess: IEventData$1;
1757
+ checkoutReady: IEventData$1;
1758
+ checkoutError: IEventData$1;
1759
+ checkoutCompleted: IEventData$1;
1760
+ checkoutPopupOpen: IEventData$1;
1761
+ checkoutPopupClose: IEventData$1;
1762
+ recognitionTokenRequested: IEventData$1;
1763
+ recognitionTokenDropped: IEventData$1;
1764
+ validation: IFormValidation;
1765
+ select: IEventData$1;
1766
+ unselect: IEventData$1;
1767
+ next: IEventData$1;
1768
+ prev: IEventData$1;
1769
+ metaChange: IEventMetaData;
1770
+ resize: IEventSizeData;
1771
+ }
1772
+ /** Union of all known widget event names */
1773
+ type WidgetEventName = keyof WidgetEventMap;
1774
+
1775
+ interface IEventMetaData extends IEventData$1 {
1776
+ configuration_token: string;
1777
+ type: string;
1778
+ account_name?: string;
1779
+ account_number?: string;
1780
+ card_number_last4?: string;
1781
+ card_number_length?: number;
1782
+ card_scheme?: string;
1783
+ gateway_type?: string;
1784
+ }
1785
+ interface IEventAfterLoadData extends IEventData$1 {
1786
+ }
1787
+ interface IEventFinishData extends IEventData$1 {
1788
+ address_city?: string;
1789
+ address_country?: string;
1790
+ address_line1?: string;
1791
+ address_line2?: string;
1792
+ address_postcode?: string;
1793
+ address_state?: string;
1794
+ card_scheme?: string;
1795
+ email?: string;
1796
+ expire_month?: string;
1797
+ expire_year?: string;
1798
+ first_name?: string;
1799
+ last_name?: string;
1800
+ payment_source: string;
1801
+ payment_source_token?: string;
1802
+ phone?: string;
1803
+ save_card_consent_accepted?: boolean;
1804
+ }
1805
+ /**
1806
+ * Interface of data from validation event.
1807
+ *
1808
+ * @interface IFormValidation
1809
+ *
1810
+ * @param {string} event The name of the event.
1811
+ * @param {string} message_source A system variable that identifies the event source.
1812
+ * @param {string} purpose A system variable that states the purpose of the event.
1813
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1814
+ * @param {boolean} [form_valid] Indicates wether or not the form is valid.
1815
+ * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
1816
+ * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
1817
+ * @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.
1818
+ * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
1819
+ */
1820
+ /**
1821
+ * Contains basic information associated with the event and additional meta data
1822
+ * specific to the event. E.g., card info, gateway info, etc.
1823
+ *
1824
+ * @interface IEventMetaData
1825
+ *
1826
+ * @param {string} event The name of the event.
1827
+ * @param {string} purpose A system variable that states the purpose of the event.
1828
+ * @param {string} message_source A system variable that identifies the event source.
1829
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1830
+ * @param {string} configuration_token Token received from our API with widget data
1831
+ * @param {string} type Payment type 'card', 'bank_account'
1832
+ * @param {string} gateway_type Gateway type
1833
+ * @param {string} [card_number_last4] Last 4 digit of your card
1834
+ * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
1835
+ * @param {number} [card_number_length] Card number length
1836
+ * @param {string} [account_name] Bank account account name
1837
+ * @param {string} [account_number] Bank account account number
1838
+ * */
1839
+ /**
1840
+ * Interface of data from event.
1841
+ * @interface IEventAfterLoadData
1842
+ *
1843
+ * @param {string} event The name of the event.
1844
+ * @param {string} purpose A system variable that states the purpose of the event.
1845
+ * @param {string} message_source A system variable that identifies the event source.
1846
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1847
+ * */
1848
+ /**
1849
+ * Interface of data from event.
1850
+ * @interface IEventFinishData
1851
+ *
1852
+ * @param {string} event The name of the event.
1853
+ * @param {string} purpose A system variable that states the purpose of the event.
1854
+ * @param {string} message_source A system variable that identifies the event source.
1855
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1856
+ * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
1857
+ * */
1858
+ /**
1859
+ * List of available event's name
1860
+ * @const EVENT
1861
+ *
1862
+ * @type {object}
1863
+ * @param {string} AFTER_LOAD=afterLoad
1864
+ * @param {string} SUBMIT=submit
1865
+ * @param {string} FINISH=finish
1866
+ * @param {string} VALIDATION=validation
1867
+ * @param {string} VALIDATION_ERROR=validationError
1868
+ * @param {string} SYSTEM_ERROR=systemError
1869
+ * @param {string} META_CHANGE=metaChange
1870
+ * @param {string} RESIZE=resize
1871
+ */
1872
+ /**
1873
+ * List of available event's name
1874
+ * @const VAULT_DISPLAY_EVENT
1875
+ *
1876
+ * @type {object}
1877
+ * @param {string} AFTER_LOAD=afterLoad
1878
+ * @param {string} SYSTEM_ERROR=system_error
1879
+ * @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
1880
+ * @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
1881
+ * @param {string} ACCESS_FORBIDDEN=access_forbidden
1882
+ * @param {string} SESSION_EXPIRED=systemError
1883
+ * @param {string} SYSTEM_ERROR=session_expired
1884
+ * @param {string} OPERATION_FORBIDDEN=operation_forbidden
1885
+ */
1886
+ /**
1887
+ * Class HtmlMultiWidget include method for working with html
1888
+ * @constructor
1889
+ * @extends MultiWidget
1890
+ *
1891
+ * @param {string} selector - Selector of html element. Container for widget
1892
+ * @param {string} publicKey - PayDock users public key
1893
+ * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
1894
+ * @example
1895
+ * var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
1896
+ *
1897
+ * var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
1898
+ *
1899
+ * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
1900
+ *
1901
+ * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
1902
+ * Configuration(), // default gateway_id,
1903
+ * Configuration('not_configured'), // without gateway,
1904
+ * Configuration('gatewayId'),
1905
+ * Configuration('gatewayId', 'bank_account')
1906
+ * ]);
1907
+ */
1908
+ declare class HtmlMultiWidget extends MultiWidget {
1909
+ protected container: Container;
1910
+ protected iFrame: IFrame;
1911
+ protected triggerElement: Trigger;
1912
+ protected validationData: IFormValidation;
1913
+ /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
1616
1914
  /**
1617
- * Shows the specified Widget elements by their identifier.
1618
- *
1619
- * @example
1620
- *
1621
- * ```javascript
1622
- * widget.showElements(['submit_button', 'email']);
1623
- * ```
1915
+ * Loads the widget.
1624
1916
  *
1625
- * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
1917
+ * Calling this method results in an iframe element being inserted and rendered in the DOM.
1626
1918
  */
1627
- showElements(elements: string[]): void;
1919
+ load(): void;
1628
1920
  /**
1629
- * Updates the form field values inside the widget.
1921
+ * Registers a form validation callback for validation events.
1922
+ */
1923
+ protected afterLoad(): void;
1924
+ /**
1925
+ * Listen to events of widget
1630
1926
  *
1631
1927
  * @example
1632
1928
  *
1633
1929
  * ```javascript
1634
- * widget.updateFormValues({
1635
- * email: 'predefined@email.com',
1636
- * card_name: 'Houston'
1930
+ * widget.on('form_submit', function (data) {
1931
+ * console.log(data);
1637
1932
  * });
1638
- *```
1639
- *
1640
- * @param {IFormValues} fieldValues - Fields with values
1641
- */
1642
- updateFormValues(fieldValues: IFormValues): void;
1643
- /**
1644
- * Updates a single form field values inside the widget by the form field name.
1933
+ * ```
1645
1934
  *
1646
1935
  * @example
1647
1936
  *
1648
1937
  * ```javascript
1649
- * widget.updateFormValue("card_name", "John Doe");
1650
- *```
1938
+ * widget.on('form_submit').then(function (data) {
1939
+ * console.log(data);
1940
+ * });
1941
+ * ```
1651
1942
  *
1652
- * @param {string} key - The form field name
1653
- * @param {string} value - The form field value
1943
+ * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
1944
+ *
1945
+ * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
1946
+ * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
1947
+ *
1948
+ * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
1654
1949
  */
1655
- updateFormValue(key: string, value: string): void;
1950
+ on<E extends WidgetEventName>(eventName: E, cb: (data: WidgetEventMap[E]) => void): void;
1951
+ on<E extends WidgetEventName>(eventName: E): Promise<WidgetEventMap[E]>;
1952
+ on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): void;
1953
+ on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
1656
1954
  /**
1657
- * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
1955
+ * Registers callback that will be invoked for every trigger.
1658
1956
  *
1659
- * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
1660
- * @param {string} dataType - The data type of IEventData object.
1957
+ * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
1958
+ * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
1661
1959
  */
1662
- onFinishInsert(selector: string, dataType: string): void;
1960
+ trigger(triggerName: string, data?: ITriggerData): void;
1663
1961
  /**
1664
- * Intercepts a form submission and delegates processing to the widget.
1962
+ * Gets a reference to the form current validation state.
1665
1963
  *
1666
- * An simplified example of the process:
1667
- * - User clicks submit button in your form
1668
- * - This implicitly triggers a submission to the widget
1669
- * - The widget submits your form
1964
+ * !Warning: do not directly modify the values of the returned object.
1670
1965
  *
1671
- * @note The widget's submit button will be hidden.
1966
+ * @return {IFormValidation} Form validation object
1967
+ */
1968
+ getValidationState(): IFormValidation;
1969
+ /**
1970
+ * Checks if a given form is valid.
1672
1971
  *
1673
- * @param {string} selector - css selector of your form
1972
+ * A form is valid if all form fields are valid.
1674
1973
  *
1675
- * @example
1974
+ * @return {boolean} Indicates wether or not form is valid.
1975
+ */
1976
+ isValidForm(): boolean;
1977
+ /**
1978
+ * Using this method you can check if a specific form field is invalid
1676
1979
  *
1677
- * ```html
1678
- * <body>
1679
- * <form id="myForm">
1680
- * <input name="amount">
1681
- * <button type="submit">Submit</button>
1682
- * </form>
1683
- * <script>
1684
- * widget.interceptSubmitForm('#myForm');
1685
- * </script>
1686
- * </body>
1687
- * ```
1980
+ * @param {string} field - Field name
1981
+ * @return {boolean} Field is invalid
1688
1982
  */
1689
- interceptSubmitForm(selector: string): void;
1983
+ isInvalidField(field?: string): boolean;
1690
1984
  /**
1691
- * This method hides a submit button and automatically execute form submit
1985
+ * Checks if a given form field is displaying an error.
1986
+ *
1987
+ * @param {string} field - The form field name
1988
+ *
1989
+ * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
1692
1990
  */
1693
- useCheckoutAutoSubmit(): void;
1991
+ isFieldErrorShowed(field?: string): boolean;
1694
1992
  /**
1695
- * Use this method for resize iFrame according content height
1993
+ * Checks if a given form field is valid or invalid by name.
1696
1994
  *
1697
- * @example
1995
+ * @param {string} field - The form field name
1996
+ * @param validator - The name of the validator.
1698
1997
  *
1699
- * ```javascript
1700
- * widget.useAutoResize();
1701
- *```
1998
+ * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
1702
1999
  */
1703
- useAutoResize(): void;
2000
+ isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
2001
+ /**
2002
+ * Hides the widget.
2003
+ *
2004
+ * E.g., use this method to hide the widget after it loads.
2005
+ *
2006
+ * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
2007
+ */
2008
+ hide(saveSize: boolean): void;
2009
+ /**
2010
+ * Shows the widget.
2011
+ *
2012
+ * E.g., use this method to show the widget after it was explicitly hidden.
2013
+ */
2014
+ show(): void;
2015
+ /**
2016
+ * Reloads the widget.
2017
+ */
2018
+ reload(): void;
2019
+ /**
2020
+ * Hides the specified Widget elements by their identifier.
2021
+ *
2022
+ * @example
2023
+ *
2024
+ * ```javascript
2025
+ * widget.hideElements(['submit_button', 'email']);
2026
+ * ```
2027
+ *
2028
+ * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
2029
+ */
2030
+ hideElements(elements: string[]): void;
2031
+ /**
2032
+ * Shows the specified Widget elements by their identifier.
2033
+ *
2034
+ * @example
2035
+ *
2036
+ * ```javascript
2037
+ * widget.showElements(['submit_button', 'email']);
2038
+ * ```
2039
+ *
2040
+ * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
2041
+ */
2042
+ showElements(elements: string[]): void;
2043
+ /**
2044
+ * Updates the form field values inside the widget.
2045
+ *
2046
+ * @example
2047
+ *
2048
+ * ```javascript
2049
+ * widget.updateFormValues({
2050
+ * email: 'predefined@email.com',
2051
+ * card_name: 'Houston'
2052
+ * });
2053
+ *```
2054
+ *
2055
+ * @param {IFormValues} fieldValues - Fields with values
2056
+ */
2057
+ updateFormValues(fieldValues: IFormValues): void;
2058
+ /**
2059
+ * Updates a single form field values inside the widget by the form field name.
2060
+ *
2061
+ * @example
2062
+ *
2063
+ * ```javascript
2064
+ * widget.updateFormValue("card_name", "John Doe");
2065
+ *```
2066
+ *
2067
+ * @param {string} key - The form field name
2068
+ * @param {string} value - The form field value
2069
+ */
2070
+ updateFormValue(key: string, value: string): void;
2071
+ /**
2072
+ * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
2073
+ *
2074
+ * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
2075
+ * @param {string} dataType - The data type of IEventData object.
2076
+ */
2077
+ onFinishInsert(selector: string, dataType: string): void;
2078
+ /**
2079
+ * Intercepts a form submission and delegates processing to the widget.
2080
+ *
2081
+ * An simplified example of the process:
2082
+ * - User clicks submit button in your form
2083
+ * - This implicitly triggers a submission to the widget
2084
+ * - The widget submits your form
2085
+ *
2086
+ * @note The widget's submit button will be hidden.
2087
+ *
2088
+ * @param {string} selector - css selector of your form
2089
+ *
2090
+ * @example
2091
+ *
2092
+ * ```html
2093
+ * <body>
2094
+ * <form id="myForm">
2095
+ * <input name="amount">
2096
+ * <button type="submit">Submit</button>
2097
+ * </form>
2098
+ * <script>
2099
+ * widget.interceptSubmitForm('#myForm');
2100
+ * </script>
2101
+ * </body>
2102
+ * ```
2103
+ */
2104
+ interceptSubmitForm(selector: string): void;
2105
+ /**
2106
+ * This method hides a submit button and automatically execute form submit
2107
+ */
2108
+ useCheckoutAutoSubmit(): void;
2109
+ /**
2110
+ * Use this method for resize iFrame according content height
2111
+ *
2112
+ * @example
2113
+ *
2114
+ * ```javascript
2115
+ * widget.useAutoResize();
2116
+ *```
2117
+ */
2118
+ useAutoResize(): void;
1704
2119
  }
1705
2120
 
1706
2121
  /**
@@ -1829,7 +2244,7 @@ interface IEventData$1 {
1829
2244
  ref_id?: string;
1830
2245
  error?: IEventError;
1831
2246
  }
1832
- declare const EVENT$2: {
2247
+ declare const EVENT$3: {
1833
2248
  readonly AFTER_LOAD: "afterLoad";
1834
2249
  readonly SUBMIT: "submit";
1835
2250
  readonly FINISH: "finish";
@@ -1861,7 +2276,7 @@ declare const EVENT$2: {
1861
2276
  readonly DISPATCH_SUCCESS: "dispatchSuccess";
1862
2277
  readonly DISPATCH_ERROR: "dispatchError";
1863
2278
  };
1864
- type EventTypes = typeof EVENT$2[keyof typeof EVENT$2];
2279
+ type EventTypes = typeof EVENT$3[keyof typeof EVENT$3];
1865
2280
  interface Listener {
1866
2281
  event: string;
1867
2282
  listener: (event: any) => void;
@@ -1877,17 +2292,99 @@ declare class IFrameEvent {
1877
2292
  private subscribe;
1878
2293
  }
1879
2294
 
1880
- declare class Standalone3dsService {
1881
- protected container: Container;
1882
- protected eventEmitter: EventEmitter;
1883
- protected env: string;
1884
- protected alias: string;
1885
- constructor(container: Container, eventEmitter: any);
1886
- load(token: string, options: {
1887
- title: string;
1888
- }): void;
1889
- setEnv(env: string, alias?: string): void;
2295
+ /**
2296
+ * Payload emitted by the Standalone 3DS flow for auth-related events
2297
+ * (chargeAuthSuccess, chargeAuthReject, chargeAuthChallenge, chargeAuthDecoupled).
2298
+ */
2299
+ interface Canvas3dsAuthPayload {
2300
+ /** The Paydock 3DS charge identifier (e.g. `'chrg_3ds_xxxxx'`) used to correlate the authentication with the underlying charge. */
2301
+ charge_3ds_id: string;
2302
+ /** Authentication outcome status reported by the 3DS provider (e.g. `'authenticated'`, `'rejected'`, `'pending'`). */
2303
+ status: string;
2304
+ /** Optional result details. Present when the 3DS provider returns additional context for the outcome. */
2305
+ result?: {
2306
+ /** Human-readable description of the outcome (e.g. `'frictionless'`). */
2307
+ description?: string;
2308
+ };
2309
+ }
2310
+ /**
2311
+ * Payload emitted by the Standalone 3DS flow for error events.
2312
+ * `error` is intentionally `unknown` — upstream emitters do not guarantee a shape.
2313
+ */
2314
+ interface Canvas3dsErrorPayload {
2315
+ /** The Paydock 3DS charge identifier associated with the failed authentication attempt. */
2316
+ charge_3ds_id: string;
2317
+ /** The underlying error. Typed as `unknown` to force the consumer to narrow it before use. */
2318
+ error: unknown;
2319
+ }
2320
+ /**
2321
+ * Payload emitted by the iframe-based 3DS flow for auth-related events
2322
+ * (`chargeAuth`, `chargeAuthSuccess`, `chargeAuthReject`).
2323
+ *
2324
+ * Extends `IEventData` with optional 3DS-specific fields that the widget
2325
+ * merges into the message envelope for charge correlation.
2326
+ */
2327
+ interface Canvas3dsChargeAuthEventPayload extends IEventData$1 {
2328
+ /** The Paydock 3DS charge identifier. Present when the widget correlates the event with a charge. */
2329
+ charge_3ds_id?: string;
2330
+ /** Authentication outcome status reported by the widget (e.g. `'authenticated'`, `'server_error'`). */
2331
+ status?: string;
2332
+ /** Optional result details forwarded from the 3DS provider. */
2333
+ result?: {
2334
+ /** Human-readable description of the outcome (e.g. `'frictionless'`). */
2335
+ description?: string;
2336
+ };
1890
2337
  }
2338
+ /**
2339
+ * Payload emitted by the iframe-based 3DS flow for error events.
2340
+ * Extends `IEventData` with optional 3DS-specific fields for charge correlation.
2341
+ */
2342
+ interface Canvas3dsErrorEventPayload extends IEventData$1 {
2343
+ /** The Paydock 3DS charge identifier associated with the error. */
2344
+ charge_3ds_id?: string;
2345
+ }
2346
+ /**
2347
+ * Maps Canvas3ds event names to their callback data types.
2348
+ *
2349
+ * Events that can fire from both the iframe (html/url) and standalone flows
2350
+ * use a union to accommodate both shapes. Standalone-only and iframe-only events
2351
+ * use a single payload type.
2352
+ */
2353
+ interface Canvas3dsEventMap {
2354
+ /** Successful authentication. Standalone path emits `Canvas3dsAuthPayload`; iframe path emits `Canvas3dsChargeAuthEventPayload`. Narrow with `'event' in data` for iframe vs standalone. */
2355
+ chargeAuthSuccess: Canvas3dsAuthPayload | Canvas3dsChargeAuthEventPayload;
2356
+ /** Rejected authentication. Same dual-emit pattern as `chargeAuthSuccess`. */
2357
+ chargeAuthReject: Canvas3dsAuthPayload | Canvas3dsChargeAuthEventPayload;
2358
+ /** Authentication or processing error. Standalone path emits `Canvas3dsErrorPayload`; iframe path emits `Canvas3dsErrorEventPayload`. */
2359
+ error: Canvas3dsErrorPayload | Canvas3dsErrorEventPayload;
2360
+ /** Challenge required — issuer demands user interaction (OTP, biometric, etc.). Standalone-only. */
2361
+ chargeAuthChallenge: Canvas3dsAuthPayload;
2362
+ /** Decoupled authentication — issuer will authenticate out-of-band and notify later. Standalone-only. */
2363
+ chargeAuthDecoupled: Canvas3dsAuthPayload;
2364
+ /** Iframe-path authentication event. Extends `IEventData` with optional 3DS correlation fields (`charge_3ds_id`, `status`). */
2365
+ chargeAuth: Canvas3dsChargeAuthEventPayload;
2366
+ /** User cancelled the authentication flow before completion. Iframe-only. */
2367
+ chargeAuthCancelled: IEventData$1;
2368
+ /** Additional data collection step completed successfully. Iframe-only. */
2369
+ additionalDataCollectSuccess: IEventData$1;
2370
+ /** Additional data collection step was rejected. Iframe-only. */
2371
+ additionalDataCollectReject: IEventData$1;
2372
+ }
2373
+ /** Union of all known Canvas3ds event names. */
2374
+ type Canvas3dsEventName = keyof Canvas3dsEventMap;
2375
+ /**
2376
+ * Public, tree-shakeable alias for the internal `TOKEN_FORMAT` enum in canvas-3ds.ts.
2377
+ * Mirrors the string values of that enum without exposing the private enum itself.
2378
+ */
2379
+ declare const Canvas3dsTokenFormat: {
2380
+ /** Token whose `content` is a complete HTML page. The SDK renders it inside an iframe. */
2381
+ readonly HTML: "html";
2382
+ /** Token whose `content` is a URL. The SDK loads it inside an iframe. */
2383
+ readonly URL: "url";
2384
+ /** Token whose `content` describes a standalone 3DS service (e.g. GPayments). The SDK delegates to that service's flow. */
2385
+ readonly STANDALONE_3DS: "standalone_3ds";
2386
+ };
2387
+ type Canvas3dsTokenFormat = (typeof Canvas3dsTokenFormat)[keyof typeof Canvas3dsTokenFormat];
1891
2388
 
1892
2389
  /**
1893
2390
  * List of available token's content formats
@@ -1923,7 +2420,7 @@ declare enum TOKEN_FORMAT {
1923
2420
  * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
1924
2421
  * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
1925
2422
  * @param {string} ERROR=error
1926
- */
2423
+ */
1927
2424
  /**
1928
2425
  * Class Canvas3ds include method for working on html
1929
2426
  * @constructor
@@ -1971,8 +2468,10 @@ declare class Canvas3ds {
1971
2468
  */
1972
2469
  setEnv(env: string, alias?: string): void;
1973
2470
  getEnv(): string;
2471
+ on<E extends keyof Canvas3dsEventMap>(eventName: E, cb: (data: Canvas3dsEventMap[E]) => void): void;
2472
+ on<E extends keyof Canvas3dsEventMap>(eventName: E): Promise<Canvas3dsEventMap[E]>;
2473
+ on(eventName: string, cb: (data: IEventData$1) => void): void;
1974
2474
  on(eventName: string): Promise<IEventData$1>;
1975
- on(eventName: string, cb: (data: IEventData$1) => void): any;
1976
2475
  /**
1977
2476
  * Using this method you can hide widget after load
1978
2477
  * @param {boolean} [saveSize=false] - using this param you can save iframe's size
@@ -1990,55 +2489,11 @@ declare class Canvas3ds {
1990
2489
  reload(): void;
1991
2490
  }
1992
2491
 
1993
- declare class ApiChargeInternal {
1994
- protected api: ApiInternal;
1995
- constructor(api: ApiInternal);
1996
- walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
1997
- walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
1998
- standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
1999
- standalone3dsHandle(): Promise<HandleResponseInterface>;
2000
- }
2001
- interface WalletCaptureResponse {
2002
- id: string;
2003
- amount: number;
2004
- currency: string;
2005
- status: string;
2006
- }
2007
- interface WalletCaptureBody {
2008
- payment_method_id?: string;
2009
- customer?: {
2010
- payment_source?: {
2011
- type?: string;
2012
- card_name?: string;
2013
- card_scheme?: string;
2014
- card_number_last4?: string;
2015
- expire_month?: number;
2016
- expire_year?: number;
2017
- address_line1?: string;
2018
- address_line2?: string;
2019
- address_city?: string;
2020
- address_postcode?: string;
2021
- address_state?: string;
2022
- address_country?: string;
2023
- external_payer_id?: string;
2024
- ref_token?: string;
2025
- wallet_express?: boolean;
2026
- };
2027
- };
2028
- }
2029
- interface WalletCallbackBody {
2030
- request_type: string;
2031
- }
2032
- interface WalletCallbackResponse {
2033
- id: string;
2034
- status: string;
2035
- callback_method: string;
2036
- callback_rel: string;
2037
- callback_url: string;
2038
- }
2039
- interface Standalone3dsProcessBody {
2040
- charge_3ds_id: string;
2041
- }
2492
+ /**
2493
+ * Canonical shared response shapes used by both Charge and Checkout internal APIs.
2494
+ * Extracted here to remove the prior duplicated definitions in
2495
+ * api-charge-internal.ts and api-checkout-internal.ts.
2496
+ */
2042
2497
  interface HandleResponseInterface {
2043
2498
  status: string;
2044
2499
  error: string;
@@ -2087,26 +2542,85 @@ interface ProcessAuthenticationResponse {
2087
2542
  };
2088
2543
  }
2089
2544
 
2090
- declare class ApiGatewayInternal {
2545
+ declare class ApiChargeInternal {
2091
2546
  protected api: ApiInternal;
2092
2547
  constructor(api: ApiInternal);
2093
- getWalletConfig(gateway_id: string): Promise<GetWalletConfigResponse>;
2548
+ walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
2549
+ walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
2550
+ standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
2551
+ standalone3dsHandle(): Promise<HandleResponseInterface>;
2094
2552
  }
2095
- interface GetWalletConfigResponse {
2096
- type: string;
2097
- mode: string;
2098
- credentials?: object;
2553
+ interface WalletCaptureResponse {
2554
+ id: string;
2555
+ amount: number;
2556
+ currency: string;
2557
+ status: string;
2099
2558
  }
2100
-
2101
- declare class ApiServiceInternal {
2102
- protected api: ApiInternal;
2103
- constructor(api: ApiInternal);
2104
- getConfig(service_id: string): Promise<GetConfigResponse>;
2559
+ interface WalletCaptureBody {
2560
+ payment_method_id?: string;
2561
+ customer?: {
2562
+ payment_source?: {
2563
+ type?: string;
2564
+ card_name?: string;
2565
+ card_scheme?: string;
2566
+ card_number_last4?: string;
2567
+ expire_month?: number;
2568
+ expire_year?: number;
2569
+ address_line1?: string;
2570
+ address_line2?: string;
2571
+ address_city?: string;
2572
+ address_postcode?: string;
2573
+ address_state?: string;
2574
+ address_country?: string;
2575
+ external_payer_id?: string;
2576
+ ref_token?: string;
2577
+ wallet_express?: boolean;
2578
+ };
2579
+ };
2105
2580
  }
2106
- interface GetConfigResponse {
2107
- type: SERVICE_TYPES;
2108
- merchant: string;
2109
- username: string;
2581
+ interface WalletCallbackBody {
2582
+ request_type: string;
2583
+ }
2584
+ interface WalletCallbackResponse {
2585
+ id: string;
2586
+ status: string;
2587
+ callback_method: string;
2588
+ callback_rel: string;
2589
+ callback_url: string;
2590
+ }
2591
+ interface Standalone3dsProcessBody {
2592
+ charge_3ds_id: string;
2593
+ }
2594
+
2595
+ declare class ApiCheckoutInternal {
2596
+ protected api: ApiInternal;
2597
+ constructor(api: ApiInternal);
2598
+ instructions(): Observable<object>;
2599
+ private getInstructionLink;
2600
+ callback(payload: Object): Promise<Object>;
2601
+ status(id: string): Promise<Object>;
2602
+ }
2603
+
2604
+ declare class ApiGatewayInternal {
2605
+ protected api: ApiInternal;
2606
+ constructor(api: ApiInternal);
2607
+ getWalletConfig(gateway_id: string): Promise<GetWalletConfigResponse>;
2608
+ }
2609
+ interface GetWalletConfigResponse {
2610
+ type: string;
2611
+ mode: string;
2612
+ credentials?: object;
2613
+ }
2614
+
2615
+ declare class ApiServiceInternal {
2616
+ protected api: ApiInternal;
2617
+ constructor(api: ApiInternal);
2618
+ getConfig(service_id: string): Promise<GetConfigResponse>;
2619
+ }
2620
+ interface GetConfigResponse {
2621
+ type: SERVICE_TYPES;
2622
+ merchant: string;
2623
+ username: string;
2110
2624
  password: string;
2111
2625
  certificate: string;
2112
2626
  certificate_passphrase: string;
@@ -2148,80 +2662,184 @@ declare enum WALLET_TYPES {
2148
2662
  GOOGLE_PAY = "google"
2149
2663
  }
2150
2664
 
2665
+ /**
2666
+ * The created One-Time Token (OTT) returned by the SDK after the user authorizes
2667
+ * a wallet payment. Use `temp_token` server-side to create the actual charge via
2668
+ * `POST /v1/charges` (or equivalent).
2669
+ */
2151
2670
  interface CreateOTTResponse {
2671
+ /** The temporary one-time token string. Single use, short TTL — exchange it server-side immediately. */
2152
2672
  temp_token: string;
2673
+ /** Token classification. `CARD` for FPAN (Google Pay only); `CARD_SCHEME_TOKEN` for DPAN (Apple Pay & Google Pay). */
2153
2674
  token_type: TOKEN_TYPE;
2154
2675
  }
2676
+ /**
2677
+ * Billing address captured from the wallet payment sheet, when requested via
2678
+ * `required_billing_contact_fields` (Apple Pay) or equivalent (Google Pay).
2679
+ */
2155
2680
  interface Billing {
2681
+ /** First street address line. */
2156
2682
  address_line1: string;
2683
+ /** Second street address line. Empty string when the wallet did not provide it. */
2157
2684
  address_line2: string;
2685
+ /** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). */
2158
2686
  address_country: string;
2687
+ /** City. */
2159
2688
  address_city: string;
2689
+ /** Postal/ZIP code. */
2160
2690
  address_postcode: string;
2691
+ /** State or administrative area (e.g. `'NSW'`, `'CA'`). */
2161
2692
  address_state: string;
2162
2693
  }
2694
+ /**
2695
+ * Card details captured when the wallet returns a card-scheme token (DPAN).
2696
+ * Only the non-sensitive metadata is exposed — full card numbers never reach the SDK.
2697
+ */
2163
2698
  interface CardInfo {
2699
+ /** Card network identifier from the wallet (e.g. `'visa'`, `'mastercard'`, `'amex'`). */
2164
2700
  card_scheme: string;
2701
+ /** Last 4 digits of the card, when the wallet provider exposes them. */
2165
2702
  card_number_last4?: string;
2166
2703
  }
2704
+ /**
2705
+ * Internal payload the SDK sends to Paydock when creating a One-Time Token.
2706
+ * Exposed publicly so integrators can construct fixtures for testing.
2707
+ */
2167
2708
  interface CreateOTTData {
2709
+ /** Charge amount as a number (e.g. `19.99`). */
2168
2710
  amount: number;
2711
+ /** Shipping address and contact info captured from the wallet. */
2169
2712
  shipping: Shipping;
2713
+ /** Billing address captured from the wallet. */
2170
2714
  billing: Billing;
2715
+ /** Card metadata captured from the wallet (network, last 4). */
2171
2716
  card_info: CardInfo;
2717
+ /** Wallet-provider reference token (DPAN/FPAN payload) used by Paydock to settle the charge. */
2172
2718
  ref_token: string;
2173
2719
  }
2720
+ /**
2721
+ * Request body used internally when calling Paydock's OTT-creation endpoint.
2722
+ * Exposed publicly so integrators can mirror the shape if they need to. */
2174
2723
  interface CreateOTTRequest {
2724
+ /** The Paydock service ID configured in the merchant dashboard for this wallet. */
2175
2725
  service_id: string;
2726
+ /** Wallet type identifier (Apple Pay, Google Pay, etc.). */
2176
2727
  service_type: SERVICE_TYPES;
2728
+ /** Service group classification (e.g. `'WALLET'`). */
2177
2729
  service_group: SERVICE_GROUP;
2730
+ /** Encrypted/encoded payload from the wallet (DPAN/FPAN data). */
2178
2731
  payload: string;
2732
+ /** Encoding format of `payload` — currently `'encrypted_string'`. */
2179
2733
  payload_format: PAYLOAD_FORMAT;
2180
2734
  }
2735
+ /**
2736
+ * Request body sent when initiating a wallet session against Paydock
2737
+ * (used by the Apple Pay merchant validation flow).
2738
+ */
2181
2739
  interface CreateSessionRequest {
2740
+ /** The Paydock service ID for the wallet. */
2182
2741
  service_id: string;
2742
+ /** Caller-controlled session identifier — Paydock binds the session to this id. */
2183
2743
  session_id: string;
2744
+ /** Whether the wallet sheet should ask the user for shipping. */
2184
2745
  request_shipping?: boolean;
2746
+ /** Merchant store name displayed in the wallet sheet. */
2185
2747
  store_name: string;
2186
2748
  }
2749
+ /**
2750
+ * Response returned by Paydock after creating a wallet session.
2751
+ * Used internally by the SDK to drive merchant validation; rarely consumed directly.
2752
+ */
2187
2753
  interface CreateSessionResponse {
2754
+ /** Paydock session identifier. */
2188
2755
  id: string;
2756
+ /** Session status (e.g. `'active'`). */
2189
2757
  status: string;
2758
+ /** HTTP method the SDK should use to invoke the callback URL. */
2190
2759
  callback_method: string;
2760
+ /** Relation/role of the callback (e.g. `'merchant_validation'`). */
2191
2761
  callback_rel: string;
2762
+ /** URL the SDK calls to complete the merchant validation step. */
2192
2763
  callback_url: string;
2193
2764
  }
2765
+ /**
2766
+ * Union of the native wallet authorization payloads the SDK may receive
2767
+ * from Apple Pay or Google Pay at the moment of payment authorization.
2768
+ * Used internally; rarely exposed to integrators directly.
2769
+ */
2194
2770
  type CheckoutResponse = ApplePayJS.ApplePayPaymentAuthorizedEvent | google.payments.api.PaymentAuthorizationResult | google.payments.api.PaymentData;
2771
+ /**
2772
+ * Action codes returned by the SDK during the wallet checkout lifecycle.
2773
+ * Mirrors the ApplePay payment authorization completion codes used internally
2774
+ * to decide what UI/state transition to perform next.
2775
+ */
2195
2776
  declare enum CheckoutActionCode {
2777
+ /** Payment completed successfully. */
2196
2778
  COMPLETE = "COMPLETE",
2779
+ /** User cancelled the wallet sheet. */
2197
2780
  CANCEL = "CANCEL",
2781
+ /** An error occurred during payment authorization. */
2198
2782
  ERROR = "ERROR",
2783
+ /** User opted to switch to a different card in the wallet. */
2199
2784
  CHANGE_CARD = "CHANGE_CARD",
2785
+ /** User opted to add a new card to the wallet. */
2200
2786
  ADD_CARD = "ADD_CARD",
2787
+ /** User switched to a different consumer (Click to Pay flow). */
2201
2788
  SWITCH_CONSUMER = "SWITCH_CONSUMER"
2202
2789
  }
2790
+ /**
2791
+ * Token response shape returned by Paydock after creating an OTT.
2792
+ * Used by the SDK to decide whether a follow-up 3DS step is required.
2793
+ */
2203
2794
  interface OTTResponse {
2795
+ /** The OTT string. */
2204
2796
  token: string;
2797
+ /** Token type identifier (string form of {@link TOKEN_TYPE}). */
2205
2798
  token_type: string;
2799
+ /** When `true`, the integrator must invoke a Canvas3DS step before settling the charge. */
2206
2800
  three_ds_required?: boolean;
2801
+ /** Which wallet produced the token (Apple Pay or Google Pay). */
2207
2802
  wallet_type: WalletType;
2208
2803
  }
2804
+ /**
2805
+ * Shipping address and contact information captured from the wallet payment sheet,
2806
+ * when requested via `request_shipping` (and friends) on the wallet meta.
2807
+ *
2808
+ * All fields are optional because each wallet provider returns a different subset.
2809
+ * Address line fields are typically Apple Pay-only (Google Pay returns a coarser shape).
2810
+ */
2209
2811
  interface Shipping {
2812
+ /** Selected shipping method identifier (e.g. `'standard'`, `'express'`). */
2210
2813
  method?: string;
2814
+ /** Updated shipping options that were available when the user made their selection. */
2211
2815
  options?: IShippingOption[];
2816
+ /** First street address line (Apple Pay only). */
2212
2817
  address_line1?: string;
2818
+ /** Second street address line (Apple Pay only). */
2213
2819
  address_line2?: string;
2820
+ /** City. */
2214
2821
  address_city?: string;
2822
+ /** Postal/ZIP code. */
2215
2823
  address_postcode?: string;
2824
+ /** State or administrative area. */
2216
2825
  address_state?: string;
2826
+ /** ISO 3166-1 alpha-2 country code. */
2217
2827
  address_country?: string;
2828
+ /** Company name on the address (when the wallet captured it). */
2218
2829
  address_company?: string;
2830
+ /** Origin postal code — used for shipping calculations when the merchant ships from a fixed location. */
2219
2831
  address_origin_postcode?: string;
2832
+ /** Shipping contact information (Apple Pay only). */
2220
2833
  contact?: {
2834
+ /** Contact first name. */
2221
2835
  first_name?: string;
2836
+ /** Contact last name. */
2222
2837
  last_name?: string;
2838
+ /** Contact email address. */
2223
2839
  email?: string;
2840
+ /** Contact phone number. */
2224
2841
  phone?: string;
2842
+ /** Contact secondary phone number. */
2225
2843
  phone2?: string;
2226
2844
  };
2227
2845
  }
@@ -2241,13 +2859,52 @@ declare class ApiInternal extends ApiBase {
2241
2859
  paymentSource(): ApiPaymentSourceInternal;
2242
2860
  }
2243
2861
 
2244
- declare class ApiCheckoutInternal {
2245
- protected api: ApiInternal;
2246
- constructor(api: ApiInternal);
2247
- instructions(): Observable<object>;
2248
- private getInstructionLink;
2249
- callback(payload: Object): Promise<Object>;
2250
- status(id: string): Promise<Object>;
2862
+ /**
2863
+ * Public alias for GPAYMENTS_EVENT. Same object reference — no behavioral change.
2864
+ * Prefer `CANVAS_3DS_EVENT` in public-facing code; `GPAYMENTS_EVENT` remains for
2865
+ * backwards-compatible internal usage.
2866
+ */
2867
+ declare const CANVAS_3DS_EVENT: {
2868
+ /** Authentication succeeded. Payload: `Canvas3dsAuthPayload`. */
2869
+ readonly AUTH_SUCCESS: "chargeAuthSuccess";
2870
+ /** Authentication failed — covers issuer rejection, iframe timeout (`AuthTimedOut`), and invalid-event outcomes. Payload: `Canvas3dsAuthPayload`. */
2871
+ readonly AUTH_ERROR: "chargeAuthReject";
2872
+ /** Decoupled authentication — issuer will authenticate out-of-band. Payload: `Canvas3dsAuthPayload`. */
2873
+ readonly DECOUPLED: "chargeAuthDecoupled";
2874
+ /** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
2875
+ readonly CHALLENGE: "chargeAuthChallenge";
2876
+ /** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
2877
+ readonly INFO: "chargeAuthInfo";
2878
+ /** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
2879
+ readonly ERROR: "error";
2880
+ };
2881
+
2882
+ /**
2883
+ * Payload emitted by `Checkout.onPaymentSuccessful`.
2884
+ *
2885
+ * Permissively extends `IEventData` because the Checkout emission contract
2886
+ * is not yet fully documented (see D8). This gives a named surface that
2887
+ * integrators can import while keeping the type backwards-compatible with
2888
+ * the raw `IEventData` shape the runtime currently emits.
2889
+ */
2890
+ interface CheckoutPaymentSuccessPayload extends IEventData$1 {
2891
+ }
2892
+ /**
2893
+ * Payload emitted by `Checkout.onPaymentFailure`.
2894
+ *
2895
+ * Permissively extends `IEventData` — same reasoning as
2896
+ * `CheckoutPaymentSuccessPayload`. Tighten in a follow-up once the emission
2897
+ * contract is confirmed.
2898
+ */
2899
+ interface CheckoutPaymentFailurePayload extends IEventData$1 {
2900
+ }
2901
+ /**
2902
+ * Payload emitted by `Checkout.onPaymentExpired`.
2903
+ *
2904
+ * Permissively extends `IEventData` — same reasoning as
2905
+ * `CheckoutPaymentSuccessPayload`.
2906
+ */
2907
+ interface CheckoutPaymentExpiredPayload extends IEventData$1 {
2251
2908
  }
2252
2909
 
2253
2910
  type Instruction = new (selector: string, api: ApiInternal, checkoutWidget: Checkout, formSelector?: string) => InstructionHandler & InstructionDestroyable & InstructionDecorated;
@@ -2277,11 +2934,32 @@ declare class InstructionModule {
2277
2934
  getInstruction(id: string): Instruction | null;
2278
2935
  }
2279
2936
 
2280
- interface IntentTokenPayload {
2937
+ /** Event name emitted when a checkout payment completes successfully. */
2938
+ declare const PAYMENT_SUCCESSFUL = "paymentSuccessful";
2939
+ /** Event name emitted when a checkout payment fails. */
2940
+ declare const PAYMENT_FAILURE = "paymentFailure";
2941
+ /** Event name emitted when a checkout session expires. */
2942
+ declare const PAYMENT_EXPIRED = "paymentExpired";
2943
+ declare const EVENT$2: {
2944
+ PAYMENT_SUCCESSFUL: string;
2945
+ PAYMENT_FAILURE: string;
2946
+ PAYMENT_EXPIRED: string;
2947
+ };
2948
+ /**
2949
+ * Decoded payload of the intent JWT the `Checkout` widget receives in its constructor.
2950
+ * Issued by the Paydock backend when a checkout intent is created. Integrators who
2951
+ * decode the token themselves (e.g. for diagnostics) can use this type to inspect it.
2952
+ */
2953
+ interface CheckoutIntentTokenPayload {
2954
+ /** Backend environment that minted this token (e.g. `'sandbox'`, `'production'`). */
2281
2955
  env: string;
2956
+ /** The Paydock checkout intent identifier this token authorizes. */
2282
2957
  intent_id: string;
2958
+ /** Token schema version. Used by the SDK for forward/backward compatibility. */
2283
2959
  version: number;
2960
+ /** Human-readable alias for the environment (e.g. `'staging-3'`, `'multitenant-preprod'`). */
2284
2961
  env_alias: string;
2962
+ /** Hostnames the token may be used from. When present, the SDK rejects the token if the current origin is not listed; an absent or empty array allows all origins. */
2285
2963
  whitelist_domains: string[];
2286
2964
  }
2287
2965
  /**
@@ -2301,7 +2979,7 @@ declare class Checkout {
2301
2979
  protected window: Window;
2302
2980
  protected eventEmitter: EventEmitter;
2303
2981
  protected container: Container;
2304
- protected intentTokenPayload: IntentTokenPayload;
2982
+ protected intentTokenPayload: CheckoutIntentTokenPayload;
2305
2983
  protected api: ApiInternal;
2306
2984
  protected checkoutApi: ApiCheckoutInternal;
2307
2985
  protected instructions: InstructionModule;
@@ -2315,7 +2993,7 @@ declare class Checkout {
2315
2993
  fetchInstruction(): void;
2316
2994
  finaliseCheckout(): void;
2317
2995
  private setupTimeoutTimer;
2318
- private extractIntentTokenPayload;
2996
+ private extractCheckoutIntentTokenPayload;
2319
2997
  validateJWTWhitelistedDomains(whitelist_domains: string[]): boolean;
2320
2998
  private ready;
2321
2999
  private initContractVersion;
@@ -2334,7 +3012,7 @@ declare class Checkout {
2334
3012
  * console.log('Payment successful!');
2335
3013
  * });
2336
3014
  */
2337
- onPaymentSuccessful(handler: (data: IEventData$1) => void): () => void;
3015
+ onPaymentSuccessful<T extends IEventData$1 = CheckoutPaymentSuccessPayload>(handler: (data: T) => void): () => void;
2338
3016
  /**
2339
3017
  * If the payment was not successful, the function passed as parameter will be called.
2340
3018
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
@@ -2344,17 +3022,17 @@ declare class Checkout {
2344
3022
  * console.log('Payment not successful');
2345
3023
  * });
2346
3024
  */
2347
- onPaymentFailure(handler: (data: IEventData$1) => void): () => void;
3025
+ onPaymentFailure<T extends IEventData$1 = CheckoutPaymentFailurePayload>(handler: (data: T) => void): () => void;
2348
3026
  /**
2349
3027
  * If the payment was expired, the function passed as parameter will be called.
2350
3028
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2351
3029
  *
2352
3030
  * @example
2353
- * widget.onPaymentInReview((data) => {
2354
- * console.log('Payment in fraud review');
3031
+ * widget.onPaymentExpired((data) => {
3032
+ * console.log('Payment session expired');
2355
3033
  * });
2356
3034
  */
2357
- onPaymentExpired(handler: (data: IEventData$1) => void): () => void;
3035
+ onPaymentExpired<T extends IEventData$1 = CheckoutPaymentExpiredPayload>(handler: (data: T) => void): () => void;
2358
3036
  createWidgetStructure(): void;
2359
3037
  private changeLoadingSpinnerVisibility;
2360
3038
  }
@@ -3434,6 +4112,18 @@ declare abstract class OpenWalletService implements IOpenWalletProvider {
3434
4112
  * @param meta - The updated metadata.
3435
4113
  */
3436
4114
  abstract setMeta(meta: OpenWalletMeta): void;
4115
+ /**
4116
+ * Returns whether the wallet button is currently disabled.
4117
+ * Reads the `aria-disabled` attribute from the container element — set by the
4118
+ * button class via {@link OpenWalletButtons.disable} / {@link OpenWalletButtons.enable}.
4119
+ *
4120
+ * Used to short-circuit click handlers in concrete wallet services for clicks
4121
+ * that bypass the DOM `pointer-events: none` guard (e.g. invoked by the wallet
4122
+ * provider's SDK callback).
4123
+ *
4124
+ * @returns `true` if the container is marked as disabled, `false` otherwise.
4125
+ */
4126
+ protected isButtonDisabled(): boolean;
3437
4127
  /**
3438
4128
  * Creates a One-Time Token (OTT) by sending the payment data to the API.
3439
4129
  * Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
@@ -3493,6 +4183,7 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
3493
4183
  protected meta: TMeta;
3494
4184
  protected eventEmitter: EventEmitter;
3495
4185
  protected walletService: OpenWalletService | undefined;
4186
+ protected isDisabled: boolean;
3496
4187
  private onShippingOptionsChangeHandlerRegistered;
3497
4188
  /** @private */
3498
4189
  abstract readonly walletType: WalletType;
@@ -3549,6 +4240,42 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
3549
4240
  * button.load();
3550
4241
  */
3551
4242
  load(): void;
4243
+ /**
4244
+ * Enables the wallet button, restoring interactivity and visual appearance.
4245
+ * If the button was previously disabled via `disable()`, calling this method
4246
+ * re-enables clicks and removes the disabled visual state.
4247
+ *
4248
+ * Idempotent — calling on an already-enabled button has no effect.
4249
+ *
4250
+ * @example
4251
+ * button.enable();
4252
+ */
4253
+ enable(): void;
4254
+ /**
4255
+ * Disables the wallet button, preventing clicks and applying a visual disabled state.
4256
+ * When disabled, the button appears grayed out (`opacity: 0.5`) and does not
4257
+ * respond to user interaction (`pointer-events: none`). For accessibility, the
4258
+ * `aria-disabled="true"` attribute is also set on the container.
4259
+ *
4260
+ * Programmatic clicks (e.g. invoked by the wallet provider's SDK) are blocked
4261
+ * by an explicit guard inside the click handler — the button's wallet service
4262
+ * checks the disabled state before processing.
4263
+ *
4264
+ * Idempotent — calling on an already-disabled button has no effect.
4265
+ * Safe to call before `load()` (no-throw); the styles are applied once the
4266
+ * container element exists.
4267
+ *
4268
+ * @example
4269
+ * button.disable();
4270
+ */
4271
+ disable(): void;
4272
+ /**
4273
+ * Applies the disabled / enabled visual state to the container element.
4274
+ * Reads `this.isDisabled` and toggles the corresponding CSS + ARIA attributes.
4275
+ *
4276
+ * @private
4277
+ */
4278
+ protected applyDisabledStyles(): void;
3552
4279
  /**
3553
4280
  * Current method can change environment. By default environment = sandbox.
3554
4281
  * Also we can change domain alias for this environment. By default domain_alias = paydock.com
@@ -4328,13 +5055,53 @@ declare global {
4328
5055
  ApplePaySession: ApplePaySession;
4329
5056
  }
4330
5057
  }
5058
+ /** Styling configuration for the Apple Pay button. */
4331
5059
  interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
5060
+ /** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`, `'check-out'`). */
4332
5061
  button_type?: ApplePayButtonType$1;
5062
+ /** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
4333
5063
  button_style?: ApplePayButtonStyle$1;
4334
5064
  }
4335
- interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest {
5065
+ /**
5066
+ * Fields that the SDK auto-populates in `adaptMeta()` if not provided by the merchant.
5067
+ * Declared here so we can override them as optional in `ApplePayOpenWalletMeta` while
5068
+ * keeping the strict `ApplePayPaymentRequest` intact for internal consumers.
5069
+ */
5070
+ type ApplePayAutoFilledFields = 'merchant_capabilities' | 'supported_networks' | 'country_code' | 'currency_code' | 'total';
5071
+ /**
5072
+ * Metadata required to configure an Apple Pay Open Wallet button.
5073
+ * Extends {@link OpenWalletMeta} (amount, currency, country) plus most of the
5074
+ * fields from Apple's `ApplePayPaymentRequest`. Fields that the SDK auto-populates
5075
+ * in `adaptMeta()` are redeclared as optional below.
5076
+ */
5077
+ interface ApplePayOpenWalletMeta extends OpenWalletMeta, Omit<ApplePayPaymentRequest, ApplePayAutoFilledFields> {
5078
+ /** Label shown next to the total in the Apple Pay sheet (e.g. `'TOTAL'`, `'Order total'`). */
4336
5079
  amount_label: string;
5080
+ /** Merchant's store name displayed during payment authorization. */
4337
5081
  store_name: string;
5082
+ /**
5083
+ * Auto-populated from `country.toUpperCase()` if not provided.
5084
+ * Only set explicitly when you need a different country code than `country`.
5085
+ */
5086
+ country_code?: string;
5087
+ /**
5088
+ * Auto-populated from `currency.toUpperCase()` if not provided.
5089
+ * Only set explicitly when you need a different currency code than `currency`.
5090
+ */
5091
+ currency_code?: string;
5092
+ /**
5093
+ * Auto-populated from `amount` and `amount_label` if not provided.
5094
+ * Set explicitly to customize the total line item (e.g. with a specific `type`).
5095
+ */
5096
+ total?: ApplePayLineItem;
5097
+ /**
5098
+ * Defaults to `['supports3DS', 'supportsCredit', 'supportsDebit']` if not provided.
5099
+ */
5100
+ merchant_capabilities?: ApplePayMerchantCapability[];
5101
+ /**
5102
+ * Defaults to `['visa', 'masterCard', 'amex', 'discover']` if not provided.
5103
+ */
5104
+ supported_networks?: string[];
4338
5105
  /** Whether shipping address collection is required. */
4339
5106
  request_shipping?: boolean;
4340
5107
  /**
@@ -4343,8 +5110,14 @@ interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest
4343
5110
  * Requires `request_shipping` to be `true`.
4344
5111
  */
4345
5112
  shipping_options?: IApplePayShippingOption$1[];
5113
+ /** Whether to surface billing address fields in the sheet. When `true` and `required_billing_contact_fields` is unset, the SDK defaults the latter to `['name', 'postalAddress']`. */
4346
5114
  show_billing_address?: boolean;
5115
+ /** Visual styling for the Apple Pay button. */
4347
5116
  style?: ApplePayOpenWalletMetaStyles;
5117
+ /**
5118
+ * Device capabilities allowed for the wallet button to be considered available.
5119
+ * Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
5120
+ */
4348
5121
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
4349
5122
  }
4350
5123
 
@@ -4422,15 +5195,27 @@ type GooglePayButtonType = 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'p
4422
5195
  type GooglePayAuthMethod = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';
4423
5196
  type GooglePayCardNetwork = 'AMEX' | 'DISCOVER' | 'ELECTRON' | 'ELO' | 'ELO_DEBIT' | 'INTERAC' | 'JCB' | 'MAESTRO' | 'MASTERCARD' | 'VISA';
4424
5197
  type BillingAddressFormat = 'MIN' | 'FULL';
5198
+ /**
5199
+ * Styling configuration for the Google Pay button.
5200
+ */
4425
5201
  interface GooglePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
5202
+ /** Variant displayed on the button (e.g. `'pay'`, `'buy'`, `'checkout'`). */
4426
5203
  button_type?: GooglePayButtonType;
5204
+ /** Sizing strategy: `'static'` keeps the intrinsic size; `'fill'` stretches to the container. */
4427
5205
  button_size_mode?: GooglePayButtonSizeMode;
5206
+ /** Color scheme: `'default'`, `'black'`, or `'white'`. */
4428
5207
  button_color?: GooglePayButtonColor;
4429
5208
  }
5209
+ /**
5210
+ * Metadata required to configure a Google Pay Open Wallet button.
5211
+ * Extends {@link OpenWalletMeta} (amount, currency, country) with Google Pay specifics.
5212
+ */
4430
5213
  interface GooglePayOpenWalletMeta extends OpenWalletMeta {
5214
+ /** Display name shown in the Google Pay sheet (e.g. `'Demo Store'`). */
4431
5215
  merchant_name?: string;
4432
5216
  /** Whether shipping address collection is required. */
4433
5217
  request_shipping?: boolean;
5218
+ /** Whether to surface billing address fields in the sheet. */
4434
5219
  show_billing_address?: boolean;
4435
5220
  /**
4436
5221
  * Available shipping options to display in the payment sheet.
@@ -4438,38 +5223,72 @@ interface GooglePayOpenWalletMeta extends OpenWalletMeta {
4438
5223
  * Requires `request_shipping` to be `true`.
4439
5224
  */
4440
5225
  shipping_options?: IGooglePayShippingOption[];
5226
+ /** Label shown next to the total amount in the sheet (e.g. `'TOTAL'`). */
4441
5227
  amount_label?: string;
5228
+ /** Visual styling for the button. */
4442
5229
  style?: GooglePayOpenWalletMetaStyles;
5230
+ /** Override the default card configuration (auth methods, allowed networks, tokenization). */
4443
5231
  card_config?: GooglePayCardConfig;
4444
5232
  }
5233
+ /**
5234
+ * Card configuration passed to Google Pay's `PaymentDataRequest`.
5235
+ * Mirrors Google Pay's
5236
+ * [PaymentMethodSpecification](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethod)
5237
+ * with snake_case keys.
5238
+ */
4445
5239
  interface GooglePayCardConfig {
5240
+ /** Payment method type Google Pay should display. `'CARD'` for card payments, `'PAYPAL'` for PayPal-via-Google Pay. */
4446
5241
  type: 'CARD' | 'PAYPAL';
5242
+ /** Method-specific parameters that filter the cards Google Pay will offer. */
4447
5243
  parameters: {
5244
+ /** Allowed authentication methods. `'PAN_ONLY'` for FPAN (server-side decryption); `'CRYPTOGRAM_3DS'` for DPAN (device tokens). */
4448
5245
  allowed_auth_methods: GooglePayAuthMethod[];
5246
+ /** Card networks the merchant accepts. */
4449
5247
  allowed_card_networks: GooglePayCardNetwork[];
5248
+ /** Whether prepaid cards are allowed. Defaults to Google Pay's default. */
4450
5249
  allow_prepaid_cards?: boolean;
5250
+ /** Whether credit cards are allowed. Defaults to Google Pay's default. */
4451
5251
  allow_credit_cards?: boolean;
5252
+ /** Request `assuranceDetails` in the payment response (gives risk-signal hints from Google). */
4452
5253
  assurance_details_required?: boolean;
5254
+ /** Whether the billing address must be collected. */
4453
5255
  billing_address_required?: boolean;
5256
+ /** Billing address collection options. Only honored when `billing_address_required` is `true`. */
4454
5257
  billing_address_parameters?: {
5258
+ /** Format of the collected billing address: `'MIN'` (minimal) or `'FULL'`. */
4455
5259
  format: BillingAddressFormat;
5260
+ /** Whether to also collect the phone number. */
4456
5261
  phone_number_required?: boolean;
4457
5262
  };
5263
+ /** Per-network parameters such as acquirer routing hints. */
4458
5264
  card_network_parameters?: {
5265
+ /** The card network this entry applies to. */
4459
5266
  card_network: GooglePayCardNetwork;
5267
+ /** Acquirer BIN — used by the gateway to route the transaction. */
4460
5268
  acquirer_bin?: string;
5269
+ /** Acquirer-assigned merchant identifier. */
4461
5270
  acquirer_merchant_id?: string;
4462
5271
  }[];
4463
5272
  };
5273
+ /**
5274
+ * How Google Pay should tokenize the payment method. Paydock typically configures this server-side
5275
+ * and you should NOT pass it unless you fully understand the implications of overriding the default.
5276
+ */
4464
5277
  tokenization_specification?: {
5278
+ /** Standard payment-gateway tokenization. */
4465
5279
  type: 'PAYMENT_GATEWAY';
5280
+ /** Gateway-specific tokenization parameters (e.g. `gateway`, `gatewayMerchantId`). */
4466
5281
  parameters: {
4467
5282
  [key: string]: string;
4468
5283
  };
4469
5284
  } | {
5285
+ /** Direct integration where Google encrypts the payload with the merchant's public key. */
4470
5286
  type: 'DIRECT';
5287
+ /** Direct-tokenization parameters required by Google's payload encryption. */
4471
5288
  parameters: {
5289
+ /** Protocol version expected by the merchant (currently `'ECv2'`). */
4472
5290
  protocol_version: string;
5291
+ /** Merchant's public key used to encrypt the payload. */
4473
5292
  public_key: string;
4474
5293
  };
4475
5294
  };
@@ -4478,346 +5297,83 @@ interface GooglePayCardConfig {
4478
5297
  /**
4479
5298
  * @classdesc Google Pay wallet button that creates One-Time Tokens (OTT) via Google Pay.
4480
5299
  *
4481
- * Provides a fully typed Google Pay integration with Google Pay-specific metadata
4482
- * and validates that the service configuration corresponds to a Google Pay service.
4483
- * On `load()`, the button fetches the service configuration and raises an error via `onError`
4484
- * if the service type does not match Google Pay.
4485
- *
4486
- * @class GooglePayOpenWalletButton
4487
- * @extends OpenWalletButtons
4488
- *
4489
- * @param {string} selector - CSS selector of the HTML element that will contain the Google Pay button.
4490
- * @param {string} publicKeyOrAccessToken - Public key or access token for API authentication.
4491
- * @param {string} serviceId - The Google Pay service ID configured in PayDock dashboard.
4492
- * @param {GooglePayOpenWalletMeta} meta - Google Pay-specific metadata (amount, currency, country, card_config, merchant_name, style, etc.).
4493
- *
4494
- * @example
4495
- * const button = new GooglePayOpenWalletButton(
4496
- * '#wallet-container',
4497
- * publicKeyOrAccessToken,
4498
- * serviceId,
4499
- * {
4500
- * amount: 100,
4501
- * currency: 'AUD',
4502
- * country: 'AU',
4503
- * merchant_name: 'Your Store',
4504
- * },
4505
- * );
4506
- * button.setEnv('sandbox');
4507
- * button.onSuccess((data) => console.log('OTT:', data.token));
4508
- * button.onError((error) => console.error('Error:', error));
4509
- * button.load();
4510
- */
4511
- declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
4512
- /** @private */
4513
- readonly walletType: WalletType;
4514
- /**
4515
- * Validates Google Pay-specific required metadata fields.
4516
- * Google Pay has no additional required fields beyond the base (amount, currency, country).
4517
- * @private
4518
- */
4519
- protected validateWalletMeta(): void;
4520
- /**
4521
- * Validates that the service configuration type is Google Pay.
4522
- *
4523
- * @private
4524
- * @param serviceConfig - The service configuration response from the API.
4525
- * @throws {Error} If the service type is not Google Pay.
4526
- */
4527
- protected validateServiceType(serviceConfig: GetConfigResponse): void;
4528
- /**
4529
- * Creates a Google Pay wallet service instance.
4530
- *
4531
- * @private
4532
- * @param serviceConfig - The service configuration response from the API.
4533
- * @returns The Google Pay wallet service instance.
4534
- */
4535
- protected createWalletService(serviceConfig: GetConfigResponse): OpenWalletService;
4536
- }
4537
-
4538
- declare const TYPE: {
4539
- EXTERNAL_CHECKOUT_TOKEN: string;
4540
- CHECKOUT_TOKEN: string;
4541
- BANK_ACCOUNT: string;
4542
- CARD: string;
4543
- };
4544
- interface IBody {
4545
- gateway_id: string;
4546
- type: string;
4547
- checkout_token?: string;
4548
- }
4549
- declare class Builder extends HttpCore {
4550
- private body;
4551
- constructor(gatewayID: string, checkoutToken: string, type: string);
4552
- constructor(gatewayID: string, externalCheckoutToken: string, type: string);
4553
- constructor(gatewayID: string, card: any, type: string);
4554
- constructor(gatewayID: string, bankAccount: any, type: string);
4555
- protected getLink(): string;
4556
- send(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
4557
- getConfigs(): IBody;
4558
- }
4559
-
4560
- /**
4561
- *
4562
- * Class PaymentSourceWidget include method for for creating iframe url
4563
- * @constructor
4564
- *
4565
- * @param {string} publicKey - PayDock users public key
4566
- * @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true)
4567
- * @param {boolean} [useReference=false]
4568
- *
4569
- * @example
4570
- * var widget = new PaymentSourceWidget('publicKey','customerId');
4571
- * // or
4572
- * var widget = new PaymentSourceWidget('publicKey', customerReference, true);
4573
- */
4574
- declare class PaymentSourceWidget {
4575
- protected link: Link;
4576
- protected configs: Configuration[];
4577
- protected configTokens: string[];
4578
- protected publicKey: string;
4579
- /** @constructs */ constructor(accessToken: string, queryToken: string);
4580
- /**
4581
- * Object contain styles for widget
4582
- *
4583
- * @example
4584
- * widget.setStyles({
4585
- * background_color: 'rgb(0, 0, 0)',
4586
- * border_color: 'yellow',
4587
- * text_color: '#FFFFAA',
4588
- * icon_size: 'small',
4589
- * font_size: '20px'
4590
- * });
4591
- * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
4592
- */
4593
- setStyles(styles: IStyles$1): void;
4594
- setStyle(param: string, value: string): void;
4595
- /**
4596
- * Current method can set custom ID to identify the data in the future
4597
- *
4598
- * @example
4599
- * widget.setRefId('id');
4600
- *
4601
- * @param {string} refId - custom id
4602
- */
4603
- setRefId(refId: string): void;
4604
- /**
4605
- * Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next.
4606
- *
4607
- * @param {string} count - payment source count
4608
- */
4609
- setLimit(count: number): void;
4610
- /**
4611
- * Current method can change environment. By default environment = sandbox
4612
- * Also we can change domain alias for this environment. By default domain_alias = paydock.com
4613
- *
4614
- * @example
4615
- * widget.setEnv('production');
4616
- * @param {string} env - sandbox, production
4617
- * @param {string} [alias] - Own domain alias
4618
- */
4619
- setEnv(env: string, alias?: string): void;
4620
- getEnv(): void;
4621
- /**
4622
- * Method for getting iframe's url
4623
- */
4624
- getIFrameUrl(): string;
4625
- /**
4626
- * Show payment source inside widget only with requested gateway ids
4627
- *
4628
- *
4629
- * @param {string[]} ids - List of gateway_id
4630
- */
4631
- filterByGatewayIds(ids: string[]): void;
4632
- /**
4633
- *
4634
- * Show payment source inside widget only with requested payment source types
4635
- *
4636
- * @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
4637
- */
4638
- filterByTypes(types: string[]): void;
4639
- /**
4640
- * Method for setting a custom language code
4641
- *
4642
- * @example
4643
- * config.setLanguage('en');
4644
- * @param {string} code - ISO 639-1
4645
- */
4646
- setLanguage(code: any): void;
4647
- }
4648
-
4649
- interface IEventSelectData extends IEventData$1 {
4650
- customer_id: string;
4651
- payment_source_id: string;
4652
- gateway_id: string;
4653
- primary: boolean;
4654
- card_number_last4?: string;
4655
- card_scheme?: string;
4656
- checkout_email?: string;
4657
- gateway_type?: string;
4658
- payment_source_type: string;
4659
- account_name?: string;
4660
- account_number?: string;
4661
- }
4662
- interface IEventPaginationData extends IEventData$1 {
4663
- total_item: number;
4664
- skip: number;
4665
- limit: number;
4666
- }
4667
- interface IEventAfterLoadData extends IEventData$1 {
4668
- total_item: number;
4669
- skip: number;
4670
- limit: number;
4671
- }
4672
- interface IEventSizeData extends IEventData$1 {
4673
- height: number;
4674
- width: number;
4675
- }
4676
- /**
4677
- * Interface of data from event.
4678
- *
4679
- * @interface IEventSelectData
4680
- *
4681
- * @param {string} event
4682
- * @param {string} purpose
4683
- * @param {string} message_source
4684
- * @param {string} [ref_id]
4685
- * @param {string} customer_id
4686
- * @param {string} payment_source_id
4687
- * @param {string} gateway_id
4688
- * @param {boolean} primary
4689
- * @param {string} [widget_id]
4690
- * @param {string} [card_number_last4]
4691
- * @param {string} [card_scheme]
4692
- * @param {string} gateway_type
4693
- * @param {string} [checkout_email]
4694
- * @param {string} payment_source_type
4695
- * @param {string} [account_name]
4696
- * @param {string} [account_number]
4697
- * */
4698
- /**
4699
- * Interface of data from event.
4700
- *
4701
- * @interface IEventPaginationData
4702
- *
4703
- * @param {string} event
4704
- * @param {string} purpose
4705
- * @param {string} message_source
4706
- * @param {string} [ref_id]
4707
- * @param {number} total_item
4708
- * @param {number} skip
4709
- * @param {number} limit
4710
- * */
4711
- /**
4712
- * Interface of data from event.
4713
- *
4714
- * @interface IEventAfterLoadData
4715
- *
4716
- * @param {string} event The name of the event.
4717
- * @param {string} purpose A system variable that states the purpose of the event.
4718
- * @param {string} message_source A system variable that identifies the event source.
4719
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
4720
- * @param {number} total_item Pagination param. Total item count
4721
- * @param {number} skip Pagination param. Skip items from first item
4722
- * @param {number} limit Pagination param. Query limit
4723
- * */
4724
- /**
4725
- * Interface of data from event.
4726
- * @interface IEventFinishData
4727
- *
4728
- * @param {string} event The name of the event.
4729
- * @param {string} purpose A system variable that states the purpose of the event.
4730
- * @param {string} message_source A system variable that identifies the event source.
4731
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
4732
- * */
4733
- /**
4734
- * Interface of data from event.
4735
- * @interface IEventSizeData
4736
- *
4737
- * @param {number} event The name of the event.
4738
- * @param {number} purpose A system variable that states the purpose of the event.
4739
- * @param {string} message_source A system variable that identifies the event source.
4740
- * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
4741
- * @param {number} height Height of iFrame
4742
- * @param {number} width Width of iFrame
4743
- * */
4744
- /**
4745
- * List of available event's name
4746
- *
4747
- * @const EVENT
4748
- *
4749
- * @type {object}
4750
- * @param {string} AFTER_LOAD=afterLoad
4751
- * @param {string} SYSTEM_ERROR=systemError
4752
- * @param {string} SELECT=select
4753
- * @param {string} UNSELECT=unselect
4754
- * @param {string} NEXT=next
4755
- * @param {string} PREV=prev
4756
- * @param {string} META_CHANGE=metaChange
4757
- * @param {string} RESIZE=resize
4758
- */
4759
- /**
4760
- * Class HtmlPaymentSourceWidget include method for working on html
4761
- * @constructor
4762
- * @extends PaymentSourceWidget
5300
+ * Provides a fully typed Google Pay integration with Google Pay-specific metadata
5301
+ * and validates that the service configuration corresponds to a Google Pay service.
5302
+ * On `load()`, the button fetches the service configuration and raises an error via `onError`
5303
+ * if the service type does not match Google Pay.
5304
+ *
5305
+ * @class GooglePayOpenWalletButton
5306
+ * @extends OpenWalletButtons
5307
+ *
5308
+ * @param {string} selector - CSS selector of the HTML element that will contain the Google Pay button.
5309
+ * @param {string} publicKeyOrAccessToken - Public key or access token for API authentication.
5310
+ * @param {string} serviceId - The Google Pay service ID configured in PayDock dashboard.
5311
+ * @param {GooglePayOpenWalletMeta} meta - Google Pay-specific metadata (amount, currency, country, card_config, merchant_name, style, etc.).
4763
5312
  *
4764
- * @param {string} selector - Selector of html element. Container for widget
4765
- * @param {string} publicKey - PayDock users public key
4766
- * @param {string} queryToken - PayDock's query token that represents params to search customer by id or reference
4767
5313
  * @example
4768
- * * var widget = new HtmlPaymentSourceWidget('#widget', 'publicKey','queryToken');
4769
-
5314
+ * const button = new GooglePayOpenWalletButton(
5315
+ * '#wallet-container',
5316
+ * publicKeyOrAccessToken,
5317
+ * serviceId,
5318
+ * {
5319
+ * amount: 100,
5320
+ * currency: 'AUD',
5321
+ * country: 'AU',
5322
+ * merchant_name: 'Your Store',
5323
+ * },
5324
+ * );
5325
+ * button.setEnv('sandbox');
5326
+ * button.onSuccess((data) => console.log('OTT:', data.token));
5327
+ * button.onError((error) => console.error('Error:', error));
5328
+ * button.load();
4770
5329
  */
4771
- declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
4772
- protected container: Container;
4773
- protected iFrame: IFrame;
4774
- protected event: IFrameEvent;
4775
- /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
4776
- /**
4777
- * The final method to beginning, the load process of widget to html
4778
- *
4779
- */
4780
- load(): void;
4781
- /**
4782
- * This callback will be called for each event in payment source widget
4783
- *
4784
- * @callback listener--PaymentSourceWidget
4785
- * @param {IEventData | IEventSelectData | IEventPaginationData | IEventAfterLoadData} response
4786
- */
4787
- /**
4788
- * Listen to events of widget
4789
- *
4790
- * @example
4791
- *
4792
- * widget.on('select', function (data) {
4793
- * console.log(data);
4794
- * });
4795
- * @param {string} eventName - Available event names [EVENT]{@link EVENT}
4796
- * @param {listener--PaymentSourceWidget} cb
4797
- */
4798
- on(eventName: string, cb: (data: IEventData$1 | IEventSelectData | IEventPaginationData | IEventAfterLoadData | IEventSizeData) => void): void;
4799
- /**
4800
- * Using this method you can hide widget after load
4801
- * @param {boolean} [saveSize=false] - using this param you can save iframe's size
4802
- */
4803
- hide(saveSize: boolean): void;
5330
+ declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
5331
+ /** @private */
5332
+ readonly walletType: WalletType;
4804
5333
  /**
4805
- * Using this method you can show widget after using hide method
4806
- *
5334
+ * Validates Google Pay-specific required metadata fields.
5335
+ * Google Pay has no additional required fields beyond the base (amount, currency, country).
5336
+ * @private
4807
5337
  */
4808
- show(): void;
5338
+ protected validateWalletMeta(): void;
4809
5339
  /**
4810
- * Using this method you can reload widget
5340
+ * Validates that the service configuration type is Google Pay.
4811
5341
  *
5342
+ * @private
5343
+ * @param serviceConfig - The service configuration response from the API.
5344
+ * @throws {Error} If the service type is not Google Pay.
4812
5345
  */
4813
- reload(): void;
5346
+ protected validateServiceType(serviceConfig: GetConfigResponse): void;
4814
5347
  /**
4815
- * After select event of widget, data (dataType) will be insert to input (selector)
5348
+ * Creates a Google Pay wallet service instance.
4816
5349
  *
4817
- * @param {string} selector - css selector . [] #
4818
- * @param {string} dataType - data type of [IEventSelectData]{@link IEventSelectData}.
5350
+ * @private
5351
+ * @param serviceConfig - The service configuration response from the API.
5352
+ * @returns The Google Pay wallet service instance.
4819
5353
  */
4820
- onSelectInsert(selector: string, dataType: string): void;
5354
+ protected createWalletService(serviceConfig: GetConfigResponse): OpenWalletService;
5355
+ }
5356
+
5357
+ declare const TYPE: {
5358
+ EXTERNAL_CHECKOUT_TOKEN: string;
5359
+ CHECKOUT_TOKEN: string;
5360
+ BANK_ACCOUNT: string;
5361
+ CARD: string;
5362
+ };
5363
+ interface IBody {
5364
+ gateway_id: string;
5365
+ type: string;
5366
+ checkout_token?: string;
5367
+ }
5368
+ declare class Builder extends HttpCore {
5369
+ private body;
5370
+ constructor(gatewayID: string, checkoutToken: string, type: string);
5371
+ constructor(gatewayID: string, externalCheckoutToken: string, type: string);
5372
+ constructor(gatewayID: string, card: any, type: string);
5373
+ constructor(gatewayID: string, bankAccount: any, type: string);
5374
+ protected getLink(): string;
5375
+ send(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
5376
+ getConfigs(): IBody;
4821
5377
  }
4822
5378
 
4823
5379
  declare enum ErrorCodes$1 {
@@ -5345,48 +5901,102 @@ declare enum EventEnum {
5345
5901
  ON_WALLET_LOADED = "onWalletLoaded"
5346
5902
  }
5347
5903
 
5904
+ /**
5905
+ * Payload of the `paymentSuccessful` event emitted by `WalletButtons`.
5906
+ * Represents the final charge result returned by the backend.
5907
+ *
5908
+ * For tamper-resistant validation, do a server-to-server fetch using `id`
5909
+ * — never trust this payload alone for fulfillment decisions.
5910
+ */
5348
5911
  interface IWalletPaymentSuccessful {
5912
+ /** Charge identifier returned by the backend. */
5349
5913
  id: string;
5914
+ /** Final charge amount as a number. */
5350
5915
  amount: number;
5916
+ /** ISO 4217 currency code of the charge. */
5351
5917
  currency: string;
5918
+ /** Backend charge status (e.g. `'complete'`, `'pending'`). */
5352
5919
  status: string;
5920
+ /** Payer's full name if collected by the wallet. */
5353
5921
  payer_name?: string;
5922
+ /** Payer's email if collected by the wallet. */
5354
5923
  payer_email?: string;
5924
+ /** Payer's phone number if collected by the wallet. */
5355
5925
  payer_phone?: string;
5356
5926
  }
5927
+ /**
5928
+ * Payload of the `unavailable` event emitted by `WalletButtons`.
5929
+ * Identifies which wallet became unavailable when more than one is configured.
5930
+ */
5357
5931
  interface IWalletUnavailable {
5932
+ /** The wallet type that is unavailable. Absent when the unavailability is generic. */
5358
5933
  wallet?: WALLET_TYPE;
5359
5934
  }
5935
+ /**
5936
+ * Payload of the `onClick` event emitted by `WalletButtons`.
5937
+ * Hand back a `Promise<void>` (defer the wallet sheet) or `Promise<boolean>` /
5938
+ * `boolean` (return `false` to abort the flow) via `attachResult`.
5939
+ */
5360
5940
  interface IWalletOnClick {
5941
+ /** Attach the result of an async operation to control the wallet flow. Resolving with `false` aborts; `void`/`true` continues. */
5361
5942
  attachResult: (result: Promise<void> | boolean) => void;
5362
5943
  }
5944
+ /**
5945
+ * Payload of the `update` event emitted by `WalletButtons` during the wallet flow
5946
+ * (e.g. when the user authorizes the payment in the wallet sheet but before the
5947
+ * server-side capture completes).
5948
+ */
5363
5949
  interface IWalletUpdate {
5950
+ /** Response code from the wallet provider (provider-specific). */
5364
5951
  wallet_response_code?: string;
5952
+ /** Wallet provider's order identifier for this transaction. */
5365
5953
  wallet_order_id?: string;
5954
+ /** Wallet provider's session identifier for this interaction. */
5366
5955
  wallet_session_id?: string;
5956
+ /** Payment source details captured from the wallet. */
5367
5957
  payment_source?: {
5958
+ /** Wallet's internal payment method identifier. */
5368
5959
  wallet_payment_method_id?: string;
5960
+ /** Last 4 digits of the card. */
5369
5961
  card_number_last4?: string;
5962
+ /** Card network/scheme (e.g. `'visa'`, `'mastercard'`). */
5370
5963
  card_scheme?: string;
5371
5964
  };
5965
+ /** Loyalty account details if the wallet provider supports loyalty. */
5372
5966
  wallet_loyalty_account?: {
5967
+ /** Loyalty account identifier. */
5373
5968
  id?: string;
5969
+ /** Loyalty account barcode. */
5374
5970
  barcode?: string;
5375
5971
  };
5972
+ /** Shipping address selected in the wallet sheet. */
5376
5973
  shipping?: {
5974
+ /** Street address line 1. */
5377
5975
  address_line1?: string;
5976
+ /** Street address line 2. */
5378
5977
  address_line2?: string;
5978
+ /** Postal/ZIP code. */
5379
5979
  address_postcode?: string;
5980
+ /** City. */
5380
5981
  address_city?: string;
5982
+ /** State or administrative area. */
5381
5983
  address_state?: string;
5984
+ /** ISO 3166 country code. */
5382
5985
  address_country?: string;
5986
+ /** Company name on the address. */
5383
5987
  address_company?: string;
5988
+ /** Post office box number. */
5384
5989
  post_office_box_number?: string;
5990
+ /** Wallet provider's identifier for this saved address. */
5385
5991
  wallet_address_id?: string;
5992
+ /** Display name for this saved address (e.g. `'Home'`). */
5386
5993
  wallet_address_name?: string;
5994
+ /** ISO 8601 timestamp of when the address was saved. */
5387
5995
  wallet_address_created_timestamp?: string;
5996
+ /** ISO 8601 timestamp of the last update to the address. */
5388
5997
  wallet_address_updated_timestamp?: string;
5389
5998
  };
5999
+ /** The shipping option the user selected in the wallet sheet. */
5390
6000
  selected_shipping_option?: IShippingOption;
5391
6001
  }
5392
6002
 
@@ -5750,62 +6360,6 @@ declare class WalletButtons {
5750
6360
  private setupAuthTokensChangedCallback;
5751
6361
  }
5752
6362
 
5753
- interface BaseGatewayConfig<T> {
5754
- type: string;
5755
- mode: string;
5756
- credentials?: T;
5757
- }
5758
-
5759
- interface BaseWalletMeta {
5760
- amount: number;
5761
- currency: string;
5762
- }
5763
-
5764
- interface ChargeWalletTokenMeta {
5765
- charge: {
5766
- id: string;
5767
- amount: number;
5768
- currency: string;
5769
- capture?: boolean;
5770
- reference?: string;
5771
- shipping?: {
5772
- amount?: number;
5773
- currency?: string;
5774
- address_line1?: string;
5775
- address_line2?: string;
5776
- address_line3?: string;
5777
- address_city?: string;
5778
- address_postcode?: string;
5779
- address_state?: string;
5780
- address_country?: string;
5781
- address_country_code?: string;
5782
- address_company?: string;
5783
- address_origin_postcode?: string;
5784
- method?: string;
5785
- type?: string;
5786
- options?: Array<{
5787
- id?: string;
5788
- label?: string;
5789
- detail?: string;
5790
- amount?: string;
5791
- currency?: string;
5792
- type?: string;
5793
- }>;
5794
- contact?: {
5795
- first_name?: string;
5796
- last_name?: string;
5797
- email?: string;
5798
- phone?: string;
5799
- phone2?: string;
5800
- };
5801
- };
5802
- };
5803
- gateway: {
5804
- mode: string;
5805
- type: string;
5806
- };
5807
- }
5808
-
5809
6363
  declare enum EVENT {
5810
6364
  UNAVAILABLE = "unavailable",
5811
6365
  ERROR = "error",
@@ -5818,6 +6372,18 @@ declare enum EVENT {
5818
6372
  ON_SHIPPING_OPTIONS_CHANGE = "onShippingOptionsChange"
5819
6373
  }
5820
6374
 
6375
+ /**
6376
+ * Base metadata required by every Wallet Buttons Express button.
6377
+ * Concrete wallet metas (e.g. `ApplePayWalletMeta`, `PaypalWalletMeta`) extend
6378
+ * this with wallet-specific configuration.
6379
+ */
6380
+ interface BaseWalletMeta {
6381
+ /** The payment amount as a number (e.g. `19.99`). */
6382
+ amount: number;
6383
+ /** The ISO 4217 currency code (e.g. `'AUD'`, `'USD'`). */
6384
+ currency: string;
6385
+ }
6386
+
5821
6387
  interface BaseEventData<T> {
5822
6388
  event: string;
5823
6389
  chargeId?: string;
@@ -5906,6 +6472,57 @@ interface OnUnavailableEventData extends BaseEventData<undefined> {
5906
6472
  event: EVENT.UNAVAILABLE;
5907
6473
  }
5908
6474
 
6475
+ interface BaseGatewayConfig<T> {
6476
+ type: string;
6477
+ mode: string;
6478
+ credentials?: T;
6479
+ }
6480
+
6481
+ interface ChargeWalletTokenMeta {
6482
+ charge: {
6483
+ id: string;
6484
+ amount: number;
6485
+ currency: string;
6486
+ capture?: boolean;
6487
+ reference?: string;
6488
+ shipping?: {
6489
+ amount?: number;
6490
+ currency?: string;
6491
+ address_line1?: string;
6492
+ address_line2?: string;
6493
+ address_line3?: string;
6494
+ address_city?: string;
6495
+ address_postcode?: string;
6496
+ address_state?: string;
6497
+ address_country?: string;
6498
+ address_country_code?: string;
6499
+ address_company?: string;
6500
+ address_origin_postcode?: string;
6501
+ method?: string;
6502
+ type?: string;
6503
+ options?: Array<{
6504
+ id?: string;
6505
+ label?: string;
6506
+ detail?: string;
6507
+ amount?: string;
6508
+ currency?: string;
6509
+ type?: string;
6510
+ }>;
6511
+ contact?: {
6512
+ first_name?: string;
6513
+ last_name?: string;
6514
+ email?: string;
6515
+ phone?: string;
6516
+ phone2?: string;
6517
+ };
6518
+ };
6519
+ };
6520
+ gateway: {
6521
+ mode: string;
6522
+ type: string;
6523
+ };
6524
+ }
6525
+
5909
6526
  interface Contact {
5910
6527
  first_name?: string;
5911
6528
  last_name?: string;
@@ -5957,6 +6574,7 @@ declare abstract class BaseWalletButton<T extends BaseWalletMeta> {
5957
6574
  protected meta: T;
5958
6575
  protected eventEmitter: EventEmitter;
5959
6576
  protected chargeWalletTokenMeta?: ChargeWalletTokenMeta;
6577
+ protected isDisabled: boolean;
5960
6578
  private onShippingOptionsChangeHandlerRegistered;
5961
6579
  constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: T, requiredMetaFields: string[]);
5962
6580
  private getApiAuthType;
@@ -5971,6 +6589,20 @@ declare abstract class BaseWalletButton<T extends BaseWalletMeta> {
5971
6589
  * @param {string} [alias] - Own domain alias
5972
6590
  */
5973
6591
  setEnv(env: string, alias?: string): void;
6592
+ /**
6593
+ * Enables the wallet button, restoring interactivity and visual appearance.
6594
+ *
6595
+ * @example
6596
+ * button.enable();
6597
+ */
6598
+ enable(): void;
6599
+ /**
6600
+ * Disables the wallet button, preventing clicks and applying a visual disabled state.
6601
+ *
6602
+ * @example
6603
+ * button.disable();
6604
+ */
6605
+ disable(): void;
5974
6606
  /**
5975
6607
  * Callback for onClick method.
5976
6608
  *
@@ -6178,6 +6810,7 @@ declare abstract class BaseWalletButton<T extends BaseWalletMeta> {
6178
6810
  protected handleOnUnavailable(): void;
6179
6811
  protected handleOnError(error?: Error): void;
6180
6812
  protected eventDataFromApiError(err: any): OnPaymentErrorEventData['data'];
6813
+ protected applyDisabledStyles(): void;
6181
6814
  protected validateRequiredMetaFields(requiredMetaFields: string[]): void;
6182
6815
  }
6183
6816
 
@@ -6214,20 +6847,43 @@ interface IApplePayShippingOption {
6214
6847
  amount?: string;
6215
6848
  }
6216
6849
 
6850
+ /**
6851
+ * Metadata required to configure an `ApplePayWalletButtonExpress` button.
6852
+ * Extends {@link BaseWalletMeta} (`amount`, `currency`) plus Apple Pay specifics.
6853
+ *
6854
+ * The walletToken (JWT) returned from the `onClick` handler authorizes the actual
6855
+ * charge; this meta only configures the button presentation and the Apple Pay sheet.
6856
+ */
6217
6857
  interface ApplePayWalletMeta extends BaseWalletMeta {
6858
+ /** Label shown next to the total in the Apple Pay sheet (e.g. `'TOTAL'`). */
6218
6859
  amount_label: string;
6860
+ /** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). Required by Apple Pay. */
6219
6861
  country: string;
6862
+ /** Payment capabilities the merchant supports. Must include at least `'supports3DS'`. */
6220
6863
  merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
6864
+ /** Card networks the merchant accepts. */
6221
6865
  supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
6866
+ /** Billing contact fields the user must provide. Note: Apple does not currently return `'phone'` or `'email'`. */
6222
6867
  required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
6868
+ /** Shipping contact fields the user must provide. Include `'postalAddress'` to surface the address fields in the sheet. */
6223
6869
  required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
6870
+ /**
6871
+ * Device capabilities allowed for the wallet button to be considered available.
6872
+ * Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
6873
+ */
6224
6874
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
6875
+ /** Restrict the cards Apple Pay offers to those issued in these ISO 3166 country codes. */
6225
6876
  supported_countries?: string[];
6877
+ /** Visual styling for the Apple Pay button. */
6226
6878
  style?: {
6879
+ /** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`). */
6227
6880
  button_type?: ApplePayButtonType;
6881
+ /** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
6228
6882
  button_style?: ApplePayButtonStyle;
6229
6883
  };
6884
+ /** Pre-filled shipping data to seed the Apple Pay sheet. */
6230
6885
  shipping?: AppleShippingType;
6886
+ /** Whether the user can edit the shipping address: `'available'` allows editing; `'store_pickup'` locks it. */
6231
6887
  shipping_editing_mode?: ContactShippingEditingMode;
6232
6888
  }
6233
6889
 
@@ -6288,32 +6944,63 @@ declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalle
6288
6944
  private isUnsuportedBrowser;
6289
6945
  }
6290
6946
 
6947
+ /**
6948
+ * Metadata required to configure a `PaypalWalletButtonExpress` button.
6949
+ * Extends {@link BaseWalletMeta} (`amount`, `currency`) with PayPal-specific options.
6950
+ *
6951
+ * Most PayPal style options mirror the
6952
+ * [PayPal Buttons Style Guide](https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/).
6953
+ */
6291
6954
  interface PaypalWalletMeta extends BaseWalletMeta {
6955
+ /** Enable PayPal's Pay Later (Pay in 4) option. Defaults to `false`. */
6292
6956
  pay_later?: boolean;
6957
+ /** Hide the Pay Later messaging copy under the button. Defaults to `false`. */
6293
6958
  hide_message?: boolean;
6959
+ /** Render the standalone PayPal button instead of the smart button group. Defaults to `false`. */
6294
6960
  standalone?: boolean;
6961
+ /** Capture the transaction immediately (`true`) or authorize for later capture (`false`). Defaults to `false`. */
6295
6962
  capture?: boolean;
6963
+ /** Visual styling for the PayPal button. Mirrors PayPal's smart button style schema. */
6296
6964
  style?: {
6965
+ /** Button layout orientation. */
6297
6966
  layout?: 'vertical' | 'horizontal';
6967
+ /** Button color theme. */
6298
6968
  color?: 'gold' | 'blue' | 'silver' | 'black' | 'white';
6969
+ /** Button shape. */
6299
6970
  shape?: 'rect' | 'pill' | 'sharp';
6971
+ /** Custom border radius in pixels. Overrides `shape` corner roundness. */
6300
6972
  borderRadius?: number;
6973
+ /** Button height in pixels. */
6301
6974
  height?: number;
6975
+ /** When `true`, removes PayPal's default max-width constraint on the button. */
6302
6976
  disableMaxWidth?: boolean;
6977
+ /** Label text displayed on the button. */
6303
6978
  label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment';
6979
+ /** Whether to show the tagline beneath the button. */
6304
6980
  tagline?: boolean;
6981
+ /** Pay Later messaging configuration shown alongside the button. */
6305
6982
  messages?: {
6983
+ /** Layout type for the messaging block. */
6306
6984
  layout?: 'text' | 'flex';
6985
+ /** PayPal logo configuration in the messaging block. */
6307
6986
  logo?: {
6987
+ /** Logo variant. `'none'` removes the logo entirely. */
6308
6988
  type?: 'primary' | 'alternative' | 'inline' | 'none';
6989
+ /** Logo position relative to the message text. */
6309
6990
  position?: 'left' | 'right' | 'top';
6310
6991
  };
6992
+ /** Message text styling. */
6311
6993
  text?: {
6994
+ /** Text color. */
6312
6995
  color?: 'black' | 'white' | 'monochrome' | 'grayscale';
6996
+ /** Font size in pixels (10-16). */
6313
6997
  size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
6998
+ /** Horizontal alignment. */
6314
6999
  align?: 'left' | 'center' | 'right';
6315
7000
  };
7001
+ /** Background color of the messaging block (used when `layout` is `'flex'`). */
6316
7002
  color?: 'blue' | 'black' | 'white' | 'white-no-border' | 'gray' | 'monochrome' | 'grayscale';
7003
+ /** Aspect ratio of the messaging block. */
6317
7004
  ratio?: '1x1' | '1x4' | '8x1' | '20x1';
6318
7005
  };
6319
7006
  };
@@ -6544,7 +7231,8 @@ declare global {
6544
7231
  ExternalCheckoutBuilder: typeof Builder$1;
6545
7232
  ExternalCheckoutChecker: typeof Checker;
6546
7233
  PaymentSourceBuilder: typeof Builder;
6547
- Canvas3DS: typeof Canvas3ds;
7234
+ Canvas3ds: typeof Canvas3ds;
7235
+ Checkout: typeof Checkout;
6548
7236
  MultiWidget: typeof MultiWidget;
6549
7237
  HtmlMultiWidget: typeof HtmlMultiWidget;
6550
7238
  HtmlWidget: typeof HtmlWidget;
@@ -6555,5 +7243,5 @@ declare global {
6555
7243
  }
6556
7244
  }
6557
7245
 
6558
- export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, CheckoutActionCode, ClickToPay, Configuration, ELEMENT, ERROR_OPERATION, EVENT$2 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, OpenWalletButtons, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
6559
- export type { Billing, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventCheckoutFinishData, IEventData, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, Shipping, VaultDisplayStyle, WalletType };
7246
+ export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CANVAS_3DS_EVENT, CHECKOUT_BUTTON_EVENT, EVENT$2 as CHECKOUT_EVENT, Canvas3ds, Canvas3dsTokenFormat, Checkout, CheckoutActionCode, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$3 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, OpenWalletButtons, PAYMENT_EXPIRED, PAYMENT_FAILURE, PAYMENT_SUCCESSFUL, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
7247
+ export type { ApplePayButtonStyle, ApplePayButtonType, ApplePayOpenWalletMeta, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, Canvas3dsAuthPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, CheckoutIntentTokenPayload, CheckoutPaymentExpiredPayload, CheckoutPaymentFailurePayload, CheckoutPaymentSuccessPayload, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, GooglePayCardConfig, GooglePayOpenWalletMeta, GooglePayOpenWalletMetaStyles, HandleResponseInterface, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventError, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, ITokenStandalone3DS, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, PaypalWalletMeta, ProcessAuthenticationResponse, Shipping, VaultDisplayStyle, OnClickEventData as WalletExpressOnClickEventData, OnCloseEventData as WalletExpressOnCloseEventData, OnErrorEventData as WalletExpressOnErrorEventData, OnPaymentErrorEventData as WalletExpressOnPaymentErrorEventData, OnPaymentInReviewEventData as WalletExpressOnPaymentInReviewEventData, OnPaymentSuccessfulEventData as WalletExpressOnPaymentSuccessfulEventData, OnShippingAddressChangeEventData as WalletExpressOnShippingAddressChangeEventData, OnShippingAddressChangeEventResponse as WalletExpressOnShippingAddressChangeEventResponse, OnShippingOptionChangeEventData as WalletExpressOnShippingOptionChangeEventData, OnShippingOptionChangeEventResponse as WalletExpressOnShippingOptionChangeEventResponse, OnUnavailableEventData as WalletExpressOnUnavailableEventData, WalletType, WidgetEventMap, WidgetEventName };