@movmo/express-checkout-button 2.0.1 → 2.0.3

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.
package/README.md CHANGED
@@ -136,6 +136,7 @@ export default MyBookingPage;
136
136
  | Step | What happens |
137
137
  | ---- | ------------ |
138
138
  | Click | The button saves the offer (if you passed `flightOffer`), stores a one-time `state` nonce in `sessionStorage['movmo:checkout:pending']`, then runs `location.assign('https://flights.movmo.io/booking?offerId=…&returnUrl=…&state=…')`. No `/movmo/checkout` route and no `frame-src` CSP entry are needed. |
139
+ | Pending | From the click until the Movmo page loads, the button is disabled and shows a spinner with "Opening Movmo…"; it resets if the offer save fails, the offer is missing, or the traveler returns with Back. |
139
140
  | Return | Movmo navigates to your `returnUrl` with `movmo_exit` (`search_again`, `offer_unavailable`, `booking_confirmed`), `movmo_state` (echo of your nonce) and, when booked, `movmo_booking_id`. The airline PNR is in the URL **fragment** only: `#movmo_pnr=ABC123`, or inside your hash route (`#/checkout?movmo_pnr=ABC123`, `#/r?a=1&movmo_pnr=ABC123`). |
140
141
  | Consume | On mount the button reads those params. If `movmo_state` matches the stored nonce it calls `onBookingComplete` (confirmed bookings only), then `onExit`, and clears the nonce. A mismatch or missing nonce logs a warning and calls nothing. Only this SDK's own params (`movmo_exit`, `movmo_state`, `movmo_booking_id` in the query, `movmo_pnr` in the hash) are removed from the address bar with `history.replaceState` on every call (also when there is no return, for leftovers); everything else, including `@movmo/connect-button`'s `movmo_signed_out` and `movmo_logout_state`, and your own query and hash, stays byte for byte. A pending record is single-use and expires after 24 hours. With two buttons on one page, the return is held for the button whose airline, provider and offer match the click, and the URL is scrubbed immediately. |
141
142
 
@@ -265,7 +266,7 @@ test pages; it is sticky per tab and entirely fail-open.
265
266
 
266
267
  `MovmoCheckoutButton` self-instruments the partner-page funnel — from the button rendering on
267
268
  the airline page through the redirect to Movmo and the return — using
268
- `@movmo_app/analytics` in **scoped mode**. Scoped mode disables every document-level listener
269
+ Movmo's bundled analytics SDK in **scoped mode**. Scoped mode disables every document-level listener
269
270
  the SDK would otherwise install (click/rage-click/hover/scroll/field/section autocapture);
270
271
  the button only ever attaches listeners to its own DOM node. It never observes the partner's
271
272
  page, reads partner form fields, or inspects anything outside that element. The airline
@@ -3,5 +3,4 @@ export { MovmoCheckoutButton } from './MovmoCheckoutButton';
3
3
  export type { MovmoCheckoutButtonProps, MovmoCheckoutError } from './MovmoCheckoutButton';
4
4
  export type { SaveOfferResult } from './api';
5
5
  export { consumeMovmoCheckoutReturn } from './returnHandler';
6
- export type { MovmoBookingCompleteInfo, MovmoCheckoutExitInfo, MovmoCheckoutReturnOptions, } from './returnHandler';
7
- export type { MovmoExitReason } from '@movmo_app/types';
6
+ export type { MovmoBookingCompleteInfo, MovmoCheckoutExitInfo, MovmoCheckoutReturnOptions, MovmoExitReason, } from './returnHandler';
@@ -1,4 +1,3 @@
1
- import type { MovmoExitReason } from '@movmo_app/types';
2
1
  /** Passed to the airline's onExit callback when the traveler returns from Movmo. */
3
2
  export interface MovmoCheckoutExitInfo {
4
3
  reason: MovmoExitReason;
@@ -30,6 +29,9 @@ export interface MovmoCheckoutReturnOptions {
30
29
  onExit?: (info: MovmoCheckoutExitInfo) => void;
31
30
  onBookingComplete?: (info: MovmoBookingCompleteInfo) => void;
32
31
  }
32
+ /** Why the checkout handed control back to the airline page (`onExit`). */
33
+ declare const REASONS: readonly ["search_again", "offer_unavailable", "booking_confirmed"];
34
+ export type MovmoExitReason = (typeof REASONS)[number];
33
35
  /** @internal Test hook: forget any parsed or claimed return. Not exported from the package entry. */
34
36
  export declare function __resetForTests(): void;
35
37
  /**
@@ -46,3 +48,4 @@ export declare function __resetForTests(): void;
46
48
  * it as early as possible, before analytics or session-replay scripts read the URL.
47
49
  */
48
50
  export declare function consumeMovmoCheckoutReturn(options?: MovmoCheckoutReturnOptions): boolean;
51
+ export {};
@@ -1,5 +1,3 @@
1
- import { EVENTS } from '@movmo_app/analytics';
2
- export { EVENTS };
3
1
  /**
4
2
  * Scoped-mode analytics for the partner page (MOVMO-464). Autocapture stays OFF —
5
3
  * we never observe the partner's DOM or inputs; listeners attach only to