@movmo/express-checkout-button 1.0.4 → 1.1.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.
package/README.md CHANGED
@@ -16,7 +16,38 @@ yarn add @movmo/express-checkout-button
16
16
 
17
17
  ## Usage
18
18
 
19
- ### Basic Example
19
+ ### Basic Example with Pre-saved Offer
20
+
21
+ If you have already saved the flight offer to Movmo's system and have an offer ID:
22
+
23
+ ```jsx
24
+ import React from 'react';
25
+ import { MovmoCheckoutButton } from '@movmo/express-checkout-button';
26
+ // Important: Import the styles
27
+ import '@movmo/express-checkout-button/dist/index.css';
28
+
29
+ function MyBookingPage() {
30
+ return (
31
+ <div className="booking-page">
32
+ <h1>Complete your booking</h1>
33
+
34
+ <MovmoCheckoutButton
35
+ iataCode="PR"
36
+ apiKey="your-movmo-api-key"
37
+ providerID="amadeus"
38
+ flightOfferID="offer-123-456-789"
39
+ isProd={false} // Set to true for production environment
40
+ />
41
+ </div>
42
+ );
43
+ }
44
+
45
+ export default MyBookingPage;
46
+ ```
47
+
48
+ ### Example with Raw Flight Offer
49
+
50
+ If you have the raw flight offer data that needs to be saved when the button is clicked:
20
51
 
21
52
  ```jsx
22
53
  import React from 'react';
@@ -25,9 +56,9 @@ import { MovmoCheckoutButton } from '@movmo/express-checkout-button';
25
56
  import '@movmo/express-checkout-button/dist/index.css';
26
57
 
27
58
  function MyBookingPage() {
28
- // Flight offer data retrieved from your booking system
59
+ // Flight offer data retrieved from your booking system (Amadeus, Sabre, etc.)
29
60
  const flightOffer = {
30
- // Your flight offer data
61
+ // Your raw flight offer data from the provider
31
62
  };
32
63
 
33
64
  return (
@@ -35,10 +66,9 @@ function MyBookingPage() {
35
66
  <h1>Complete your booking</h1>
36
67
 
37
68
  <MovmoCheckoutButton
38
- customerId="your-airline-id"
39
- iataCode="your-iata-code"
69
+ iataCode="AA"
40
70
  apiKey="your-movmo-api-key"
41
- dataSource="amadeus" // Use string literal: "amadeus" or "sabre"
71
+ providerID="sabre"
42
72
  flightOffer={flightOffer}
43
73
  isProd={false} // Set to true for production environment
44
74
  />
@@ -51,23 +81,27 @@ export default MyBookingPage;
51
81
 
52
82
  ## Props
53
83
 
54
- | Prop | Type | Required | Description |
55
- | ------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
56
- | `customerId` | string | Yes | The unique identifier for your airline |
57
- | `iataCode` | string | Yes | The IATA code for your airline |
58
- | `apiKey` | string | Yes | Your Movmo API key |
59
- | `dataSource` | string | Yes | The source of flight data, must be either "amadeus" or "sabre" |
60
- | `flightOffer` | object | Yes | The flight offer data object |
61
- | `isProd` | boolean | No | Whether to use production endpoints (default: false). When true, uses production API and flights URLs; when false, uses e2e (testing) endpoints. |
84
+ | Prop | Type | Required | Description |
85
+ | --------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
86
+ | `iataCode` | string | Yes | The IATA code for the airline |
87
+ | `apiKey` | string | Yes | Your Movmo API key |
88
+ | `providerID` | string | Yes | The provider identifier (e.g., "amadeus", "sabre", "duffel") |
89
+ | `flightOffer` | object | No\* | The raw flight offer data object from the provider. Required if `flightOfferID` is not provided |
90
+ | `flightOfferID` | string | No\* | The ID of a pre-saved flight offer. Required if `flightOffer` is not provided |
91
+ | `isProd` | boolean | No | Whether to use production endpoints (default: false). When true, uses production API and flights URLs; when false, uses e2e (testing) endpoints |
92
+
93
+ \*Note: Either `flightOffer` or `flightOfferID` must be provided, but not both.
62
94
 
63
- ## Data Source Options
95
+ ## Provider Options
64
96
 
65
- The `dataSource` prop accepts the following string values:
97
+ The `providerID` prop accepts provider identifiers as strings. Common providers include:
66
98
 
67
99
  ```jsx
68
- // Available options
100
+ // Common provider IDs
69
101
  'amadeus'; // For Amadeus flight data
70
102
  'sabre'; // For Sabre flight data
103
+ 'duffel'; // For Duffel flight data
104
+ // ... and other supported providers
71
105
  ```
72
106
 
73
107
  ## Environment Configuration
@@ -118,10 +152,10 @@ npm run build
118
152
 
119
153
  The Storybook includes several examples:
120
154
 
121
- 1. **Default**: Standard implementation of the checkout button
122
- 2. **Development Environment**: Example configured for development environment
155
+ 1. **With Pre-saved Offer ID**: Example using a pre-saved flight offer ID
156
+ 2. **With Raw Flight Offer**: Example with raw Amadeus flight offer data that will be saved on button click
123
157
  3. **Production Environment**: Example configured for production environment
124
- 4. **Custom-Styled Button**: Example showing how to create a custom styled button
158
+ 4. **Minimal With Offer ID**: Minimal configuration example with just the required props
125
159
 
126
160
  ## License
127
161
 
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  interface MovmoCheckoutButtonProps {
3
- customerId: string;
4
3
  iataCode: string;
5
4
  apiKey: string;
6
- dataSource: "amadeus" | "sabre";
7
- flightOffer: object;
5
+ providerID: string;
6
+ flightOffer?: object;
7
+ flightOfferID?: string;
8
8
  isProd?: boolean;
9
9
  }
10
10
  export declare const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps>;
package/dist/dts/api.d.ts CHANGED
@@ -1,8 +1,3 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  export declare const createAxiosClient: (apiKey: string, isProd?: boolean) => AxiosInstance;
3
- export interface FlightOfferRequest {
4
- dataSource: string;
5
- customerId: string;
6
- rawOffer: object;
7
- }
8
- export declare const saveFlightOffer: (payload: FlightOfferRequest, client: AxiosInstance) => Promise<string | null>;
3
+ export declare const saveProviderOffer: (providerID: string, rawOffer: object, client: AxiosInstance) => Promise<string | null>;
package/dist/index.cjs.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @movmo/express-checkout-button v1.0.4
2
+ * @movmo/express-checkout-button v1.1.0
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
6
6
  */
7
- "use strict";var o=require("react/jsx-runtime"),e=require("react"),t=require("axios");function n(o,e=!1){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ";const n=e?"https://flights.movmo.io":"https://flights.e2e.movmo.io";let i=`${n}/booking?${o}`;if(window.location.pathname.includes("/movmo/checkout/booking/")){i=`${n}/booking/${window.location.pathname.split("/").pop()}?airlineRef=${new URLSearchParams(window.location.search).get("airlineRef")||""}`,window.history.replaceState({checkoutOpen:!0,bookingComplete:!0},"",window.location.href)}t.innerHTML=`\n <iframe \n src="${i}"\n width="100%" \n height="100%" \n style="border: none;"\n id="movmo-checkout-iframe">\n </iframe>\n `,document.body.appendChild(t),window.addEventListener("message",(o=>{const t=function(o,e){const t=["https://flights.movmo.io"],n=["https://flights.e2e.movmo.io","http://localhost:3000"];return e?t.includes(o):n.includes(o)}(o.origin,e);if(t&&"MOVMO_BOOKING_COMPLETE"===o.data?.type){const{bookingId:e,airlineRef:t}=o.data;e&&window.history.pushState({checkoutOpen:!0,bookingComplete:!0,bookingId:e},"",`/movmo/checkout/booking/${e}?airlineRef=${t||""}`)}}))}window.addEventListener("popstate",(()=>{const o=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&o&&o.remove()})),"undefined"!=typeof window&&window.addEventListener("DOMContentLoaded",(()=>{const o=window.location.pathname.includes("/movmo/checkout/booking/"),e=window.location.pathname.startsWith("/movmo/checkout");if(o||e){n(window.location.search.substring(1),function(){const o=window.location.hostname;return!o.includes("e2e")&&!o.includes("localhost")}())}}));exports.MovmoCheckoutButton=({customerId:i,iataCode:a,apiKey:c,dataSource:s,flightOffer:r,isProd:d=!1})=>{const[h,m]=e.useState(!1),u=((o,e=!1)=>{const n=e?"https://api.movmo.io":"https://e2e.api.movmo.io";return t.create({baseURL:n,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":o},withCredentials:!0,timeout:3e4})})(c,d),l=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${h?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),p="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return o.jsxs("button",{onClick:async()=>{const o={dataSource:s,customerId:i,rawOffer:r},e=await(async(o,e)=>await e.post("/v1/flight_offers",o).then((o=>o.data.id)).catch((o=>null)))(o,u);if(!e)return;const t=new URLSearchParams({offerId:e,airlineRef:a}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${t}`),n(t,d)},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:l,children:["Express Checkout",o.jsx("span",{className:p,children:"Movmo"})]})};
7
+ "use strict";var o=require("react/jsx-runtime"),e=require("react"),t=require("axios");function n(o,e=!1){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ";const n=e?"https://flights.movmo.io":"https://flights.e2e.movmo.io";let i=`${n}/booking?${o}`;if(window.location.pathname.includes("/movmo/checkout/booking/")){i=`${n}/booking/${window.location.pathname.split("/").pop()}?airlineRef=${new URLSearchParams(window.location.search).get("airlineRef")||""}`,window.history.replaceState({checkoutOpen:!0,bookingComplete:!0},"",window.location.href)}t.innerHTML=`\n <iframe \n src="${i}"\n width="100%" \n height="100%" \n style="border: none;"\n id="movmo-checkout-iframe">\n </iframe>\n `,document.body.appendChild(t),window.addEventListener("message",(o=>{const t=function(o,e){const t=["https://flights.movmo.io"],n=["https://flights.e2e.movmo.io","http://localhost:3000"];return e?t.includes(o):n.includes(o)}(o.origin,e);if(t&&"MOVMO_BOOKING_COMPLETE"===o.data?.type){const{bookingId:e,airlineRef:t}=o.data;e&&window.history.pushState({checkoutOpen:!0,bookingComplete:!0,bookingId:e},"",`/movmo/checkout/booking/${e}?airlineRef=${t||""}`)}}))}window.addEventListener("popstate",(()=>{const o=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&o&&o.remove()})),"undefined"!=typeof window&&window.addEventListener("DOMContentLoaded",(()=>{const o=window.location.pathname.includes("/movmo/checkout/booking/"),e=window.location.pathname.startsWith("/movmo/checkout");if(o||e){n(window.location.search.substring(1),function(){const o=window.location.hostname;return!o.includes("e2e")&&!o.includes("localhost")}())}}));exports.MovmoCheckoutButton=({iataCode:i,apiKey:r,providerID:a,flightOffer:s,flightOfferID:c,isProd:d=!1})=>{const[h,m]=e.useState(!1),l=((o,e=!1)=>{const n=e?"https://api.movmo.io":"https://e2e.api.movmo.io";return t.create({baseURL:n,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":o},withCredentials:!0,timeout:3e4})})(r,d),u=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${h?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),p="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return o.jsxs("button",{onClick:async()=>{let o=c;if(!o&&s){const e=await(async(o,e,t)=>await t.post(`/v1/flights/providers/${o}/offers`,e).then((o=>o.data.offer_id)).catch((o=>null)))(a,s,l);if(!e)return;o=e}if(!o)return;const e=new URLSearchParams({offerId:o,providerId:a,airlineRef:i}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${e}`),n(e,d)},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:u,children:["Express Checkout",o.jsx("span",{className:p,children:"Movmo"})]})};
8
8
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/api.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string, isProd: boolean = false) {\n if (document.getElementById('movmo-checkout')) return;\n\n const container = document.createElement('div');\n container.id = 'movmo-checkout';\n container.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n `;\n\n // Use production or development URL based on isProd flag\n const baseUrl = isProd ? 'https://flights.movmo.io' : 'https://flights.e2e.movmo.io';\n\n // Check if we're already on a booking confirmation URL\n let iframeUrl = `${baseUrl}/booking?${queryParams}`;\n\n // If the URL indicates we're on a booking confirmation page, load that instead\n if (window.location.pathname.includes('/movmo/checkout/booking/')) {\n const bookingId = window.location.pathname.split('/').pop();\n const urlParams = new URLSearchParams(window.location.search);\n const airlineRef = urlParams.get('airlineRef') || '';\n\n // Direct the iframe to the booking confirmation page\n iframeUrl = `${baseUrl}/booking/${bookingId}?airlineRef=${airlineRef}`;\n\n // Ensure we maintain the checkout state\n window.history.replaceState(\n { checkoutOpen: true, bookingComplete: true },\n '',\n window.location.href,\n );\n }\n\n container.innerHTML = `\n <iframe \n src=\"${iframeUrl}\"\n width=\"100%\" \n height=\"100%\" \n style=\"border: none;\"\n id=\"movmo-checkout-iframe\">\n </iframe>\n `;\n\n document.body.appendChild(container);\n\n // Setup communication channel with iframe\n window.addEventListener('message', (event) => {\n // Check if the origin is allowed\n const isAllowedOrigin = checkAllowedOrigin(event.origin, isProd);\n\n if (isAllowedOrigin && event.data?.type === 'MOVMO_BOOKING_COMPLETE') {\n const { bookingId, airlineRef } = event.data;\n if (bookingId) {\n // Update the parent URL to reflect booking completion\n window.history.pushState(\n { checkoutOpen: true, bookingComplete: true, bookingId },\n '',\n `/movmo/checkout/booking/${bookingId}?airlineRef=${airlineRef || ''}`,\n );\n }\n }\n });\n}\n\n/**\n * Check if an origin is allowed based on environment\n * - Production: Only flights.movmo.io is allowed\n * - Development: Allows flights.e2e.movmo.io and localhost:3000 only\n */\nfunction checkAllowedOrigin(origin: string, isProd: boolean): boolean {\n // Production origins (only used in production)\n const productionOrigins = ['https://flights.movmo.io'];\n\n // Development specific domains\n const devSpecificDomains = [\n 'https://flights.e2e.movmo.io',\n 'http://localhost:3000', // Specifically port 3000 for local development\n ];\n\n if (isProd) {\n // In production, only allow production origins\n return productionOrigins.includes(origin);\n } else {\n // In development, only allow development specific domains\n return devSpecificDomains.includes(origin);\n }\n}\n\n// Clean up when back button is used\nwindow.addEventListener('popstate', () => {\n const container = document.getElementById('movmo-checkout');\n if (!window.history.state?.checkoutOpen && container) {\n container.remove();\n }\n});\n\n/**\n * Determine if the current environment is production based on hostname\n * - Production: hostname contains neither 'e2e' nor 'localhost'\n * - Development/Testing: hostname contains 'e2e' or 'localhost'\n */\nfunction isProductionEnvironment(): boolean {\n const hostname = window.location.hostname;\n // Check if we're on production (neither e2e nor localhost)\n return !hostname.includes('e2e') && !hostname.includes('localhost');\n}\n\n// Handle page refresh or direct navigation to a booking confirmation URL\nif (typeof window !== 'undefined') {\n window.addEventListener('DOMContentLoaded', () => {\n const isBookingConfirmation = window.location.pathname.includes('/movmo/checkout/booking/');\n const isCheckoutPath = window.location.pathname.startsWith('/movmo/checkout');\n\n if (isBookingConfirmation || isCheckoutPath) {\n const queryParams = window.location.search.substring(1);\n const isProd = isProductionEnvironment();\n showMovmoOverlay(queryParams, isProd);\n }\n });\n}\n","import React, { useState } from 'react';\n\nimport { createAxiosClient, FlightOfferRequest, saveFlightOffer } from './api';\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\n\ninterface MovmoCheckoutButtonProps {\n customerId: string;\n iataCode: string;\n apiKey: string;\n dataSource: \"amadeus\" | \"sabre\";\n // TODO: support fare splitting\n flightOffer: object;\n isProd?: boolean;\n}\n\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\n customerId,\n iataCode,\n apiKey,\n dataSource,\n flightOffer,\n isProd = false,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n const client = createAxiosClient(apiKey, isProd);\n\n const handleClick = async () => {\n const payload: FlightOfferRequest = {\n dataSource,\n customerId,\n rawOffer: flightOffer,\n };\n const offerId = await saveFlightOffer(payload, client);\n if (!offerId) {\n // TODO: handle error by displaying a message to the user\n return;\n }\n\n const queryParams = new URLSearchParams({\n offerId,\n airlineRef: iataCode,\n }).toString();\n\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\n showMovmoOverlay(queryParams, isProd);\n };\n\n const buttonClasses = `\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\n `.trim();\n\n const badgeClasses = `\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n `.trim();\n\n return (\n <button\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={buttonClasses}\n >\n Express Checkout\n <span className={badgeClasses}>\n Movmo\n </span>\n </button>\n );\n};\n","import axios, { AxiosInstance } from 'axios';\n\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\n const baseUrl = isProd ? 'https://api.movmo.io' : 'https://e2e.api.movmo.io';\n\n const client = axios.create({\n baseURL: baseUrl,\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n },\n // Allow cookies to be sent with requests\n withCredentials: true,\n timeout: 30000,\n });\n\n return client;\n};\n\nexport interface FlightOfferRequest {\n dataSource: string;\n customerId: string;\n // The raw offer object from the data source; does not currently support fare splitting\n rawOffer: object;\n}\n\nexport const saveFlightOffer = async (\n payload: FlightOfferRequest,\n client: AxiosInstance,\n): Promise<string | null> => {\n return await client\n .post('/v1/flight_offers', payload)\n .then((res) => res.data.id)\n .catch((err) => {\n console.error(err);\n return null;\n });\n};\n"],"names":["showMovmoOverlay","queryParams","isProd","document","getElementById","container","createElement","id","style","cssText","baseUrl","iframeUrl","window","location","pathname","includes","split","pop","URLSearchParams","search","get","history","replaceState","checkoutOpen","bookingComplete","href","innerHTML","body","appendChild","addEventListener","event","isAllowedOrigin","origin","productionOrigins","devSpecificDomains","checkAllowedOrigin","data","type","bookingId","airlineRef","pushState","state","remove","isBookingConfirmation","isCheckoutPath","startsWith","substring","hostname","isProductionEnvironment","customerId","iataCode","apiKey","dataSource","flightOffer","isHovered","setIsHovered","useState","client","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","catch","err","saveFlightOffer","toString","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;+FAAgBA,EAAiBC,EAAqBC,GAAkB,GACtE,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAW1B,MAAMC,EAAUR,EAAS,2BAA6B,+BAGtD,IAAIS,EAAY,GAAGD,aAAmBT,IAGtC,GAAIW,OAAOC,SAASC,SAASC,SAAS,4BAA6B,CAMjEJ,EAAY,GAAGD,aALGE,OAAOC,SAASC,SAASE,MAAM,KAAKC,oBACpC,IAAIC,gBAAgBN,OAAOC,SAASM,QACzBC,IAAI,eAAiB,KAMlDR,OAAOS,QAAQC,aACb,CAAEC,cAAc,EAAMC,iBAAiB,GACvC,GACAZ,OAAOC,SAASY,MAIpBpB,EAAUqB,UAAY,wCAELf,iKAQjBR,SAASwB,KAAKC,YAAYvB,GAG1BO,OAAOiB,iBAAiB,WAAYC,IAElC,MAAMC,EAqBV,SAA4BC,EAAgB9B,GAE1C,MAAM+B,EAAoB,CAAC,4BAGrBC,EAAqB,CACzB,+BACA,yBAGF,OAAIhC,EAEK+B,EAAkBlB,SAASiB,GAG3BE,EAAmBnB,SAASiB,EAEvC,CAtC4BG,CAAmBL,EAAME,OAAQ9B,GAEzD,GAAI6B,GAAwC,2BAArBD,EAAMM,MAAMC,KAAmC,CACpE,MAAMC,UAAEA,EAASC,WAAEA,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AKiB,EAED,OAGJ,MAAMzE,EAAc,IAAIiB,gBAAgB,CACpCwD,UACAnC,WAAYW,IACb+B,WAEHrE,OAAOS,QAAQmB,UAAU,CAAEjB,cAAc,GAAQ,GAAI,mBAAmBtB,KACxED,EAAiBC,EAAaC,EAAO,EA0BjCgF,aAAc,IAAM3B,GAAa,GACjC4B,aAAc,IAAM5B,GAAa,GACjC6B,UAAWlB,EAAamB,SAAA,CAAA,mBAGxBC,cAAMF,UAAWhB,EAEViB,SAAA,YACF"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/api.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string, isProd: boolean = false) {\n if (document.getElementById('movmo-checkout')) return;\n\n const container = document.createElement('div');\n container.id = 'movmo-checkout';\n container.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n `;\n\n // Use production or development URL based on isProd flag\n const baseUrl = isProd ? 'https://flights.movmo.io' : 'https://flights.e2e.movmo.io';\n\n // Check if we're already on a booking confirmation URL\n let iframeUrl = `${baseUrl}/booking?${queryParams}`;\n\n // If the URL indicates we're on a booking confirmation page, load that instead\n if (window.location.pathname.includes('/movmo/checkout/booking/')) {\n const bookingId = window.location.pathname.split('/').pop();\n const urlParams = new URLSearchParams(window.location.search);\n const airlineRef = urlParams.get('airlineRef') || '';\n\n // Direct the iframe to the booking confirmation page\n iframeUrl = `${baseUrl}/booking/${bookingId}?airlineRef=${airlineRef}`;\n\n // Ensure we maintain the checkout state\n window.history.replaceState(\n { checkoutOpen: true, bookingComplete: true },\n '',\n window.location.href,\n );\n }\n\n container.innerHTML = `\n <iframe \n src=\"${iframeUrl}\"\n width=\"100%\" \n height=\"100%\" \n style=\"border: none;\"\n id=\"movmo-checkout-iframe\">\n </iframe>\n `;\n\n document.body.appendChild(container);\n\n // Setup communication channel with iframe\n window.addEventListener('message', (event) => {\n // Check if the origin is allowed\n const isAllowedOrigin = checkAllowedOrigin(event.origin, isProd);\n\n if (isAllowedOrigin && event.data?.type === 'MOVMO_BOOKING_COMPLETE') {\n const { bookingId, airlineRef } = event.data;\n if (bookingId) {\n // Update the parent URL to reflect booking completion\n window.history.pushState(\n { checkoutOpen: true, bookingComplete: true, bookingId },\n '',\n `/movmo/checkout/booking/${bookingId}?airlineRef=${airlineRef || ''}`,\n );\n }\n }\n });\n}\n\n/**\n * Check if an origin is allowed based on environment\n * - Production: Only flights.movmo.io is allowed\n * - Development: Allows flights.e2e.movmo.io and localhost:3000 only\n */\nfunction checkAllowedOrigin(origin: string, isProd: boolean): boolean {\n // Production origins (only used in production)\n const productionOrigins = ['https://flights.movmo.io'];\n\n // Development specific domains\n const devSpecificDomains = [\n 'https://flights.e2e.movmo.io',\n 'http://localhost:3000', // Specifically port 3000 for local development\n ];\n\n if (isProd) {\n // In production, only allow production origins\n return productionOrigins.includes(origin);\n } else {\n // In development, only allow development specific domains\n return devSpecificDomains.includes(origin);\n }\n}\n\n// Clean up when back button is used\nwindow.addEventListener('popstate', () => {\n const container = document.getElementById('movmo-checkout');\n if (!window.history.state?.checkoutOpen && container) {\n container.remove();\n }\n});\n\n/**\n * Determine if the current environment is production based on hostname\n * - Production: hostname contains neither 'e2e' nor 'localhost'\n * - Development/Testing: hostname contains 'e2e' or 'localhost'\n */\nfunction isProductionEnvironment(): boolean {\n const hostname = window.location.hostname;\n // Check if we're on production (neither e2e nor localhost)\n return !hostname.includes('e2e') && !hostname.includes('localhost');\n}\n\n// Handle page refresh or direct navigation to a booking confirmation URL\nif (typeof window !== 'undefined') {\n window.addEventListener('DOMContentLoaded', () => {\n const isBookingConfirmation = window.location.pathname.includes('/movmo/checkout/booking/');\n const isCheckoutPath = window.location.pathname.startsWith('/movmo/checkout');\n\n if (isBookingConfirmation || isCheckoutPath) {\n const queryParams = window.location.search.substring(1);\n const isProd = isProductionEnvironment();\n showMovmoOverlay(queryParams, isProd);\n }\n });\n}\n","import React, { useState } from 'react';\n\nimport { createAxiosClient, saveProviderOffer } from './api';\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\n\ninterface MovmoCheckoutButtonProps {\n iataCode: string;\n apiKey: string;\n providerID: string;\n // TODO: support fare splitting\n flightOffer?: object;\n flightOfferID?: string;\n isProd?: boolean;\n}\n\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\n iataCode,\n apiKey,\n providerID,\n flightOffer,\n flightOfferID,\n isProd = false,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n const client = createAxiosClient(apiKey, isProd);\n\n const handleClick = async () => {\n let offerId = flightOfferID;\n \n // If no pre-saved offer ID, save the raw offer\n if (!offerId && flightOffer) {\n const savedOfferId = await saveProviderOffer(providerID, flightOffer, client);\n if (!savedOfferId) {\n // TODO: handle error by displaying a message to the user\n return;\n }\n offerId = savedOfferId;\n }\n \n if (!offerId) {\n // TODO: handle error - neither flightOfferID nor flightOffer provided\n console.error('Neither flightOfferID nor flightOffer provided');\n return;\n }\n\n const queryParams = new URLSearchParams({\n offerId,\n providerId: providerID,\n airlineRef: iataCode,\n }).toString();\n\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\n showMovmoOverlay(queryParams, isProd);\n };\n\n const buttonClasses = `\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\n `.trim();\n\n const badgeClasses = `\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n `.trim();\n\n return (\n <button\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={buttonClasses}\n >\n Express Checkout\n <span className={badgeClasses}>\n Movmo\n </span>\n </button>\n );\n};\n","import axios, { AxiosInstance } from 'axios';\n\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\n const baseUrl = isProd ? 'https://api.movmo.io' : 'https://e2e.api.movmo.io';\n\n const client = axios.create({\n baseURL: baseUrl,\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n },\n // Allow cookies to be sent with requests\n withCredentials: true,\n timeout: 30000,\n });\n\n return client;\n};\n\nexport const saveProviderOffer = async (\n providerID: string,\n rawOffer: object,\n client: AxiosInstance,\n): Promise<string | null> => {\n return await client\n .post(`/v1/flights/providers/${providerID}/offers`, rawOffer)\n .then((res) => res.data.offer_id)\n .catch((err) => {\n console.error(err);\n return null;\n });\n};\n"],"names":["showMovmoOverlay","queryParams","isProd","document","getElementById","container","createElement","id","style","cssText","baseUrl","iframeUrl","window","location","pathname","includes","split","pop","URLSearchParams","search","get","history","replaceState","checkoutOpen","bookingComplete","href","innerHTML","body","appendChild","addEventListener","event","isAllowedOrigin","origin","productionOrigins","devSpecificDomains","checkAllowedOrigin","data","type","bookingId","airlineRef","pushState","state","remove","isBookingConfirmation","isCheckoutPath","startsWith","substring","hostname","isProductionEnvironment","iataCode","apiKey","providerID","flightOffer","flightOfferID","isHovered","setIsHovered","useState","client","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","offerId","savedOfferId","rawOffer","post","then","res","offer_id","catch","err","saveProviderOffer","providerId","toString","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;+FAAgBA,EAAiBC,EAAqBC,GAAkB,GACtE,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAW1B,MAAMC,EAAUR,EAAS,2BAA6B,+BAGtD,IAAIS,EAAY,GAAGD,aAAmBT,IAGtC,GAAIW,OAAOC,SAASC,SAASC,SAAS,4BAA6B,CAMjEJ,EAAY,G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WC,GAAgBC,EAAAA,UAAS,GACrCC,ECtBuB,EAACP,EAAgBhD,GAAkB,KAClE,MAAMQ,EAAUR,EAAS,uBAAyB,2BAclD,OAZewD,EAAMC,OAAO,CAC1BC,QAASlD,EACTmD,QAAS,CACPC,OAAQ,mBACR,eAAgB,mBAChB,YAAaZ,GAGfa,iBAAiB,EACjBC,QAAS,KAGE,EDOIC,CAAkBf,EAAQhD,GA+BnCgE,EAAgB,sRAShBZ,EAAY,oBAAsB,6BACtCa,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,OACI,SAAA,CAAAC,QAnDYC,UAChB,IAAIC,EAAUnB,EAGd,IAAKmB,GAAWpB,EAAa,CACzB,MAAMqB,OCXeF,OAC/BpB,EACAuB,EACAjB,UAEaA,EACVkB,KAAK,yBAAyBxB,WAAqBuB,GACnDE,MAAMC,GAAQA,EAAIzC,KAAK0C,WACvBC,OAAOC,GAEC,ODC0BC,CAAkB9B,EAAYC,EAAaK,GACtE,IAAKgB,EAED,OAEJD,EAAUC,EAGd,IAAKD,EAGD,OAGJ,MAAMvE,EAAc,IAAIiB,gBAAgB,CACpCsD,UACAU,WAAY/B,EACZZ,WAAYU,IACbkC,WAEHvE,OAAOS,QAAQmB,UAAU,CAAEjB,cAAc,GAAQ,GAAI,mBAAmBtB,KACxED,EAAiBC,EAAaC,EAAO,EA0BjCkF,aAAc,IAAM7B,GAAa,GACjC8B,aAAc,IAAM9B,GAAa,GACjC+B,UAAWpB,EAAaqB,SAAA,CAAA,mBAGxBC,cAAMF,UAAWlB,EAEVmB,SAAA,YACF"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @movmo/express-checkout-button v1.0.4
2
+ * @movmo/express-checkout-button v1.1.0
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
@@ -7,11 +7,11 @@
7
7
  import React from 'react';
8
8
 
9
9
  interface MovmoCheckoutButtonProps {
10
- customerId: string;
11
10
  iataCode: string;
12
11
  apiKey: string;
13
- dataSource: "amadeus" | "sabre";
14
- flightOffer: object;
12
+ providerID: string;
13
+ flightOffer?: object;
14
+ flightOfferID?: string;
15
15
  isProd?: boolean;
16
16
  }
17
17
  declare const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps>;
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @movmo/express-checkout-button v1.0.4
2
+ * @movmo/express-checkout-button v1.1.0
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
6
6
  */
7
- import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import e from"axios";function i(o,t=!1){if(document.getElementById("movmo-checkout"))return;const n=document.createElement("div");n.id="movmo-checkout",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ";const e=t?"https://flights.movmo.io":"https://flights.e2e.movmo.io";let i=`${e}/booking?${o}`;if(window.location.pathname.includes("/movmo/checkout/booking/")){i=`${e}/booking/${window.location.pathname.split("/").pop()}?airlineRef=${new URLSearchParams(window.location.search).get("airlineRef")||""}`,window.history.replaceState({checkoutOpen:!0,bookingComplete:!0},"",window.location.href)}n.innerHTML=`\n <iframe \n src="${i}"\n width="100%" \n height="100%" \n style="border: none;"\n id="movmo-checkout-iframe">\n </iframe>\n `,document.body.appendChild(n),window.addEventListener("message",(o=>{const n=function(o,t){const n=["https://flights.movmo.io"],e=["https://flights.e2e.movmo.io","http://localhost:3000"];return t?n.includes(o):e.includes(o)}(o.origin,t);if(n&&"MOVMO_BOOKING_COMPLETE"===o.data?.type){const{bookingId:t,airlineRef:n}=o.data;t&&window.history.pushState({checkoutOpen:!0,bookingComplete:!0,bookingId:t},"",`/movmo/checkout/booking/${t}?airlineRef=${n||""}`)}}))}window.addEventListener("popstate",(()=>{const o=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&o&&o.remove()})),"undefined"!=typeof window&&window.addEventListener("DOMContentLoaded",(()=>{const o=window.location.pathname.includes("/movmo/checkout/booking/"),t=window.location.pathname.startsWith("/movmo/checkout");if(o||t){i(window.location.search.substring(1),function(){const o=window.location.hostname;return!o.includes("e2e")&&!o.includes("localhost")}())}}));const a=({customerId:a,iataCode:c,apiKey:r,dataSource:s,flightOffer:d,isProd:m=!1})=>{const[h,l]=n(!1),u=((o,t=!1)=>{const n=t?"https://api.movmo.io":"https://e2e.api.movmo.io";return e.create({baseURL:n,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":o},withCredentials:!0,timeout:3e4})})(r,m),p=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${h?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),w="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return o("button",{onClick:async()=>{const o={dataSource:s,customerId:a,rawOffer:d},t=await(async(o,t)=>await t.post("/v1/flight_offers",o).then((o=>o.data.id)).catch((o=>null)))(o,u);if(!t)return;const n=new URLSearchParams({offerId:t,airlineRef:c}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${n}`),i(n,m)},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:p,children:["Express Checkout",t("span",{className:w,children:"Movmo"})]})};export{a as MovmoCheckoutButton};
7
+ import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import e from"axios";function i(o,t=!1){if(document.getElementById("movmo-checkout"))return;const n=document.createElement("div");n.id="movmo-checkout",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ";const e=t?"https://flights.movmo.io":"https://flights.e2e.movmo.io";let i=`${e}/booking?${o}`;if(window.location.pathname.includes("/movmo/checkout/booking/")){i=`${e}/booking/${window.location.pathname.split("/").pop()}?airlineRef=${new URLSearchParams(window.location.search).get("airlineRef")||""}`,window.history.replaceState({checkoutOpen:!0,bookingComplete:!0},"",window.location.href)}n.innerHTML=`\n <iframe \n src="${i}"\n width="100%" \n height="100%" \n style="border: none;"\n id="movmo-checkout-iframe">\n </iframe>\n `,document.body.appendChild(n),window.addEventListener("message",(o=>{const n=function(o,t){const n=["https://flights.movmo.io"],e=["https://flights.e2e.movmo.io","http://localhost:3000"];return t?n.includes(o):e.includes(o)}(o.origin,t);if(n&&"MOVMO_BOOKING_COMPLETE"===o.data?.type){const{bookingId:t,airlineRef:n}=o.data;t&&window.history.pushState({checkoutOpen:!0,bookingComplete:!0,bookingId:t},"",`/movmo/checkout/booking/${t}?airlineRef=${n||""}`)}}))}window.addEventListener("popstate",(()=>{const o=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&o&&o.remove()})),"undefined"!=typeof window&&window.addEventListener("DOMContentLoaded",(()=>{const o=window.location.pathname.includes("/movmo/checkout/booking/"),t=window.location.pathname.startsWith("/movmo/checkout");if(o||t){i(window.location.search.substring(1),function(){const o=window.location.hostname;return!o.includes("e2e")&&!o.includes("localhost")}())}}));const r=({iataCode:r,apiKey:a,providerID:c,flightOffer:s,flightOfferID:d,isProd:m=!1})=>{const[h,l]=n(!1),p=((o,t=!1)=>{const n=t?"https://api.movmo.io":"https://e2e.api.movmo.io";return e.create({baseURL:n,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":o},withCredentials:!0,timeout:3e4})})(a,m),u=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${h?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),f="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return o("button",{onClick:async()=>{let o=d;if(!o&&s){const t=await(async(o,t,n)=>await n.post(`/v1/flights/providers/${o}/offers`,t).then((o=>o.data.offer_id)).catch((o=>null)))(c,s,p);if(!t)return;o=t}if(!o)return;const t=new URLSearchParams({offerId:o,providerId:c,airlineRef:r}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${t}`),i(t,m)},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:u,children:["Express Checkout",t("span",{className:f,children:"Movmo"})]})};export{r as MovmoCheckoutButton};
8
8
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/api.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string, isProd: boolean = false) {\n if (document.getElementById('movmo-checkout')) return;\n\n const container = document.createElement('div');\n container.id = 'movmo-checkout';\n container.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n `;\n\n // Use production or development URL based on isProd flag\n const baseUrl = isProd ? 'https://flights.movmo.io' : 'https://flights.e2e.movmo.io';\n\n // Check if we're already on a booking confirmation URL\n let iframeUrl = `${baseUrl}/booking?${queryParams}`;\n\n // If the URL indicates we're on a booking confirmation page, load that instead\n if (window.location.pathname.includes('/movmo/checkout/booking/')) {\n const bookingId = window.location.pathname.split('/').pop();\n const urlParams = new URLSearchParams(window.location.search);\n const airlineRef = urlParams.get('airlineRef') || '';\n\n // Direct the iframe to the booking confirmation page\n iframeUrl = `${baseUrl}/booking/${bookingId}?airlineRef=${airlineRef}`;\n\n // Ensure we maintain the checkout state\n window.history.replaceState(\n { checkoutOpen: true, bookingComplete: true },\n '',\n window.location.href,\n );\n }\n\n container.innerHTML = `\n <iframe \n src=\"${iframeUrl}\"\n width=\"100%\" \n height=\"100%\" \n style=\"border: none;\"\n id=\"movmo-checkout-iframe\">\n </iframe>\n `;\n\n document.body.appendChild(container);\n\n // Setup communication channel with iframe\n window.addEventListener('message', (event) => {\n // Check if the origin is allowed\n const isAllowedOrigin = checkAllowedOrigin(event.origin, isProd);\n\n if (isAllowedOrigin && event.data?.type === 'MOVMO_BOOKING_COMPLETE') {\n const { bookingId, airlineRef } = event.data;\n if (bookingId) {\n // Update the parent URL to reflect booking completion\n window.history.pushState(\n { checkoutOpen: true, bookingComplete: true, bookingId },\n '',\n `/movmo/checkout/booking/${bookingId}?airlineRef=${airlineRef || ''}`,\n );\n }\n }\n });\n}\n\n/**\n * Check if an origin is allowed based on environment\n * - Production: Only flights.movmo.io is allowed\n * - Development: Allows flights.e2e.movmo.io and localhost:3000 only\n */\nfunction checkAllowedOrigin(origin: string, isProd: boolean): boolean {\n // Production origins (only used in production)\n const productionOrigins = ['https://flights.movmo.io'];\n\n // Development specific domains\n const devSpecificDomains = [\n 'https://flights.e2e.movmo.io',\n 'http://localhost:3000', // Specifically port 3000 for local development\n ];\n\n if (isProd) {\n // In production, only allow production origins\n return productionOrigins.includes(origin);\n } else {\n // In development, only allow development specific domains\n return devSpecificDomains.includes(origin);\n }\n}\n\n// Clean up when back button is used\nwindow.addEventListener('popstate', () => {\n const container = document.getElementById('movmo-checkout');\n if (!window.history.state?.checkoutOpen && container) {\n container.remove();\n }\n});\n\n/**\n * Determine if the current environment is production based on hostname\n * - Production: hostname contains neither 'e2e' nor 'localhost'\n * - Development/Testing: hostname contains 'e2e' or 'localhost'\n */\nfunction isProductionEnvironment(): boolean {\n const hostname = window.location.hostname;\n // Check if we're on production (neither e2e nor localhost)\n return !hostname.includes('e2e') && !hostname.includes('localhost');\n}\n\n// Handle page refresh or direct navigation to a booking confirmation URL\nif (typeof window !== 'undefined') {\n window.addEventListener('DOMContentLoaded', () => {\n const isBookingConfirmation = window.location.pathname.includes('/movmo/checkout/booking/');\n const isCheckoutPath = window.location.pathname.startsWith('/movmo/checkout');\n\n if (isBookingConfirmation || isCheckoutPath) {\n const queryParams = window.location.search.substring(1);\n const isProd = isProductionEnvironment();\n showMovmoOverlay(queryParams, isProd);\n }\n });\n}\n","import React, { useState } from 'react';\n\nimport { createAxiosClient, FlightOfferRequest, saveFlightOffer } from './api';\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\n\ninterface MovmoCheckoutButtonProps {\n customerId: string;\n iataCode: string;\n apiKey: string;\n dataSource: \"amadeus\" | \"sabre\";\n // TODO: support fare splitting\n flightOffer: object;\n isProd?: boolean;\n}\n\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\n customerId,\n iataCode,\n apiKey,\n dataSource,\n flightOffer,\n isProd = false,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n const client = createAxiosClient(apiKey, isProd);\n\n const handleClick = async () => {\n const payload: FlightOfferRequest = {\n dataSource,\n customerId,\n rawOffer: flightOffer,\n };\n const offerId = await saveFlightOffer(payload, client);\n if (!offerId) {\n // TODO: handle error by displaying a message to the user\n return;\n }\n\n const queryParams = new URLSearchParams({\n offerId,\n airlineRef: iataCode,\n }).toString();\n\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\n showMovmoOverlay(queryParams, isProd);\n };\n\n const buttonClasses = `\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\n `.trim();\n\n const badgeClasses = `\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n `.trim();\n\n return (\n <button\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={buttonClasses}\n >\n Express Checkout\n <span className={badgeClasses}>\n Movmo\n </span>\n </button>\n );\n};\n","import axios, { AxiosInstance } from 'axios';\n\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\n const baseUrl = isProd ? 'https://api.movmo.io' : 'https://e2e.api.movmo.io';\n\n const client = axios.create({\n baseURL: baseUrl,\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n },\n // Allow cookies to be sent with requests\n withCredentials: true,\n timeout: 30000,\n });\n\n return client;\n};\n\nexport interface FlightOfferRequest {\n dataSource: string;\n customerId: string;\n // The raw offer object from the data source; does not currently support fare splitting\n rawOffer: object;\n}\n\nexport const saveFlightOffer = async (\n payload: FlightOfferRequest,\n client: AxiosInstance,\n): Promise<string | null> => {\n return await client\n .post('/v1/flight_offers', payload)\n .then((res) => res.data.id)\n .catch((err) => {\n console.error(err);\n return null;\n });\n};\n"],"names":["showMovmoOverlay","queryParams","isProd","document","getElementById","container","createElement","id","style","cssText","baseUrl","iframeUrl","window","location","pathname","includes","split","pop","URLSearchParams","search","get","history","replaceState","checkoutOpen","bookingComplete","href","innerHTML","body","appendChild","addEventListener","event","isAllowedOrigin","origin","productionOrigins","devSpecificDomains","checkAllowedOrigin","data","type","bookingId","airlineRef","pushState","state","remove","isBookingConfirmation","isCheckoutPath","startsWith","substring","hostname","isProductionEnvironment","MovmoCheckoutButton","customerId","iataCode","apiKey","dataSource","flightOffer","isHovered","setIsHovered","useState","client","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","catch","err","saveFlightOffer","toString","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;iHAAgBA,EAAiBC,EAAqBC,GAAkB,GACtE,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAW1B,MAAMC,EAAUR,EAAS,2BAA6B,+BAGtD,IAAIS,EAAY,GAAGD,aAAmBT,IAGtC,GAAIW,OAAOC,SAASC,SAASC,SAAS,4BAA6B,CAMjEJ,EAAY,GAAGD,aALGE,OAAOC,SAASC,SAASE,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tBuB,EAACN,EAAgBlD,GAAkB,KAClE,MAAMQ,EAAUR,EAAS,uBAAyB,2BAclD,OAZeyD,EAAMC,OAAO,CAC1BC,QAASnD,EACToD,QAAS,CACPC,OAAQ,mBACR,eAAgB,mBAChB,YAAaX,GAGfY,iBAAiB,EACjBC,QAAS,KAGE,EDOIC,CAAkBd,EAAQlD,GAuBnCiE,EAAgB,sRAShBZ,EAAY,oBAAsB,6BACtCa,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,EACI,SAAA,CAAAC,QA3CYC,UAChB,MAAMC,EAA8B,CAChCpB,aACAH,aACAwB,SAAUpB,GAERqB,OCLiBH,OAC7BC,EACAf,UAEaA,EACVkB,KAAK,oBAAqBH,GAC1BI,MAAMC,GAAQA,EAAI1C,KAAK7B,KACvBwE,OAAOC,GAEC,ODJiBC,CAAgBR,EAASf,GAC/C,IAAKiB,EAED,OAGJ,MAAM1E,EAAc,IAAIiB,gBAAgB,CACpCyD,UACApC,WAAYY,IACb+B,WAEHtE,OAAOS,QAAQmB,UAAU,CAAEjB,cAAc,GAAQ,GAAI,mBAAmBtB,KACxED,EAAiBC,EAAaC,EAAO,EA0BjCiF,aAAc,IAAM3B,GAAa,GACjC4B,aAAc,IAAM5B,GAAa,GACjC6B,UAAWlB,EAAamB,SAAA,CAAA,mBAGxBC,UAAMF,UAAWhB,EAEViB,SAAA,YACF"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/api.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string, isProd: boolean = false) {\n if (document.getElementById('movmo-checkout')) return;\n\n const container = document.createElement('div');\n container.id = 'movmo-checkout';\n container.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n `;\n\n // Use production or development URL based on isProd flag\n const baseUrl = isProd ? 'https://flights.movmo.io' : 'https://flights.e2e.movmo.io';\n\n // Check if we're already on a booking confirmation URL\n let iframeUrl = `${baseUrl}/booking?${queryParams}`;\n\n // If the URL indicates we're on a booking confirmation page, load that instead\n if (window.location.pathname.includes('/movmo/checkout/booking/')) {\n const bookingId = window.location.pathname.split('/').pop();\n const urlParams = new URLSearchParams(window.location.search);\n const airlineRef = urlParams.get('airlineRef') || '';\n\n // Direct the iframe to the booking confirmation page\n iframeUrl = `${baseUrl}/booking/${bookingId}?airlineRef=${airlineRef}`;\n\n // Ensure we maintain the checkout state\n window.history.replaceState(\n { checkoutOpen: true, bookingComplete: true },\n '',\n window.location.href,\n );\n }\n\n container.innerHTML = `\n <iframe \n src=\"${iframeUrl}\"\n width=\"100%\" \n height=\"100%\" \n style=\"border: none;\"\n id=\"movmo-checkout-iframe\">\n </iframe>\n `;\n\n document.body.appendChild(container);\n\n // Setup communication channel with iframe\n window.addEventListener('message', (event) => {\n // Check if the origin is allowed\n const isAllowedOrigin = checkAllowedOrigin(event.origin, isProd);\n\n if (isAllowedOrigin && event.data?.type === 'MOVMO_BOOKING_COMPLETE') {\n const { bookingId, airlineRef } = event.data;\n if (bookingId) {\n // Update the parent URL to reflect booking completion\n window.history.pushState(\n { checkoutOpen: true, bookingComplete: true, bookingId },\n '',\n `/movmo/checkout/booking/${bookingId}?airlineRef=${airlineRef || ''}`,\n );\n }\n }\n });\n}\n\n/**\n * Check if an origin is allowed based on environment\n * - Production: Only flights.movmo.io is allowed\n * - Development: Allows flights.e2e.movmo.io and localhost:3000 only\n */\nfunction checkAllowedOrigin(origin: string, isProd: boolean): boolean {\n // Production origins (only used in production)\n const productionOrigins = ['https://flights.movmo.io'];\n\n // Development specific domains\n const devSpecificDomains = [\n 'https://flights.e2e.movmo.io',\n 'http://localhost:3000', // Specifically port 3000 for local development\n ];\n\n if (isProd) {\n // In production, only allow production origins\n return productionOrigins.includes(origin);\n } else {\n // In development, only allow development specific domains\n return devSpecificDomains.includes(origin);\n }\n}\n\n// Clean up when back button is used\nwindow.addEventListener('popstate', () => {\n const container = document.getElementById('movmo-checkout');\n if (!window.history.state?.checkoutOpen && container) {\n container.remove();\n }\n});\n\n/**\n * Determine if the current environment is production based on hostname\n * - Production: hostname contains neither 'e2e' nor 'localhost'\n * - Development/Testing: hostname contains 'e2e' or 'localhost'\n */\nfunction isProductionEnvironment(): boolean {\n const hostname = window.location.hostname;\n // Check if we're on production (neither e2e nor localhost)\n return !hostname.includes('e2e') && !hostname.includes('localhost');\n}\n\n// Handle page refresh or direct navigation to a booking confirmation URL\nif (typeof window !== 'undefined') {\n window.addEventListener('DOMContentLoaded', () => {\n const isBookingConfirmation = window.location.pathname.includes('/movmo/checkout/booking/');\n const isCheckoutPath = window.location.pathname.startsWith('/movmo/checkout');\n\n if (isBookingConfirmation || isCheckoutPath) {\n const queryParams = window.location.search.substring(1);\n const isProd = isProductionEnvironment();\n showMovmoOverlay(queryParams, isProd);\n }\n });\n}\n","import React, { useState } from 'react';\n\nimport { createAxiosClient, saveProviderOffer } from './api';\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\n\ninterface MovmoCheckoutButtonProps {\n iataCode: string;\n apiKey: string;\n providerID: string;\n // TODO: support fare splitting\n flightOffer?: object;\n flightOfferID?: string;\n isProd?: boolean;\n}\n\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\n iataCode,\n apiKey,\n providerID,\n flightOffer,\n flightOfferID,\n isProd = false,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n const client = createAxiosClient(apiKey, isProd);\n\n const handleClick = async () => {\n let offerId = flightOfferID;\n \n // If no pre-saved offer ID, save the raw offer\n if (!offerId && flightOffer) {\n const savedOfferId = await saveProviderOffer(providerID, flightOffer, client);\n if (!savedOfferId) {\n // TODO: handle error by displaying a message to the user\n return;\n }\n offerId = savedOfferId;\n }\n \n if (!offerId) {\n // TODO: handle error - neither flightOfferID nor flightOffer provided\n console.error('Neither flightOfferID nor flightOffer provided');\n return;\n }\n\n const queryParams = new URLSearchParams({\n offerId,\n providerId: providerID,\n airlineRef: iataCode,\n }).toString();\n\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\n showMovmoOverlay(queryParams, isProd);\n };\n\n const buttonClasses = `\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\n `.trim();\n\n const badgeClasses = `\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n `.trim();\n\n return (\n <button\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={buttonClasses}\n >\n Express Checkout\n <span className={badgeClasses}>\n Movmo\n </span>\n </button>\n );\n};\n","import axios, { AxiosInstance } from 'axios';\n\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\n const baseUrl = isProd ? 'https://api.movmo.io' : 'https://e2e.api.movmo.io';\n\n const client = axios.create({\n baseURL: baseUrl,\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n },\n // Allow cookies to be sent with requests\n withCredentials: true,\n timeout: 30000,\n });\n\n return client;\n};\n\nexport const saveProviderOffer = async (\n providerID: string,\n rawOffer: object,\n client: AxiosInstance,\n): Promise<string | null> => {\n return await client\n .post(`/v1/flights/providers/${providerID}/offers`, rawOffer)\n .then((res) => res.data.offer_id)\n .catch((err) => {\n console.error(err);\n return null;\n });\n};\n"],"names":["showMovmoOverlay","queryParams","isProd","document","getElementById","container","createElement","id","style","cssText","baseUrl","iframeUrl","window","location","pathname","includes","split","pop","URLSearchParams","search","get","history","replaceState","checkoutOpen","bookingComplete","href","innerHTML","body","appendChild","addEventListener","event","isAllowedOrigin","origin","productionOrigins","devSpecificDomains","checkAllowedOrigin","data","type","bookingId","airlineRef","pushState","state","remove","isBookingConfirmation","isCheckoutPath","startsWith","substring","hostname","isProductionEnvironment","MovmoCheckoutButton","iataCode","apiKey","providerID","flightOffer","flightOfferID","isHovered","setIsHovered","useState","client","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","offerId","savedOfferId","rawOffer","post","then","res","offer_id","catch","err","saveProviderOffer","providerId","toString","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;iHAAgBA,EAAiBC,EAAqBC,GAAkB,GACtE,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAW1B,MAAMC,EAAUR,EAAS,2BAA6B,+BAGtD,IAAIS,EAAY,GAAGD,aAAmBT,IAGtC,GAAIW,OAAOC,SAASC,SAASC,SAAS,4BAA6B,CAMjEJ,EAAY,GAAGD,aALGE,OAAOC,SAASC,SAASE,MAAM,KAAKC,oBACpC,IAAIC,gBAAgBN,OAAOC,SAASM,QACzBC,IAAI,eAAiB,KAMlDR,OAAOS,QAAQC,aACb,CAAEC,cAAc,EAAMC,iBAAiB,GACvC,GACAZ,OAAOC,SAASY,MAIpBpB,EAAUqB,UAAY,wCAELf,iKAQjBR,SAASwB,KAAKC,YAAYvB,GAG1BO,OAAOiB,iBAAiB,WAAYC,IAElC,MAAMC,EAqBV,SAA4BC,EAAgB9B,GAE1C,MAAM+B,EAAoB,CAAC,4BAGrBC,EAAqB,CACzB,+BACA,yBAGF,OAAIhC,EAEK+B,EAAkBlB,SAASiB,GAG3BE,EAAmBnB,SAASiB,EAEvC,CAtC4BG,CAAmBL,EAAME,OAAQ9B,GAEzD,GAAI6B,GAAwC,2BAArBD,EAAMM,MAAMC,KAAmC,CACpE,MAAMC,UAAEA,EAASC,WAAEA,GAAeT,EAAMM,KACpCE,GAEF1B,OAAOS,QAAQmB,UACb,CAAEjB,cAAc,EAAMC,iBAAiB,EAAMc,aAC7C,GACA,2BAA2BA,gB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gB,CACpCuD,UACAU,WAAY/B,EACZb,WAAYW,IACbkC,WAEHxE,OAAOS,QAAQmB,UAAU,CAAEjB,cAAc,GAAQ,GAAI,mBAAmBtB,KACxED,EAAiBC,EAAaC,EAAO,EA0BjCmF,aAAc,IAAM7B,GAAa,GACjC8B,aAAc,IAAM9B,GAAa,GACjC+B,UAAWpB,EAAaqB,SAAA,CAAA,mBAGxBC,UAAMF,UAAWlB,EAEVmB,SAAA,YACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo/express-checkout-button",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "React component plugin for embedding Movmo Express Checkout on airline websites.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",