@movmo/express-checkout-button 1.9.0 → 1.10.1

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.
@@ -9,14 +9,17 @@ export interface MovmoCheckoutButtonProps {
9
9
  isProd?: boolean;
10
10
  className?: string;
11
11
  /**
12
- * Fires when the traveler exits the Movmo checkout from inside the overlay
13
- * (e.g. "Return to airline" on a dead-end screen, or a non-retryable
14
- * booking failure), after the overlay is removed and the page URL is
15
- * restored to where the checkout was opened. Use it to route the traveler
16
- * onward (e.g. back to your search results) or record analytics; without
17
- * it the traveler is simply returned to the page they clicked the button
18
- * on. Not invoked for browser-back closes, and it does not survive a page
19
- * refresh inside the checkout.
12
+ * Fires when the traveler exits the Movmo checkout from inside the overlay,
13
+ * after the overlay is removed and the page URL is restored to where the
14
+ * checkout was opened. `info.reason` says why: 'booking_confirmed' — the
15
+ * traveler booked successfully and clicked "Return to {airline}" on the
16
+ * confirmation; 'offer_unavailable' — a dead-end screen's exit;
17
+ * 'search_again' — a non-retryable booking failure. Use it to route the
18
+ * traveler onward (e.g. a post-booking landing for 'booking_confirmed',
19
+ * search results otherwise) or record analytics; without it the traveler
20
+ * is simply returned to the page they clicked the button on. Not invoked
21
+ * for browser-back closes, and it does not survive a page refresh inside
22
+ * the checkout.
20
23
  */
21
24
  onExit?: (info: MovmoCheckoutExitInfo) => void;
22
25
  }
@@ -14,5 +14,17 @@ export interface MovmoCheckoutOverlayOptions {
14
14
  * re-hydrated overlay falls back to the default close behavior.
15
15
  */
16
16
  onExit?: (info: MovmoCheckoutExitInfo) => void;
17
+ /**
18
+ * The partner page's URL + history.state captured by the button IMMEDIATELY
19
+ * before it pushed the /movmo/checkout entry. An iframe-initiated exit
20
+ * restores the page by replaceState-ing back to this entry instead of
21
+ * traversing — see closeOverlay for why history.back() can't be trusted.
22
+ * Absent on refresh-rehydrated overlays (nothing was captured), which fall
23
+ * back to a back() traversal.
24
+ */
25
+ returnTo?: {
26
+ url: string;
27
+ state: unknown;
28
+ };
17
29
  }
18
30
  export declare function showMovmoOverlay(queryParams: string, isProd?: boolean, options?: MovmoCheckoutOverlayOptions): void;