@paydock/client-sdk 1.143.0-beta → 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 (72) hide show
  1. package/README.md +158 -0
  2. package/bundles/index.cjs +523 -312
  3. package/bundles/index.cjs.d.ts +751 -116
  4. package/bundles/index.mjs +518 -313
  5. package/bundles/index.mjs.d.ts +751 -116
  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/param.d.ts +29 -0
  29. package/bundles/types/components/param.d.ts.map +1 -1
  30. package/bundles/types/helper/event-error.d.ts +49 -1
  31. package/bundles/types/helper/event-error.d.ts.map +1 -1
  32. package/bundles/types/index-cba.d.ts +3 -1
  33. package/bundles/types/index-cba.d.ts.map +1 -1
  34. package/bundles/types/index.d.ts +12 -1
  35. package/bundles/types/index.d.ts.map +1 -1
  36. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +37 -0
  37. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
  38. package/bundles/types/open-wallets/base/open-wallet.service.d.ts +12 -0
  39. package/bundles/types/open-wallets/base/open-wallet.service.d.ts.map +1 -1
  40. package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
  41. package/bundles/types/open-wallets/index.d.ts +25 -0
  42. package/bundles/types/open-wallets/index.d.ts.map +1 -1
  43. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts +2 -2
  44. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts.map +1 -1
  45. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -1
  46. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
  47. package/bundles/types/open-wallets/interfaces/events.interface.d.ts +1 -1
  48. package/bundles/types/open-wallets/interfaces/events.interface.d.ts.map +1 -1
  49. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts +46 -0
  50. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts.map +1 -1
  51. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +48 -2
  52. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
  53. package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
  54. package/bundles/types/open-wallets/types/index.d.ts +1 -1
  55. package/bundles/types/open-wallets/types/index.d.ts.map +1 -1
  56. package/bundles/types/open-wallets/types/payment-source.type.d.ts +104 -0
  57. package/bundles/types/open-wallets/types/payment-source.type.d.ts.map +1 -1
  58. package/bundles/types/wallet-buttons/interfaces.d.ts +55 -1
  59. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  60. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +7 -0
  61. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -1
  62. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +23 -0
  63. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
  64. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  65. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
  66. package/bundles/widget.umd.js +523 -312
  67. package/bundles/widget.umd.js.d.ts +751 -116
  68. package/bundles/widget.umd.js.min.d.ts +751 -116
  69. package/bundles/widget.umd.min.js +1 -1
  70. package/docs/api-canvas3ds.md +19 -12
  71. package/docs/open-wallet-buttons.md +158 -0
  72. package/package.json +1 -1
@@ -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
 
@@ -2129,7 +2244,7 @@ interface IEventData$1 {
2129
2244
  ref_id?: string;
2130
2245
  error?: IEventError;
2131
2246
  }
2132
- declare const EVENT$2: {
2247
+ declare const EVENT$3: {
2133
2248
  readonly AFTER_LOAD: "afterLoad";
2134
2249
  readonly SUBMIT: "submit";
2135
2250
  readonly FINISH: "finish";
@@ -2161,7 +2276,7 @@ declare const EVENT$2: {
2161
2276
  readonly DISPATCH_SUCCESS: "dispatchSuccess";
2162
2277
  readonly DISPATCH_ERROR: "dispatchError";
2163
2278
  };
2164
- type EventTypes = typeof EVENT$2[keyof typeof EVENT$2];
2279
+ type EventTypes = typeof EVENT$3[keyof typeof EVENT$3];
2165
2280
  interface Listener {
2166
2281
  event: string;
2167
2282
  listener: (event: any) => void;
@@ -2177,17 +2292,99 @@ declare class IFrameEvent {
2177
2292
  private subscribe;
2178
2293
  }
2179
2294
 
2180
- declare class Standalone3dsService {
2181
- protected container: Container;
2182
- protected eventEmitter: EventEmitter;
2183
- protected env: string;
2184
- protected alias: string;
2185
- constructor(container: Container, eventEmitter: any);
2186
- load(token: string, options: {
2187
- title: string;
2188
- }): void;
2189
- 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
+ };
2190
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
+ };
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];
2191
2388
 
2192
2389
  /**
2193
2390
  * List of available token's content formats
@@ -2223,7 +2420,7 @@ declare enum TOKEN_FORMAT {
2223
2420
  * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
2224
2421
  * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
2225
2422
  * @param {string} ERROR=error
2226
- */
2423
+ */
2227
2424
  /**
2228
2425
  * Class Canvas3ds include method for working on html
2229
2426
  * @constructor
@@ -2271,8 +2468,10 @@ declare class Canvas3ds {
2271
2468
  */
2272
2469
  setEnv(env: string, alias?: string): void;
2273
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;
2274
2474
  on(eventName: string): Promise<IEventData$1>;
2275
- on(eventName: string, cb: (data: IEventData$1) => void): any;
2276
2475
  /**
2277
2476
  * Using this method you can hide widget after load
2278
2477
  * @param {boolean} [saveSize=false] - using this param you can save iframe's size
@@ -2290,6 +2489,59 @@ declare class Canvas3ds {
2290
2489
  reload(): void;
2291
2490
  }
2292
2491
 
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
+ */
2497
+ interface HandleResponseInterface {
2498
+ status: string;
2499
+ error: string;
2500
+ result: {
2501
+ reference: string;
2502
+ reference_2: string;
2503
+ identifier: string;
2504
+ identifier_2: string;
2505
+ identifier_3: string;
2506
+ identifier_4: string;
2507
+ identifier_5: string;
2508
+ type: string;
2509
+ status: string;
2510
+ status_2: string;
2511
+ status_code: string;
2512
+ ref_token: string;
2513
+ cancellation: string;
2514
+ count: string;
2515
+ version: string;
2516
+ whitelist: {
2517
+ status: string;
2518
+ source: string;
2519
+ };
2520
+ result: string;
2521
+ };
2522
+ }
2523
+ interface ProcessAuthenticationResponse {
2524
+ status: string;
2525
+ error?: string;
2526
+ result?: {
2527
+ challenge: string;
2528
+ challenge_url: string;
2529
+ decoupled_challenge: boolean;
2530
+ frictionless: boolean;
2531
+ identifier: string;
2532
+ identifier_3: string;
2533
+ identifier_4: string;
2534
+ reference: string;
2535
+ reference_2: string;
2536
+ secondary_url: string;
2537
+ skipped: boolean;
2538
+ status: string;
2539
+ type: string;
2540
+ version: string;
2541
+ description?: string;
2542
+ };
2543
+ }
2544
+
2293
2545
  declare class ApiChargeInternal {
2294
2546
  protected api: ApiInternal;
2295
2547
  constructor(api: ApiInternal);
@@ -2339,52 +2591,14 @@ interface WalletCallbackResponse {
2339
2591
  interface Standalone3dsProcessBody {
2340
2592
  charge_3ds_id: string;
2341
2593
  }
2342
- interface HandleResponseInterface {
2343
- status: string;
2344
- error: string;
2345
- result: {
2346
- reference: string;
2347
- reference_2: string;
2348
- identifier: string;
2349
- identifier_2: string;
2350
- identifier_3: string;
2351
- identifier_4: string;
2352
- identifier_5: string;
2353
- type: string;
2354
- status: string;
2355
- status_2: string;
2356
- status_code: string;
2357
- ref_token: string;
2358
- cancellation: string;
2359
- count: string;
2360
- version: string;
2361
- whitelist: {
2362
- status: string;
2363
- source: string;
2364
- };
2365
- result: string;
2366
- };
2367
- }
2368
- interface ProcessAuthenticationResponse {
2369
- status: string;
2370
- error?: string;
2371
- result?: {
2372
- challenge: string;
2373
- challenge_url: string;
2374
- decoupled_challenge: boolean;
2375
- frictionless: boolean;
2376
- identifier: string;
2377
- identifier_3: string;
2378
- identifier_4: string;
2379
- reference: string;
2380
- reference_2: string;
2381
- secondary_url: string;
2382
- skipped: boolean;
2383
- status: string;
2384
- type: string;
2385
- version: string;
2386
- description?: string;
2387
- };
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>;
2388
2602
  }
2389
2603
 
2390
2604
  declare class ApiGatewayInternal {
@@ -2448,80 +2662,184 @@ declare enum WALLET_TYPES {
2448
2662
  GOOGLE_PAY = "google"
2449
2663
  }
2450
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
+ */
2451
2670
  interface CreateOTTResponse {
2671
+ /** The temporary one-time token string. Single use, short TTL — exchange it server-side immediately. */
2452
2672
  temp_token: string;
2673
+ /** Token classification. `CARD` for FPAN (Google Pay only); `CARD_SCHEME_TOKEN` for DPAN (Apple Pay & Google Pay). */
2453
2674
  token_type: TOKEN_TYPE;
2454
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
+ */
2455
2680
  interface Billing {
2681
+ /** First street address line. */
2456
2682
  address_line1: string;
2683
+ /** Second street address line. Empty string when the wallet did not provide it. */
2457
2684
  address_line2: string;
2685
+ /** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). */
2458
2686
  address_country: string;
2687
+ /** City. */
2459
2688
  address_city: string;
2689
+ /** Postal/ZIP code. */
2460
2690
  address_postcode: string;
2691
+ /** State or administrative area (e.g. `'NSW'`, `'CA'`). */
2461
2692
  address_state: string;
2462
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
+ */
2463
2698
  interface CardInfo {
2699
+ /** Card network identifier from the wallet (e.g. `'visa'`, `'mastercard'`, `'amex'`). */
2464
2700
  card_scheme: string;
2701
+ /** Last 4 digits of the card, when the wallet provider exposes them. */
2465
2702
  card_number_last4?: string;
2466
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
+ */
2467
2708
  interface CreateOTTData {
2709
+ /** Charge amount as a number (e.g. `19.99`). */
2468
2710
  amount: number;
2711
+ /** Shipping address and contact info captured from the wallet. */
2469
2712
  shipping: Shipping;
2713
+ /** Billing address captured from the wallet. */
2470
2714
  billing: Billing;
2715
+ /** Card metadata captured from the wallet (network, last 4). */
2471
2716
  card_info: CardInfo;
2717
+ /** Wallet-provider reference token (DPAN/FPAN payload) used by Paydock to settle the charge. */
2472
2718
  ref_token: string;
2473
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. */
2474
2723
  interface CreateOTTRequest {
2724
+ /** The Paydock service ID configured in the merchant dashboard for this wallet. */
2475
2725
  service_id: string;
2726
+ /** Wallet type identifier (Apple Pay, Google Pay, etc.). */
2476
2727
  service_type: SERVICE_TYPES;
2728
+ /** Service group classification (e.g. `'WALLET'`). */
2477
2729
  service_group: SERVICE_GROUP;
2730
+ /** Encrypted/encoded payload from the wallet (DPAN/FPAN data). */
2478
2731
  payload: string;
2732
+ /** Encoding format of `payload` — currently `'encrypted_string'`. */
2479
2733
  payload_format: PAYLOAD_FORMAT;
2480
2734
  }
2735
+ /**
2736
+ * Request body sent when initiating a wallet session against Paydock
2737
+ * (used by the Apple Pay merchant validation flow).
2738
+ */
2481
2739
  interface CreateSessionRequest {
2740
+ /** The Paydock service ID for the wallet. */
2482
2741
  service_id: string;
2742
+ /** Caller-controlled session identifier — Paydock binds the session to this id. */
2483
2743
  session_id: string;
2744
+ /** Whether the wallet sheet should ask the user for shipping. */
2484
2745
  request_shipping?: boolean;
2746
+ /** Merchant store name displayed in the wallet sheet. */
2485
2747
  store_name: string;
2486
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
+ */
2487
2753
  interface CreateSessionResponse {
2754
+ /** Paydock session identifier. */
2488
2755
  id: string;
2756
+ /** Session status (e.g. `'active'`). */
2489
2757
  status: string;
2758
+ /** HTTP method the SDK should use to invoke the callback URL. */
2490
2759
  callback_method: string;
2760
+ /** Relation/role of the callback (e.g. `'merchant_validation'`). */
2491
2761
  callback_rel: string;
2762
+ /** URL the SDK calls to complete the merchant validation step. */
2492
2763
  callback_url: string;
2493
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
+ */
2494
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
+ */
2495
2776
  declare enum CheckoutActionCode {
2777
+ /** Payment completed successfully. */
2496
2778
  COMPLETE = "COMPLETE",
2779
+ /** User cancelled the wallet sheet. */
2497
2780
  CANCEL = "CANCEL",
2781
+ /** An error occurred during payment authorization. */
2498
2782
  ERROR = "ERROR",
2783
+ /** User opted to switch to a different card in the wallet. */
2499
2784
  CHANGE_CARD = "CHANGE_CARD",
2785
+ /** User opted to add a new card to the wallet. */
2500
2786
  ADD_CARD = "ADD_CARD",
2787
+ /** User switched to a different consumer (Click to Pay flow). */
2501
2788
  SWITCH_CONSUMER = "SWITCH_CONSUMER"
2502
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
+ */
2503
2794
  interface OTTResponse {
2795
+ /** The OTT string. */
2504
2796
  token: string;
2797
+ /** Token type identifier (string form of {@link TOKEN_TYPE}). */
2505
2798
  token_type: string;
2799
+ /** When `true`, the integrator must invoke a Canvas3DS step before settling the charge. */
2506
2800
  three_ds_required?: boolean;
2801
+ /** Which wallet produced the token (Apple Pay or Google Pay). */
2507
2802
  wallet_type: WalletType;
2508
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
+ */
2509
2811
  interface Shipping {
2812
+ /** Selected shipping method identifier (e.g. `'standard'`, `'express'`). */
2510
2813
  method?: string;
2814
+ /** Updated shipping options that were available when the user made their selection. */
2511
2815
  options?: IShippingOption[];
2816
+ /** First street address line (Apple Pay only). */
2512
2817
  address_line1?: string;
2818
+ /** Second street address line (Apple Pay only). */
2513
2819
  address_line2?: string;
2820
+ /** City. */
2514
2821
  address_city?: string;
2822
+ /** Postal/ZIP code. */
2515
2823
  address_postcode?: string;
2824
+ /** State or administrative area. */
2516
2825
  address_state?: string;
2826
+ /** ISO 3166-1 alpha-2 country code. */
2517
2827
  address_country?: string;
2828
+ /** Company name on the address (when the wallet captured it). */
2518
2829
  address_company?: string;
2830
+ /** Origin postal code — used for shipping calculations when the merchant ships from a fixed location. */
2519
2831
  address_origin_postcode?: string;
2832
+ /** Shipping contact information (Apple Pay only). */
2520
2833
  contact?: {
2834
+ /** Contact first name. */
2521
2835
  first_name?: string;
2836
+ /** Contact last name. */
2522
2837
  last_name?: string;
2838
+ /** Contact email address. */
2523
2839
  email?: string;
2840
+ /** Contact phone number. */
2524
2841
  phone?: string;
2842
+ /** Contact secondary phone number. */
2525
2843
  phone2?: string;
2526
2844
  };
2527
2845
  }
@@ -2541,13 +2859,52 @@ declare class ApiInternal extends ApiBase {
2541
2859
  paymentSource(): ApiPaymentSourceInternal;
2542
2860
  }
2543
2861
 
2544
- declare class ApiCheckoutInternal {
2545
- protected api: ApiInternal;
2546
- constructor(api: ApiInternal);
2547
- instructions(): Observable<object>;
2548
- private getInstructionLink;
2549
- callback(payload: Object): Promise<Object>;
2550
- 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 {
2551
2908
  }
2552
2909
 
2553
2910
  type Instruction = new (selector: string, api: ApiInternal, checkoutWidget: Checkout, formSelector?: string) => InstructionHandler & InstructionDestroyable & InstructionDecorated;
@@ -2577,11 +2934,32 @@ declare class InstructionModule {
2577
2934
  getInstruction(id: string): Instruction | null;
2578
2935
  }
2579
2936
 
2580
- 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'`). */
2581
2955
  env: string;
2956
+ /** The Paydock checkout intent identifier this token authorizes. */
2582
2957
  intent_id: string;
2958
+ /** Token schema version. Used by the SDK for forward/backward compatibility. */
2583
2959
  version: number;
2960
+ /** Human-readable alias for the environment (e.g. `'staging-3'`, `'multitenant-preprod'`). */
2584
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. */
2585
2963
  whitelist_domains: string[];
2586
2964
  }
2587
2965
  /**
@@ -2601,7 +2979,7 @@ declare class Checkout {
2601
2979
  protected window: Window;
2602
2980
  protected eventEmitter: EventEmitter;
2603
2981
  protected container: Container;
2604
- protected intentTokenPayload: IntentTokenPayload;
2982
+ protected intentTokenPayload: CheckoutIntentTokenPayload;
2605
2983
  protected api: ApiInternal;
2606
2984
  protected checkoutApi: ApiCheckoutInternal;
2607
2985
  protected instructions: InstructionModule;
@@ -2615,7 +2993,7 @@ declare class Checkout {
2615
2993
  fetchInstruction(): void;
2616
2994
  finaliseCheckout(): void;
2617
2995
  private setupTimeoutTimer;
2618
- private extractIntentTokenPayload;
2996
+ private extractCheckoutIntentTokenPayload;
2619
2997
  validateJWTWhitelistedDomains(whitelist_domains: string[]): boolean;
2620
2998
  private ready;
2621
2999
  private initContractVersion;
@@ -2634,7 +3012,7 @@ declare class Checkout {
2634
3012
  * console.log('Payment successful!');
2635
3013
  * });
2636
3014
  */
2637
- onPaymentSuccessful(handler: (data: IEventData$1) => void): () => void;
3015
+ onPaymentSuccessful<T extends IEventData$1 = CheckoutPaymentSuccessPayload>(handler: (data: T) => void): () => void;
2638
3016
  /**
2639
3017
  * If the payment was not successful, the function passed as parameter will be called.
2640
3018
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
@@ -2644,17 +3022,17 @@ declare class Checkout {
2644
3022
  * console.log('Payment not successful');
2645
3023
  * });
2646
3024
  */
2647
- onPaymentFailure(handler: (data: IEventData$1) => void): () => void;
3025
+ onPaymentFailure<T extends IEventData$1 = CheckoutPaymentFailurePayload>(handler: (data: T) => void): () => void;
2648
3026
  /**
2649
3027
  * If the payment was expired, the function passed as parameter will be called.
2650
3028
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2651
3029
  *
2652
3030
  * @example
2653
- * widget.onPaymentInReview((data) => {
2654
- * console.log('Payment in fraud review');
3031
+ * widget.onPaymentExpired((data) => {
3032
+ * console.log('Payment session expired');
2655
3033
  * });
2656
3034
  */
2657
- onPaymentExpired(handler: (data: IEventData$1) => void): () => void;
3035
+ onPaymentExpired<T extends IEventData$1 = CheckoutPaymentExpiredPayload>(handler: (data: T) => void): () => void;
2658
3036
  createWidgetStructure(): void;
2659
3037
  private changeLoadingSpinnerVisibility;
2660
3038
  }
@@ -3734,6 +4112,18 @@ declare abstract class OpenWalletService implements IOpenWalletProvider {
3734
4112
  * @param meta - The updated metadata.
3735
4113
  */
3736
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;
3737
4127
  /**
3738
4128
  * Creates a One-Time Token (OTT) by sending the payment data to the API.
3739
4129
  * Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
@@ -3793,6 +4183,7 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
3793
4183
  protected meta: TMeta;
3794
4184
  protected eventEmitter: EventEmitter;
3795
4185
  protected walletService: OpenWalletService | undefined;
4186
+ protected isDisabled: boolean;
3796
4187
  private onShippingOptionsChangeHandlerRegistered;
3797
4188
  /** @private */
3798
4189
  abstract readonly walletType: WalletType;
@@ -3849,6 +4240,42 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
3849
4240
  * button.load();
3850
4241
  */
3851
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;
3852
4279
  /**
3853
4280
  * Current method can change environment. By default environment = sandbox.
3854
4281
  * Also we can change domain alias for this environment. By default domain_alias = paydock.com
@@ -4628,13 +5055,53 @@ declare global {
4628
5055
  ApplePaySession: ApplePaySession;
4629
5056
  }
4630
5057
  }
5058
+ /** Styling configuration for the Apple Pay button. */
4631
5059
  interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
5060
+ /** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`, `'check-out'`). */
4632
5061
  button_type?: ApplePayButtonType$1;
5062
+ /** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
4633
5063
  button_style?: ApplePayButtonStyle$1;
4634
5064
  }
4635
- 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'`). */
4636
5079
  amount_label: string;
5080
+ /** Merchant's store name displayed during payment authorization. */
4637
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[];
4638
5105
  /** Whether shipping address collection is required. */
4639
5106
  request_shipping?: boolean;
4640
5107
  /**
@@ -4643,8 +5110,14 @@ interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest
4643
5110
  * Requires `request_shipping` to be `true`.
4644
5111
  */
4645
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']`. */
4646
5114
  show_billing_address?: boolean;
5115
+ /** Visual styling for the Apple Pay button. */
4647
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
+ */
4648
5121
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
4649
5122
  }
4650
5123
 
@@ -4722,15 +5195,27 @@ type GooglePayButtonType = 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'p
4722
5195
  type GooglePayAuthMethod = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';
4723
5196
  type GooglePayCardNetwork = 'AMEX' | 'DISCOVER' | 'ELECTRON' | 'ELO' | 'ELO_DEBIT' | 'INTERAC' | 'JCB' | 'MAESTRO' | 'MASTERCARD' | 'VISA';
4724
5197
  type BillingAddressFormat = 'MIN' | 'FULL';
5198
+ /**
5199
+ * Styling configuration for the Google Pay button.
5200
+ */
4725
5201
  interface GooglePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
5202
+ /** Variant displayed on the button (e.g. `'pay'`, `'buy'`, `'checkout'`). */
4726
5203
  button_type?: GooglePayButtonType;
5204
+ /** Sizing strategy: `'static'` keeps the intrinsic size; `'fill'` stretches to the container. */
4727
5205
  button_size_mode?: GooglePayButtonSizeMode;
5206
+ /** Color scheme: `'default'`, `'black'`, or `'white'`. */
4728
5207
  button_color?: GooglePayButtonColor;
4729
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
+ */
4730
5213
  interface GooglePayOpenWalletMeta extends OpenWalletMeta {
5214
+ /** Display name shown in the Google Pay sheet (e.g. `'Demo Store'`). */
4731
5215
  merchant_name?: string;
4732
5216
  /** Whether shipping address collection is required. */
4733
5217
  request_shipping?: boolean;
5218
+ /** Whether to surface billing address fields in the sheet. */
4734
5219
  show_billing_address?: boolean;
4735
5220
  /**
4736
5221
  * Available shipping options to display in the payment sheet.
@@ -4738,38 +5223,72 @@ interface GooglePayOpenWalletMeta extends OpenWalletMeta {
4738
5223
  * Requires `request_shipping` to be `true`.
4739
5224
  */
4740
5225
  shipping_options?: IGooglePayShippingOption[];
5226
+ /** Label shown next to the total amount in the sheet (e.g. `'TOTAL'`). */
4741
5227
  amount_label?: string;
5228
+ /** Visual styling for the button. */
4742
5229
  style?: GooglePayOpenWalletMetaStyles;
5230
+ /** Override the default card configuration (auth methods, allowed networks, tokenization). */
4743
5231
  card_config?: GooglePayCardConfig;
4744
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
+ */
4745
5239
  interface GooglePayCardConfig {
5240
+ /** Payment method type Google Pay should display. `'CARD'` for card payments, `'PAYPAL'` for PayPal-via-Google Pay. */
4746
5241
  type: 'CARD' | 'PAYPAL';
5242
+ /** Method-specific parameters that filter the cards Google Pay will offer. */
4747
5243
  parameters: {
5244
+ /** Allowed authentication methods. `'PAN_ONLY'` for FPAN (server-side decryption); `'CRYPTOGRAM_3DS'` for DPAN (device tokens). */
4748
5245
  allowed_auth_methods: GooglePayAuthMethod[];
5246
+ /** Card networks the merchant accepts. */
4749
5247
  allowed_card_networks: GooglePayCardNetwork[];
5248
+ /** Whether prepaid cards are allowed. Defaults to Google Pay's default. */
4750
5249
  allow_prepaid_cards?: boolean;
5250
+ /** Whether credit cards are allowed. Defaults to Google Pay's default. */
4751
5251
  allow_credit_cards?: boolean;
5252
+ /** Request `assuranceDetails` in the payment response (gives risk-signal hints from Google). */
4752
5253
  assurance_details_required?: boolean;
5254
+ /** Whether the billing address must be collected. */
4753
5255
  billing_address_required?: boolean;
5256
+ /** Billing address collection options. Only honored when `billing_address_required` is `true`. */
4754
5257
  billing_address_parameters?: {
5258
+ /** Format of the collected billing address: `'MIN'` (minimal) or `'FULL'`. */
4755
5259
  format: BillingAddressFormat;
5260
+ /** Whether to also collect the phone number. */
4756
5261
  phone_number_required?: boolean;
4757
5262
  };
5263
+ /** Per-network parameters such as acquirer routing hints. */
4758
5264
  card_network_parameters?: {
5265
+ /** The card network this entry applies to. */
4759
5266
  card_network: GooglePayCardNetwork;
5267
+ /** Acquirer BIN — used by the gateway to route the transaction. */
4760
5268
  acquirer_bin?: string;
5269
+ /** Acquirer-assigned merchant identifier. */
4761
5270
  acquirer_merchant_id?: string;
4762
5271
  }[];
4763
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
+ */
4764
5277
  tokenization_specification?: {
5278
+ /** Standard payment-gateway tokenization. */
4765
5279
  type: 'PAYMENT_GATEWAY';
5280
+ /** Gateway-specific tokenization parameters (e.g. `gateway`, `gatewayMerchantId`). */
4766
5281
  parameters: {
4767
5282
  [key: string]: string;
4768
5283
  };
4769
5284
  } | {
5285
+ /** Direct integration where Google encrypts the payload with the merchant's public key. */
4770
5286
  type: 'DIRECT';
5287
+ /** Direct-tokenization parameters required by Google's payload encryption. */
4771
5288
  parameters: {
5289
+ /** Protocol version expected by the merchant (currently `'ECv2'`). */
4772
5290
  protocol_version: string;
5291
+ /** Merchant's public key used to encrypt the payload. */
4773
5292
  public_key: string;
4774
5293
  };
4775
5294
  };
@@ -5382,48 +5901,102 @@ declare enum EventEnum {
5382
5901
  ON_WALLET_LOADED = "onWalletLoaded"
5383
5902
  }
5384
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
+ */
5385
5911
  interface IWalletPaymentSuccessful {
5912
+ /** Charge identifier returned by the backend. */
5386
5913
  id: string;
5914
+ /** Final charge amount as a number. */
5387
5915
  amount: number;
5916
+ /** ISO 4217 currency code of the charge. */
5388
5917
  currency: string;
5918
+ /** Backend charge status (e.g. `'complete'`, `'pending'`). */
5389
5919
  status: string;
5920
+ /** Payer's full name if collected by the wallet. */
5390
5921
  payer_name?: string;
5922
+ /** Payer's email if collected by the wallet. */
5391
5923
  payer_email?: string;
5924
+ /** Payer's phone number if collected by the wallet. */
5392
5925
  payer_phone?: string;
5393
5926
  }
5927
+ /**
5928
+ * Payload of the `unavailable` event emitted by `WalletButtons`.
5929
+ * Identifies which wallet became unavailable when more than one is configured.
5930
+ */
5394
5931
  interface IWalletUnavailable {
5932
+ /** The wallet type that is unavailable. Absent when the unavailability is generic. */
5395
5933
  wallet?: WALLET_TYPE;
5396
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
+ */
5397
5940
  interface IWalletOnClick {
5941
+ /** Attach the result of an async operation to control the wallet flow. Resolving with `false` aborts; `void`/`true` continues. */
5398
5942
  attachResult: (result: Promise<void> | boolean) => void;
5399
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
+ */
5400
5949
  interface IWalletUpdate {
5950
+ /** Response code from the wallet provider (provider-specific). */
5401
5951
  wallet_response_code?: string;
5952
+ /** Wallet provider's order identifier for this transaction. */
5402
5953
  wallet_order_id?: string;
5954
+ /** Wallet provider's session identifier for this interaction. */
5403
5955
  wallet_session_id?: string;
5956
+ /** Payment source details captured from the wallet. */
5404
5957
  payment_source?: {
5958
+ /** Wallet's internal payment method identifier. */
5405
5959
  wallet_payment_method_id?: string;
5960
+ /** Last 4 digits of the card. */
5406
5961
  card_number_last4?: string;
5962
+ /** Card network/scheme (e.g. `'visa'`, `'mastercard'`). */
5407
5963
  card_scheme?: string;
5408
5964
  };
5965
+ /** Loyalty account details if the wallet provider supports loyalty. */
5409
5966
  wallet_loyalty_account?: {
5967
+ /** Loyalty account identifier. */
5410
5968
  id?: string;
5969
+ /** Loyalty account barcode. */
5411
5970
  barcode?: string;
5412
5971
  };
5972
+ /** Shipping address selected in the wallet sheet. */
5413
5973
  shipping?: {
5974
+ /** Street address line 1. */
5414
5975
  address_line1?: string;
5976
+ /** Street address line 2. */
5415
5977
  address_line2?: string;
5978
+ /** Postal/ZIP code. */
5416
5979
  address_postcode?: string;
5980
+ /** City. */
5417
5981
  address_city?: string;
5982
+ /** State or administrative area. */
5418
5983
  address_state?: string;
5984
+ /** ISO 3166 country code. */
5419
5985
  address_country?: string;
5986
+ /** Company name on the address. */
5420
5987
  address_company?: string;
5988
+ /** Post office box number. */
5421
5989
  post_office_box_number?: string;
5990
+ /** Wallet provider's identifier for this saved address. */
5422
5991
  wallet_address_id?: string;
5992
+ /** Display name for this saved address (e.g. `'Home'`). */
5423
5993
  wallet_address_name?: string;
5994
+ /** ISO 8601 timestamp of when the address was saved. */
5424
5995
  wallet_address_created_timestamp?: string;
5996
+ /** ISO 8601 timestamp of the last update to the address. */
5425
5997
  wallet_address_updated_timestamp?: string;
5426
5998
  };
5999
+ /** The shipping option the user selected in the wallet sheet. */
5427
6000
  selected_shipping_option?: IShippingOption;
5428
6001
  }
5429
6002
 
@@ -5799,8 +6372,15 @@ declare enum EVENT {
5799
6372
  ON_SHIPPING_OPTIONS_CHANGE = "onShippingOptionsChange"
5800
6373
  }
5801
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
+ */
5802
6380
  interface BaseWalletMeta {
6381
+ /** The payment amount as a number (e.g. `19.99`). */
5803
6382
  amount: number;
6383
+ /** The ISO 4217 currency code (e.g. `'AUD'`, `'USD'`). */
5804
6384
  currency: string;
5805
6385
  }
5806
6386
 
@@ -6267,20 +6847,43 @@ interface IApplePayShippingOption {
6267
6847
  amount?: string;
6268
6848
  }
6269
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
+ */
6270
6857
  interface ApplePayWalletMeta extends BaseWalletMeta {
6858
+ /** Label shown next to the total in the Apple Pay sheet (e.g. `'TOTAL'`). */
6271
6859
  amount_label: string;
6860
+ /** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). Required by Apple Pay. */
6272
6861
  country: string;
6862
+ /** Payment capabilities the merchant supports. Must include at least `'supports3DS'`. */
6273
6863
  merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
6864
+ /** Card networks the merchant accepts. */
6274
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'`. */
6275
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. */
6276
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
+ */
6277
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. */
6278
6876
  supported_countries?: string[];
6877
+ /** Visual styling for the Apple Pay button. */
6279
6878
  style?: {
6879
+ /** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`). */
6280
6880
  button_type?: ApplePayButtonType;
6881
+ /** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
6281
6882
  button_style?: ApplePayButtonStyle;
6282
6883
  };
6884
+ /** Pre-filled shipping data to seed the Apple Pay sheet. */
6283
6885
  shipping?: AppleShippingType;
6886
+ /** Whether the user can edit the shipping address: `'available'` allows editing; `'store_pickup'` locks it. */
6284
6887
  shipping_editing_mode?: ContactShippingEditingMode;
6285
6888
  }
6286
6889
 
@@ -6341,32 +6944,63 @@ declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalle
6341
6944
  private isUnsuportedBrowser;
6342
6945
  }
6343
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
+ */
6344
6954
  interface PaypalWalletMeta extends BaseWalletMeta {
6955
+ /** Enable PayPal's Pay Later (Pay in 4) option. Defaults to `false`. */
6345
6956
  pay_later?: boolean;
6957
+ /** Hide the Pay Later messaging copy under the button. Defaults to `false`. */
6346
6958
  hide_message?: boolean;
6959
+ /** Render the standalone PayPal button instead of the smart button group. Defaults to `false`. */
6347
6960
  standalone?: boolean;
6961
+ /** Capture the transaction immediately (`true`) or authorize for later capture (`false`). Defaults to `false`. */
6348
6962
  capture?: boolean;
6963
+ /** Visual styling for the PayPal button. Mirrors PayPal's smart button style schema. */
6349
6964
  style?: {
6965
+ /** Button layout orientation. */
6350
6966
  layout?: 'vertical' | 'horizontal';
6967
+ /** Button color theme. */
6351
6968
  color?: 'gold' | 'blue' | 'silver' | 'black' | 'white';
6969
+ /** Button shape. */
6352
6970
  shape?: 'rect' | 'pill' | 'sharp';
6971
+ /** Custom border radius in pixels. Overrides `shape` corner roundness. */
6353
6972
  borderRadius?: number;
6973
+ /** Button height in pixels. */
6354
6974
  height?: number;
6975
+ /** When `true`, removes PayPal's default max-width constraint on the button. */
6355
6976
  disableMaxWidth?: boolean;
6977
+ /** Label text displayed on the button. */
6356
6978
  label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment';
6979
+ /** Whether to show the tagline beneath the button. */
6357
6980
  tagline?: boolean;
6981
+ /** Pay Later messaging configuration shown alongside the button. */
6358
6982
  messages?: {
6983
+ /** Layout type for the messaging block. */
6359
6984
  layout?: 'text' | 'flex';
6985
+ /** PayPal logo configuration in the messaging block. */
6360
6986
  logo?: {
6987
+ /** Logo variant. `'none'` removes the logo entirely. */
6361
6988
  type?: 'primary' | 'alternative' | 'inline' | 'none';
6989
+ /** Logo position relative to the message text. */
6362
6990
  position?: 'left' | 'right' | 'top';
6363
6991
  };
6992
+ /** Message text styling. */
6364
6993
  text?: {
6994
+ /** Text color. */
6365
6995
  color?: 'black' | 'white' | 'monochrome' | 'grayscale';
6996
+ /** Font size in pixels (10-16). */
6366
6997
  size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
6998
+ /** Horizontal alignment. */
6367
6999
  align?: 'left' | 'center' | 'right';
6368
7000
  };
7001
+ /** Background color of the messaging block (used when `layout` is `'flex'`). */
6369
7002
  color?: 'blue' | 'black' | 'white' | 'white-no-border' | 'gray' | 'monochrome' | 'grayscale';
7003
+ /** Aspect ratio of the messaging block. */
6370
7004
  ratio?: '1x1' | '1x4' | '8x1' | '20x1';
6371
7005
  };
6372
7006
  };
@@ -6597,7 +7231,8 @@ declare global {
6597
7231
  ExternalCheckoutBuilder: typeof Builder$1;
6598
7232
  ExternalCheckoutChecker: typeof Checker;
6599
7233
  PaymentSourceBuilder: typeof Builder;
6600
- Canvas3DS: typeof Canvas3ds;
7234
+ Canvas3ds: typeof Canvas3ds;
7235
+ Checkout: typeof Checkout;
6601
7236
  MultiWidget: typeof MultiWidget;
6602
7237
  HtmlMultiWidget: typeof HtmlMultiWidget;
6603
7238
  HtmlWidget: typeof HtmlWidget;
@@ -6608,5 +7243,5 @@ declare global {
6608
7243
  }
6609
7244
  }
6610
7245
 
6611
- export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, CheckoutActionCode, ClickToPay, Configuration, ContactShippingEditingMode, 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, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
6612
- export type { ApplePayButtonStyle, ApplePayButtonType, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, 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, PaypalWalletMeta, 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 };
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 };