@paydock/client-sdk 1.145.0-beta → 1.147.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +129 -1
  2. package/bundles/index.cjs +746 -102
  3. package/bundles/index.cjs.d.ts +131 -14
  4. package/bundles/index.mjs +746 -103
  5. package/bundles/index.mjs.d.ts +131 -14
  6. package/bundles/types/api/api-base.d.ts +6 -0
  7. package/bundles/types/api/api-base.d.ts.map +1 -1
  8. package/bundles/types/api/api-charge-internal.d.ts +1 -5
  9. package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
  10. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts +50 -0
  11. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts.map +1 -1
  12. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +7 -5
  13. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  14. package/bundles/types/canvas-3ds/index.d.ts +1 -1
  15. package/bundles/types/canvas-3ds/index.d.ts.map +1 -1
  16. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +117 -2
  17. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
  18. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +6 -0
  19. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -1
  20. package/bundles/types/components/iframe-event.d.ts +4 -3
  21. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  22. package/bundles/types/components/iframe.d.ts +5 -0
  23. package/bundles/types/components/iframe.d.ts.map +1 -1
  24. package/bundles/types/components/param.d.ts +19 -0
  25. package/bundles/types/components/param.d.ts.map +1 -1
  26. package/bundles/types/index-cba.d.ts +1 -1
  27. package/bundles/types/index-cba.d.ts.map +1 -1
  28. package/bundles/types/index.d.ts +2 -2
  29. package/bundles/types/index.d.ts.map +1 -1
  30. package/bundles/types/widget/multi-widget.d.ts +19 -0
  31. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  32. package/bundles/widget.umd.js +746 -102
  33. package/bundles/widget.umd.js.d.ts +131 -14
  34. package/bundles/widget.umd.js.min.d.ts +131 -14
  35. package/bundles/widget.umd.min.js +1 -1
  36. package/docs/api-canvas3ds.md +10 -8
  37. package/docs/api-checkout-button.md +15 -0
  38. package/docs/api-ps-widget.md +15 -0
  39. package/docs/api-widget.md +15 -0
  40. package/docs/canvas3ds-examples.md +43 -1
  41. package/docs/widget-examples.md +41 -0
  42. package/package.json +15 -9
  43. package/slate.md +84 -1
@@ -259,6 +259,24 @@ declare const SUPPORTED_CARD_TYPES: {
259
259
  EFTPOS_WHITE: string;
260
260
  UNIONPAY: string;
261
261
  };
262
+ /**
263
+ * Card schemes the widget is able to resolve from a card number, and therefore the only values
264
+ * `setAllowedCardSchemes` accepts. This is a separate vocabulary from SUPPORTED_CARD_TYPES, which drives the
265
+ * card icons: it omits the icon-only variants `visa_white` / `eftpos_white`, and the `laser` / `maestro`
266
+ * identifiers the widget can never resolve — allowing those would be configuration that can never match.
267
+ */
268
+ declare const CARD_SCHEME: {
269
+ AMEX: string;
270
+ AUSBC: string;
271
+ DINERS: string;
272
+ DISCOVER: string;
273
+ EFTPOS: string;
274
+ JAPCB: string;
275
+ MASTERCARD: string;
276
+ SOLO: string;
277
+ UNIONPAY: string;
278
+ VISA: string;
279
+ };
262
280
  interface IIcons {
263
281
  paypal_checkout_button?: string;
264
282
  afterpay_checkout_button?: string;
@@ -362,6 +380,7 @@ interface IParams extends IStyles$1, ITexts, ICommonParams {
362
380
  ref_id?: string;
363
381
  supported_card_types?: string;
364
382
  validate_card_types?: boolean;
383
+ allowed_card_schemes?: string;
365
384
  fields_validation?: boolean;
366
385
  hidden_elements?: string;
367
386
  icons?: string;
@@ -767,10 +786,15 @@ declare class Configuration {
767
786
  declare class IFrame {
768
787
  protected container: Container;
769
788
  constructor(container: Container);
789
+ /**
790
+ * @param options.onLoad Called on every `load` of the iframe (initial document and each
791
+ * subsequent navigation). Attached before `src` is set so a fast load is never missed.
792
+ */
770
793
  load(link: string, options?: {
771
794
  title?: string;
772
795
  attributes?: Record<string, string>;
773
796
  styles?: Record<string, string>;
797
+ onLoad?: (event: Event) => void;
774
798
  }, iframeClass?: string): void;
775
799
  loadFromHtml(content: string, options?: {
776
800
  title?: string;
@@ -842,15 +866,16 @@ declare const EVENT$3: {
842
866
  type EventTypes = typeof EVENT$3[keyof typeof EVENT$3];
843
867
  interface Listener {
844
868
  event: string;
845
- listener: (event: any) => void;
869
+ /** `origin` is the `MessageEvent.origin` of the postMessage that carried the data (undefined for direct `emit`). */
870
+ listener: (event: any, origin?: string) => void;
846
871
  widget_id: string;
847
872
  }
848
873
  declare type Listeners = Listener[];
849
874
  declare class IFrameEvent {
850
875
  protected listeners: Listeners;
851
876
  constructor(subject: Window | null);
852
- emit(data: IEventData$1): void;
853
- on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
877
+ emit(data: IEventData$1, origin?: string): void;
878
+ on<T>(eventName: string, widgetId: string, cb: (data: T, origin?: string) => void): void;
854
879
  clear(): void;
855
880
  private subscribe;
856
881
  }
@@ -1206,6 +1231,25 @@ declare class MultiWidget {
1206
1231
  * @param {boolean} validateCardNumberInput - [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types
1207
1232
  */
1208
1233
  setSupportedCardIcons(elements: string[], validateCardNumberInput?: boolean): void;
1234
+ /**
1235
+ * Current method restricts which card schemes the card number input accepts, without changing which card
1236
+ * icons the widget displays. Scheme identifiers are matched case-insensitively and ignoring surrounding
1237
+ * whitespace; unsupported identifiers are ignored with a warning, so a list in which every identifier is
1238
+ * unsupported applies no restriction at all.
1239
+ *
1240
+ * Takes precedence over setSupportedCardIcons: when a non-empty list is supplied here, it is the only list
1241
+ * used for validation and the validateCardNumberInput flag of setSupportedCardIcons no longer affects it.
1242
+ * Calling this method more than once replaces the previous list rather than merging with it.
1243
+ *
1244
+ * Must be called before load().
1245
+ *
1246
+ * @example
1247
+ *
1248
+ * widget.setAllowedCardSchemes(['visa', 'mastercard']);
1249
+ *
1250
+ * @param {string[]} schemes - [CARD_SCHEME]{@link CARD_SCHEME}
1251
+ */
1252
+ setAllowedCardSchemes(schemes: string[]): void;
1209
1253
  /**
1210
1254
  * Current method can hide prevent the widget from showing the error messages
1211
1255
  *
@@ -2171,6 +2215,12 @@ declare class ApiBase {
2171
2215
  * @param {string} [alias] - Own domain alias
2172
2216
  */
2173
2217
  setEnv(env: string, alias?: string): ApiBase;
2218
+ /**
2219
+ * Origin (`scheme://host[:port]`) of the API this client talks to, for the current env/alias.
2220
+ * Used to validate the `origin` of postMessages the API itself sends to the page.
2221
+ */
2222
+ getApiOrigin(): string;
2223
+ static toOrigin(url: string): string;
2174
2224
  requestObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req): Observable<Res>;
2175
2225
  private makeRequest;
2176
2226
  private onRequestLoad;
@@ -2301,6 +2351,11 @@ declare class Standalone3dsService {
2301
2351
  load(token: string, options: {
2302
2352
  title: string;
2303
2353
  }): void;
2354
+ /**
2355
+ * Origins allowed to deliver a processed 3DS outcome to the page via postMessage: the Paydock API
2356
+ * (inline callback page) and the Paydock widget (remote-app landing page), for the current env/alias.
2357
+ */
2358
+ protected getTrustedMessageOrigins(api: ApiBase): string[];
2304
2359
  setEnv(env: string, alias?: string): void;
2305
2360
  }
2306
2361
 
@@ -2319,6 +2374,38 @@ interface Canvas3dsAuthPayload {
2319
2374
  description?: string;
2320
2375
  };
2321
2376
  }
2377
+ /**
2378
+ * Payload of `chargeAuthChallengeLoaded` (Standalone 3DS, challenge flow only).
2379
+ * Emitted exactly once per challenge, after `chargeAuthChallenge`.
2380
+ */
2381
+ interface Canvas3dsChallengeLoadedPayload {
2382
+ /** The Paydock 3DS charge identifier the challenge belongs to. */
2383
+ charge_3ds_id: string;
2384
+ /**
2385
+ * `'load'` — the challenge iframe fired its first `load`: the ACS page has painted.
2386
+ * `'timeout'` — no `load` arrived within the SDK's 2.5 s safety fallback; the event is emitted anyway so a
2387
+ * loader is never held forever (the page may still be loading and will paint on its own). Useful for
2388
+ * analytics (how often the fallback fires) — you do not need to handle the two differently.
2389
+ */
2390
+ reason: 'load' | 'timeout';
2391
+ }
2392
+ /**
2393
+ * Payload of `chargeAuthChallengeCompleted` (Standalone 3DS, challenge and decoupled flows).
2394
+ * Emitted at most once per authentication, after the shopper finished the challenge (or approved a decoupled
2395
+ * authentication) and always before the terminal event.
2396
+ */
2397
+ interface Canvas3dsChallengeCompletedPayload {
2398
+ /** The Paydock 3DS charge identifier the authentication belongs to. */
2399
+ charge_3ds_id: string;
2400
+ /**
2401
+ * How the SDK learned that the issuer delivered the result:
2402
+ * `'poll'` — the 3DS Server's result monitor reported it (the usual case: it flips as soon as the issuer's
2403
+ * result reaches the 3DS Server, before the challenge iframe has even left the bank's page);
2404
+ * `'callback'` — the callback message carrying the outcome arrived first (the terminal event follows
2405
+ * immediately). Informational only — handle both the same way.
2406
+ */
2407
+ source: 'poll' | 'callback';
2408
+ }
2322
2409
  /**
2323
2410
  * Payload emitted by the Standalone 3DS flow for error events.
2324
2411
  * `error` is intentionally `unknown` — upstream emitters do not guarantee a shape.
@@ -2371,6 +2458,24 @@ interface Canvas3dsEventMap {
2371
2458
  error: Canvas3dsErrorPayload | Canvas3dsErrorEventPayload;
2372
2459
  /** Challenge required — issuer demands user interaction (OTP, biometric, etc.). Standalone-only. */
2373
2460
  chargeAuthChallenge: Canvas3dsAuthPayload;
2461
+ /**
2462
+ * The challenge iframe has painted (first `load`), or the 2.5 s fallback elapsed — see `reason`. Standalone-only,
2463
+ * challenge flow only (never emitted for decoupled challenges). Fires once, after `chargeAuthChallenge`.
2464
+ *
2465
+ * Recommended loader pattern: show a loader before the charge POST, keep it through `chargeAuthChallenge`,
2466
+ * reveal the challenge on this event, cover it with "Completing verification" on `chargeAuthChallengeCompleted`,
2467
+ * and finish on `chargeAuthSuccess` / `chargeAuthReject` / `error`.
2468
+ */
2469
+ chargeAuthChallengeLoaded: Canvas3dsChallengeLoadedPayload;
2470
+ /**
2471
+ * The shopper finished the challenge (or approved a decoupled authentication): the issuer delivered the final
2472
+ * result to the 3DS Server and the SDK is obtaining the outcome. Cover the challenge iframe with your own
2473
+ * "Completing verification" state — whatever the bank or the 3DS Server render from here on is plumbing, not
2474
+ * UX. Standalone-only. Fires at most once per authentication, always before `chargeAuthSuccess` /
2475
+ * `chargeAuthReject` / `error`, and never after them. A wrong OTP or a further interactive step does NOT fire
2476
+ * it (no result has been delivered yet), so no grace timer or reveal fallback is needed on your side.
2477
+ */
2478
+ chargeAuthChallengeCompleted: Canvas3dsChallengeCompletedPayload;
2374
2479
  /** Decoupled authentication — issuer will authenticate out-of-band and notify later. Standalone-only. */
2375
2480
  chargeAuthDecoupled: Canvas3dsAuthPayload;
2376
2481
  /** Iframe-path authentication event. Extends `IEventData` with optional 3DS correlation fields (`charge_3ds_id`, `status`). */
@@ -2426,11 +2531,13 @@ declare enum TOKEN_FORMAT {
2426
2531
  * @const STANDALONE_3DS_EVENT
2427
2532
  *
2428
2533
  * @type {object}
2429
- * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
2430
- * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
2431
- * @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
2432
- * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
2433
- * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
2534
+ * @param {string} AUTH_SUCCESS=chargeAuthSuccess
2535
+ * @param {string} AUTH_ERROR=chargeAuthReject
2536
+ * @param {string} DECOUPLED=chargeAuthDecoupled
2537
+ * @param {string} CHALLENGE=chargeAuthChallenge
2538
+ * @param {string} CHALLENGE_LOADED=chargeAuthChallengeLoaded - challenge iframe painted (first `load`, or 2.5 s fallback); reveal your challenge UI here
2539
+ * @param {string} CHALLENGE_COMPLETED=chargeAuthChallengeCompleted - the shopper finished the challenge (issuer result delivered to the 3DS Server); cover the challenge iframe with your own loader until the terminal event
2540
+ * @param {string} INFO=chargeAuthInfo
2434
2541
  * @param {string} ERROR=error
2435
2542
  */
2436
2543
  /**
@@ -2559,7 +2666,6 @@ declare class ApiChargeInternal {
2559
2666
  constructor(api: ApiInternal);
2560
2667
  walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
2561
2668
  walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
2562
- standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
2563
2669
  standalone3dsHandle(): Promise<HandleResponseInterface>;
2564
2670
  }
2565
2671
  interface WalletCaptureResponse {
@@ -2600,9 +2706,6 @@ interface WalletCallbackResponse {
2600
2706
  callback_rel: string;
2601
2707
  callback_url: string;
2602
2708
  }
2603
- interface Standalone3dsProcessBody {
2604
- charge_3ds_id: string;
2605
- }
2606
2709
 
2607
2710
  declare class ApiCheckoutInternal {
2608
2711
  protected api: ApiInternal;
@@ -2885,6 +2988,20 @@ declare const CANVAS_3DS_EVENT: {
2885
2988
  readonly DECOUPLED: "chargeAuthDecoupled";
2886
2989
  /** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
2887
2990
  readonly CHALLENGE: "chargeAuthChallenge";
2991
+ /**
2992
+ * The challenge iframe fired its FIRST `load` after `chargeAuthChallenge` (the ACS page has painted),
2993
+ * or the `CHALLENGE_LOADED_FALLBACK_MS` safety fallback elapsed without one. Emitted exactly once per
2994
+ * challenge; never emitted for a decoupled challenge (no challenge iframe). Payload: `Canvas3dsChallengeLoadedPayload`.
2995
+ */
2996
+ readonly CHALLENGE_LOADED: "chargeAuthChallengeLoaded";
2997
+ /**
2998
+ * The issuer delivered the final authentication result to the 3DS Server (the shopper finished the
2999
+ * challenge, or approved a decoupled authentication) and the SDK is now obtaining the outcome. Emitted at
3000
+ * most once per authentication, always before the terminal event. Detected through the `secondary_url`
3001
+ * result monitor (`source: 'poll'`) or, when the callback message arrives first, right before the outcome
3002
+ * it carries (`source: 'callback'`). Payload: `Canvas3dsChallengeCompletedPayload`.
3003
+ */
3004
+ readonly CHALLENGE_COMPLETED: "chargeAuthChallengeCompleted";
2888
3005
  /** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
2889
3006
  readonly INFO: "chargeAuthInfo";
2890
3007
  /** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
@@ -7439,5 +7556,5 @@ declare global {
7439
7556
  }
7440
7557
  }
7441
7558
 
7442
- 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 };
7443
- export type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult, ApplePayButtonStyle, ApplePayButtonType, ApplePayCapabilityToken, ApplePayCredentialStatus, 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, GooglePayAvailabilityOptions, GooglePayAvailabilityResult, 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, OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult, 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 };
7559
+ export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CANVAS_3DS_EVENT, CARD_SCHEME, 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 };
7560
+ export type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult, ApplePayButtonStyle, ApplePayButtonType, ApplePayCapabilityToken, ApplePayCredentialStatus, ApplePayOpenWalletMeta, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, Canvas3dsAuthPayload, Canvas3dsChallengeCompletedPayload, Canvas3dsChallengeLoadedPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, CheckoutIntentTokenPayload, CheckoutPaymentExpiredPayload, CheckoutPaymentFailurePayload, CheckoutPaymentSuccessPayload, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, GooglePayAvailabilityOptions, GooglePayAvailabilityResult, 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, OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult, 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 };
@@ -22,6 +22,12 @@ export declare class ApiBase {
22
22
  * @param {string} [alias] - Own domain alias
23
23
  */
24
24
  setEnv(env: string, alias?: string): ApiBase;
25
+ /**
26
+ * Origin (`scheme://host[:port]`) of the API this client talks to, for the current env/alias.
27
+ * Used to validate the `origin` of postMessages the API itself sends to the page.
28
+ */
29
+ getApiOrigin(): string;
30
+ static toOrigin(url: string): string;
25
31
  requestObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req): Observable<Res>;
26
32
  private makeRequest;
27
33
  private onRequestLoad;
@@ -1 +1 @@
1
- {"version":3,"file":"api-base.d.ts","sourceRoot":"","sources":["../../src/api/api-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,MAAM,CAAC;AACnD,OAAO,EAAW,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,iDAAiD,CAAC;AAEzD,oBAAY,aAAa;IACvB,UAAU,IAAI;IACd,KAAK,IAAI;CACV;AAED,qBAAa,OAAO;IAClB,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IACnB,IAAI,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B,EAAE,KAAK,GAAG,MAAM,CAAC,EAClD,IAAI,EAAE,MAAM;IAoBd,IAAW,GAAG;;;;MAMb;CACF"}
@@ -1,12 +1,11 @@
1
1
  import type { ApiInternal } from './api-internal';
2
- import type { HandleResponseInterface, ProcessAuthenticationResponse } from './api-shared-types';
2
+ import type { HandleResponseInterface } from './api-shared-types';
3
3
  export type { HandleResponseInterface, ProcessAuthenticationResponse, } from './api-shared-types';
4
4
  export declare class ApiChargeInternal {
5
5
  protected api: ApiInternal;
6
6
  constructor(api: ApiInternal);
7
7
  walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
8
8
  walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
9
- standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
10
9
  standalone3dsHandle(): Promise<HandleResponseInterface>;
11
10
  }
12
11
  interface WalletCaptureResponse {
@@ -47,7 +46,4 @@ interface WalletCallbackResponse {
47
46
  callback_rel: string;
48
47
  callback_url: string;
49
48
  }
50
- interface Standalone3dsProcessBody {
51
- charge_3ds_id: string;
52
- }
53
49
  //# sourceMappingURL=api-charge-internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-charge-internal.d.ts","sourceRoot":"","sources":["../../src/api/api-charge-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAO5B,qBAAa,iBAAiB;IAChB,SAAS,CAAC,GAAG,EAAE,WAAW;gBAAhB,GAAG,EAAE,WAAW;IAEtC,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IASzE,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,C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M,CAAC;YACvB,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,cAAc,CAAC,EAAE,OAAO,CAAC;SAC1B,CAAC;KACH,CAAC;CACH;AAED,UAAU,kBAAkB;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,sBAAsB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -14,6 +14,38 @@ export interface Canvas3dsAuthPayload {
14
14
  description?: string;
15
15
  };
16
16
  }
17
+ /**
18
+ * Payload of `chargeAuthChallengeLoaded` (Standalone 3DS, challenge flow only).
19
+ * Emitted exactly once per challenge, after `chargeAuthChallenge`.
20
+ */
21
+ export interface Canvas3dsChallengeLoadedPayload {
22
+ /** The Paydock 3DS charge identifier the challenge belongs to. */
23
+ charge_3ds_id: string;
24
+ /**
25
+ * `'load'` — the challenge iframe fired its first `load`: the ACS page has painted.
26
+ * `'timeout'` — no `load` arrived within the SDK's 2.5 s safety fallback; the event is emitted anyway so a
27
+ * loader is never held forever (the page may still be loading and will paint on its own). Useful for
28
+ * analytics (how often the fallback fires) — you do not need to handle the two differently.
29
+ */
30
+ reason: 'load' | 'timeout';
31
+ }
32
+ /**
33
+ * Payload of `chargeAuthChallengeCompleted` (Standalone 3DS, challenge and decoupled flows).
34
+ * Emitted at most once per authentication, after the shopper finished the challenge (or approved a decoupled
35
+ * authentication) and always before the terminal event.
36
+ */
37
+ export interface Canvas3dsChallengeCompletedPayload {
38
+ /** The Paydock 3DS charge identifier the authentication belongs to. */
39
+ charge_3ds_id: string;
40
+ /**
41
+ * How the SDK learned that the issuer delivered the result:
42
+ * `'poll'` — the 3DS Server's result monitor reported it (the usual case: it flips as soon as the issuer's
43
+ * result reaches the 3DS Server, before the challenge iframe has even left the bank's page);
44
+ * `'callback'` — the callback message carrying the outcome arrived first (the terminal event follows
45
+ * immediately). Informational only — handle both the same way.
46
+ */
47
+ source: 'poll' | 'callback';
48
+ }
17
49
  /**
18
50
  * Payload emitted by the Standalone 3DS flow for error events.
19
51
  * `error` is intentionally `unknown` — upstream emitters do not guarantee a shape.
@@ -66,6 +98,24 @@ export interface Canvas3dsEventMap {
66
98
  error: Canvas3dsErrorPayload | Canvas3dsErrorEventPayload;
67
99
  /** Challenge required — issuer demands user interaction (OTP, biometric, etc.). Standalone-only. */
68
100
  chargeAuthChallenge: Canvas3dsAuthPayload;
101
+ /**
102
+ * The challenge iframe has painted (first `load`), or the 2.5 s fallback elapsed — see `reason`. Standalone-only,
103
+ * challenge flow only (never emitted for decoupled challenges). Fires once, after `chargeAuthChallenge`.
104
+ *
105
+ * Recommended loader pattern: show a loader before the charge POST, keep it through `chargeAuthChallenge`,
106
+ * reveal the challenge on this event, cover it with "Completing verification" on `chargeAuthChallengeCompleted`,
107
+ * and finish on `chargeAuthSuccess` / `chargeAuthReject` / `error`.
108
+ */
109
+ chargeAuthChallengeLoaded: Canvas3dsChallengeLoadedPayload;
110
+ /**
111
+ * The shopper finished the challenge (or approved a decoupled authentication): the issuer delivered the final
112
+ * result to the 3DS Server and the SDK is obtaining the outcome. Cover the challenge iframe with your own
113
+ * "Completing verification" state — whatever the bank or the 3DS Server render from here on is plumbing, not
114
+ * UX. Standalone-only. Fires at most once per authentication, always before `chargeAuthSuccess` /
115
+ * `chargeAuthReject` / `error`, and never after them. A wrong OTP or a further interactive step does NOT fire
116
+ * it (no result has been delivered yet), so no grace timer or reveal fallback is needed on your side.
117
+ */
118
+ chargeAuthChallengeCompleted: Canvas3dsChallengeCompletedPayload;
69
119
  /** Decoupled authentication — issuer will authenticate out-of-band and notify later. Standalone-only. */
70
120
  chargeAuthDecoupled: Canvas3dsAuthPayload;
71
121
  /** Iframe-path authentication event. Extends `IEventData` with optional 3DS correlation fields (`charge_3ds_id`, `status`). */
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-3ds-event-map.d.ts","sourceRoot":"","sources":["../../src/canvas-3ds/canvas-3ds-event-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,mIAAmI;IACnI,aAAa,EAAE,MAAM,CAAC;IACtB,sHAAsH;IACtH,MAAM,EAAE,MAAM,CAAC;IACf,yGAAyG;IACzG,MAAM,CAAC,EAAE;QACP,yEAAyE;QACzE,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,aAAa,EAAE,MAAM,CAAC;IACtB,8FAA8F;IAC9F,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,+BAAgC,SAAQ,UAAU;IACjE,qGAAqG;IACrG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,MAAM,CAAC,EAAE;QACP,yEAAyE;QACzE,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,UAAU;IAC5D,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,4LAA4L;IAC5L,iBAAiB,EAAE,oBAAoB,GAAG,+BAA+B,CAAC;IAC1E,8EAA8E;IAC9E,gBAAgB,EAAE,oBAAoB,GAAG,+BAA+B,CAAC;IACzE,yIAAyI;IACzI,KAAK,EAAE,qBAAqB,GAAG,0BAA0B,CAAC;IAC1D,oGAAoG;IACpG,mBAAmB,EAAE,oBAAoB,C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,oBAAoB;IAC/B,0FAA0F;;IAE1F,yEAAyE;;IAEzE,2HAA2H;;CAEnH,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAC9B,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC"}
@@ -34,11 +34,13 @@ declare enum TOKEN_FORMAT {
34
34
  * @const STANDALONE_3DS_EVENT
35
35
  *
36
36
  * @type {object}
37
- * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
38
- * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
39
- * @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
40
- * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
41
- * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
37
+ * @param {string} AUTH_SUCCESS=chargeAuthSuccess
38
+ * @param {string} AUTH_ERROR=chargeAuthReject
39
+ * @param {string} DECOUPLED=chargeAuthDecoupled
40
+ * @param {string} CHALLENGE=chargeAuthChallenge
41
+ * @param {string} CHALLENGE_LOADED=chargeAuthChallengeLoaded - challenge iframe painted (first `load`, or 2.5 s fallback); reveal your challenge UI here
42
+ * @param {string} CHALLENGE_COMPLETED=chargeAuthChallengeCompleted - the shopper finished the challenge (issuer result delivered to the 3DS Server); cover the challenge iframe with your own loader until the terminal event
43
+ * @param {string} INFO=chargeAuthInfo
42
44
  * @param {string} ERROR=error
43
45
  */
44
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-3ds.d.ts","sourceRoot":"","sources":["../../src/canvas-3ds/canvas-3ds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC1E,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AAC,CAAC,CAAC,CAAC;IAEzB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAC3D,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA4CjD;;;OAGG;IACI,IAAI,CAAC,QAAQ,EAAE,OAAO;IAI7B;;;OAGG;IACI,IAAI;IAIX;;;OAGG;IACI,MAAM;CAId;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { Canvas3ds } from './canvas-3ds';
2
- export type { Canvas3dsAuthPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, } from './canvas-3ds-event-map';
2
+ export type { Canvas3dsAuthPayload, Canvas3dsChallengeCompletedPayload, Canvas3dsChallengeLoadedPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, } from './canvas-3ds-event-map';
3
3
  export { Canvas3dsTokenFormat } from './canvas-3ds-event-map';
4
4
  export { CANVAS_3DS_EVENT } from './services/gpayments-service';
5
5
  export type { ITokenStandalone3DS } from './services/standalone3ds-service';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canvas-3ds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EACV,oBAAoB,EACpB,+BAA+B,EAC/B,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canvas-3ds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EACV,oBAAoB,EACpB,kCAAkC,EAClC,+BAA+B,EAC/B,+BAA+B,EAC/B,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -22,6 +22,20 @@ export declare const GPAYMENTS_EVENT: {
22
22
  readonly DECOUPLED: "chargeAuthDecoupled";
23
23
  /** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
24
24
  readonly CHALLENGE: "chargeAuthChallenge";
25
+ /**
26
+ * The challenge iframe fired its FIRST `load` after `chargeAuthChallenge` (the ACS page has painted),
27
+ * or the `CHALLENGE_LOADED_FALLBACK_MS` safety fallback elapsed without one. Emitted exactly once per
28
+ * challenge; never emitted for a decoupled challenge (no challenge iframe). Payload: `Canvas3dsChallengeLoadedPayload`.
29
+ */
30
+ readonly CHALLENGE_LOADED: "chargeAuthChallengeLoaded";
31
+ /**
32
+ * The issuer delivered the final authentication result to the 3DS Server (the shopper finished the
33
+ * challenge, or approved a decoupled authentication) and the SDK is now obtaining the outcome. Emitted at
34
+ * most once per authentication, always before the terminal event. Detected through the `secondary_url`
35
+ * result monitor (`source: 'poll'`) or, when the callback message arrives first, right before the outcome
36
+ * it carries (`source: 'callback'`). Payload: `Canvas3dsChallengeCompletedPayload`.
37
+ */
38
+ readonly CHALLENGE_COMPLETED: "chargeAuthChallengeCompleted";
25
39
  /** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
26
40
  readonly INFO: "chargeAuthInfo";
27
41
  /** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
@@ -41,32 +55,133 @@ export declare const CANVAS_3DS_EVENT: {
41
55
  readonly DECOUPLED: "chargeAuthDecoupled";
42
56
  /** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
43
57
  readonly CHALLENGE: "chargeAuthChallenge";
58
+ /**
59
+ * The challenge iframe fired its FIRST `load` after `chargeAuthChallenge` (the ACS page has painted),
60
+ * or the `CHALLENGE_LOADED_FALLBACK_MS` safety fallback elapsed without one. Emitted exactly once per
61
+ * challenge; never emitted for a decoupled challenge (no challenge iframe). Payload: `Canvas3dsChallengeLoadedPayload`.
62
+ */
63
+ readonly CHALLENGE_LOADED: "chargeAuthChallengeLoaded";
64
+ /**
65
+ * The issuer delivered the final authentication result to the 3DS Server (the shopper finished the
66
+ * challenge, or approved a decoupled authentication) and the SDK is now obtaining the outcome. Emitted at
67
+ * most once per authentication, always before the terminal event. Detected through the `secondary_url`
68
+ * result monitor (`source: 'poll'`) or, when the callback message arrives first, right before the outcome
69
+ * it carries (`source: 'callback'`). Payload: `Canvas3dsChallengeCompletedPayload`.
70
+ */
71
+ readonly CHALLENGE_COMPLETED: "chargeAuthChallengeCompleted";
44
72
  /** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
45
73
  readonly INFO: "chargeAuthInfo";
46
74
  /** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
47
75
  readonly ERROR: "error";
48
76
  };
77
+ /**
78
+ * Upper bound on how long `chargeAuthChallengeLoaded` waits for the challenge iframe's first `load`.
79
+ * When it elapses the event is emitted with `reason: 'timeout'` so a merchant loader is never held
80
+ * forever; the real `load` arriving afterwards is the paint and is simply ignored.
81
+ */
82
+ export declare const CHALLENGE_LOADED_FALLBACK_MS = 2500;
83
+ /**
84
+ * Interval of the `secondary_url` (GPayments `resultMonUrl`) poll while an ACS challenge is on screen.
85
+ * The monitor flips to `AuthResultReady` when the issuer's RReq reaches the 3DS Server — before the ACS has
86
+ * even returned its final page to the browser — so this poll is what makes `chargeAuthChallengeCompleted`
87
+ * land before the shopper sees any post-submit page. GPayments recommends 2 s and leaves the interval to the
88
+ * requestor; 1 s matches the cadence of GPayments' own monitoring frame.
89
+ */
90
+ export declare const CHALLENGE_RESULT_POLL_INTERVAL_MS = 1000;
91
+ /**
92
+ * Interval of the `secondary_url` poll for a decoupled challenge (shopper approves out-of-band, possibly
93
+ * minutes later; nothing to cover on screen) — the GPayments-recommended 2 s.
94
+ */
95
+ export declare const DECOUPLED_RESULT_POLL_INTERVAL_MS = 2000;
49
96
  export declare class GPaymentsService {
50
97
  protected container: Container;
51
98
  protected api: ApiInternal;
52
99
  protected eventEmitter: EventEmitter;
100
+ /** Origins allowed to deliver a processed outcome (`process_status`) via postMessage. */
101
+ protected trustedOrigins: string[];
53
102
  protected browserAndChallengeContainer: Container;
54
103
  protected iFrameAuthorization: IFrame;
55
104
  protected monitoringContainer: Container;
56
105
  protected iFrameSecondaryUrl?: IFrame;
57
106
  protected iFrameEvent: IFrameEvent;
58
107
  protected resultRead: boolean;
59
- constructor(container: Container, api: ApiInternal, eventEmitter: EventEmitter);
108
+ /** `chargeAuthChallengeLoaded` already emitted for the current challenge (by `load` or by the fallback). */
109
+ protected challengeLoadedEmitted: boolean;
110
+ /** `chargeAuthChallengeCompleted` already emitted for the current authentication (poll or callback). */
111
+ protected challengeCompletedEmitted: boolean;
112
+ /** Set once a terminal event was emitted: no lifecycle event may follow (reset when a new challenge starts). */
113
+ protected challengeLifecycleClosed: boolean;
114
+ protected challengeLoadedTimer: ReturnType<typeof setTimeout> | null;
115
+ protected resultPollTimer: ReturnType<typeof setTimeout> | null;
116
+ /** One-shot guard for the `chargeAuth` leg — the callback message may be delivered more than once. */
117
+ protected authHandled: boolean;
118
+ constructor(container: Container, api: ApiInternal, eventEmitter: EventEmitter,
119
+ /** Origins allowed to deliver a processed outcome (`process_status`) via postMessage. */
120
+ trustedOrigins?: string[]);
60
121
  load({ initialization_url, secondary_url, charge_3ds_id }: ITokenStandalone3DS, title: string): void;
61
122
  private initializeIFrames;
62
123
  private hideIframes;
63
124
  private setupIFrameEvents;
125
+ /**
126
+ * A message carries a processed outcome only when it has `process_status` AND comes from a trusted
127
+ * origin. Used by the result leg: an untrusted `process_status` is never acted upon — the SDK falls
128
+ * back to `GET /handle` (still needed for decoupled challenges / polling). The authentication leg
129
+ * ignores untrusted senders outright, before this check.
130
+ */
131
+ private hasChainedOutcome;
132
+ private isTrustedOrigin;
133
+ private removeIframes;
134
+ private clearChallengeLoadedTimer;
135
+ /**
136
+ * Challenge iframe lifecycle (`chargeAuthChallengeLoaded`).
137
+ *
138
+ * The challenge iframe is cross-origin, but its `load` event still fires when the ACS page finishes loading:
139
+ * the first one means the page painted (merchants can drop their loader). A fallback timer
140
+ * (`armChallengeLoadedFallback`) guarantees `chargeAuthChallengeLoaded` within `CHALLENGE_LOADED_FALLBACK_MS`
141
+ * even if no `load` ever fires; a late paint after that is simply ignored. Later `load`s are NOT a usable
142
+ * signal for "the shopper submitted": the post-submit hops are HTTP redirects and self-submitting pages whose
143
+ * loads abort, and the final callback page posts its message before its own `load` — so the post-submit
144
+ * moment is `chargeAuthChallengeCompleted`, driven by the `secondary_url` result monitor instead.
145
+ *
146
+ * Nothing is emitted once the flow reached a terminal outcome (`finishChallengeLifecycle`), and a
147
+ * decoupled challenge (no challenge iframe) never emits `chargeAuthChallengeLoaded`.
148
+ *
149
+ * Resets the per-challenge state and returns the `load` handler to attach to the challenge iframe.
150
+ */
151
+ private startChallengeLifecycle;
152
+ /**
153
+ * Arms the `chargeAuthChallengeLoaded` fallback — only when a challenge iframe actually exists (the
154
+ * container may be gone, or `IFrame.load` may have no-op'd on an already-present iframe).
155
+ */
156
+ private armChallengeLoadedFallback;
157
+ private emitChallengeLoaded;
158
+ /**
159
+ * `chargeAuthChallengeCompleted` — once per authentication, never after a terminal event. Idempotent so the
160
+ * poll and the callback message can both call it: the first transport to notice the issuer's result wins.
161
+ */
162
+ private emitChallengeCompleted;
163
+ /** Call before emitting any terminal event: no lifecycle event may follow it, and the result poll stops. */
164
+ private finishChallengeLifecycle;
165
+ private stopResultPolling;
64
166
  private parseResultData;
65
167
  private parseHandleResponse;
66
168
  private parseError;
67
169
  private processResult;
170
+ /** Final (post-challenge) outcome delivered by the API through the callback message. */
171
+ private handleResultOutcome;
68
172
  private externalAPI;
173
+ /**
174
+ * Polls the GPayments result monitor (`secondary_url`) until `AuthResultReady`. It is the primary source of
175
+ * `chargeAuthChallengeCompleted` (the monitor flips as soon as the issuer's RReq reaches the 3DS Server) and
176
+ * the fallback transport for the outcome itself (`GET /handle`) when the callback message never arrives —
177
+ * the only transport for decoupled challenges. Stops once an outcome was obtained or the lifecycle closed.
178
+ * Transport failures are retried on the same cadence; an unparsable body or an unknown event is fatal.
179
+ */
69
180
  private doPolling;
70
- private performAuthentication;
181
+ /**
182
+ * Branches on the authentication outcome delivered by the API through the callback message
183
+ * (`process_status` → `status`; same shape as the `/process` response body).
184
+ */
185
+ private handleAuthenticationOutcome;
71
186
  }
72
187
  //# sourceMappingURL=gpayments-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gpayments-service.d.ts","sourceRoot":"","sources":["../../../src/canvas-3ds/services/gpayments-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAS,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AASnE,oBAAY,6BAA6B;IACvC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAA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IAUvB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IAmCrB,wFAAwF;IACxF,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,WAAW;IAsBnB;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAyCjB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;CA8EpC"}
@@ -1,3 +1,4 @@
1
+ import { ApiBase } from '../../api/api-base';
1
2
  import type { Container } from '../../components/container';
2
3
  import type { EventEmitter } from '../../helper/event-emitter';
3
4
  /**
@@ -35,6 +36,11 @@ export declare class Standalone3dsService {
35
36
  load(token: string, options: {
36
37
  title: string;
37
38
  }): void;
39
+ /**
40
+ * Origins allowed to deliver a processed 3DS outcome to the page via postMessage: the Paydock API
41
+ * (inline callback page) and the Paydock widget (remote-app landing page), for the current env/alias.
42
+ */
43
+ protected getTrustedMessageOrigins(api: ApiBase): string[];
38
44
  setEnv(env: string, alias?: string): void;
39
45
  }
40
46
  //# sourceMappingURL=standalone3ds-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"standalone3ds-service.d.ts","sourceRoot":"","sources":["../../../src/canvas-3ds/services/standalone3ds-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAO/D;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iGAAiG;IACjG,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iIAAiI;IACjI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2HAA2H;IAC3H,aAAa,EAAE,MAAM,CAAC;IACtB,oIAAoI;IACpI,YAAY,EAAE,MAAM,CAAC;CACtB;AAED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