@inflow_pay/sdk 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.0] - 2026-01-26
11
+
12
+ ### Changed
13
+ - Deprecated `light` theme property in favor of base styles handling light theme by default
14
+ - Updated documentation to remove light theme code examples
15
+
10
16
  ## [0.5.0] - 2026-01-22
11
17
 
12
18
  ### Changed
package/README.md CHANGED
@@ -12,7 +12,7 @@ Or use via CDN (jsDelivr) - **for vanilla HTML pages only**:
12
12
 
13
13
  ```html
14
14
  <!-- Main SDK (vanilla JavaScript) -->
15
- <script src="https://cdn.jsdelivr.net/npm/@inflow_pay/sdk@0.5.0/dist/sdk.umd.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/@inflow_pay/sdk@0.6.0/dist/sdk.umd.js"></script>
16
16
  <script>
17
17
  // SDK is available as window.InflowPaySDK
18
18
  const provider = new InflowPaySDK.InflowPayProvider({
@@ -22,8 +22,8 @@ Or use via CDN (jsDelivr) - **for vanilla HTML pages only**:
22
22
  ```
23
23
 
24
24
  **Note:**
25
- - The example uses exact version `@0.5.0` for production safety (prevents unexpected changes)
26
- - You can update to newer versions manually when ready (e.g., `@0.5.0`)
25
+ - The example uses exact version `@0.6.0` for production safety (prevents unexpected changes)
26
+ - You can update to newer versions manually when ready (e.g., `@0.6.0`)
27
27
  - If you're building a React app (create-react-app, Next.js, etc.), use `npm install` instead of CDN. See [Migration from React SDK](#migration-from-react-sdk) section.
28
28
 
29
29
  ## Quick Start
@@ -184,7 +184,7 @@ cardElement.destroy();
184
184
  <body>
185
185
  <div id="card-container"></div>
186
186
 
187
- <script src="https://cdn.jsdelivr.net/npm/@inflow_pay/sdk@0.5.0/dist/sdk.umd.js"></script>
187
+ <script src="https://cdn.jsdelivr.net/npm/@inflow_pay/sdk@0.6.0/dist/sdk.umd.js"></script>
188
188
  <script>
189
189
  // SDK is available as window.InflowPaySDK
190
190
  const provider = new InflowPaySDK.InflowPayProvider({
@@ -407,29 +407,23 @@ const cardElement = provider.createCardElement({
407
407
  });
408
408
  ```
409
409
 
410
- ### Theme Support (Light/Dark Mode)
410
+ ### Theme Support (Dark Mode)
411
411
 
412
- The SDK automatically adapts to the user's system preference, but you can also provide theme-specific overrides:
412
+ The SDK automatically adapts to the user's system preference. Base styles handle light theme by default. You can provide dark mode overrides:
413
413
 
414
414
  ```javascript
415
415
  style: {
416
- // Base styles (apply to both themes)
416
+ // Base styles (apply to light theme by default)
417
417
  fontFamily: 'Inter',
418
418
  button: {
419
419
  backgroundColor: '#0070F3',
420
420
  textColor: '#FFFFFF'
421
421
  },
422
- // Light mode overrides
423
- light: {
424
- inputContainer: {
425
- backgroundColor: '#FFFFFF',
426
- borderColor: '#E0E0E0'
427
- },
428
- input: {
429
- textColor: '#1A1A1A'
430
- }
422
+ inputContainer: {
423
+ backgroundColor: '#FFFFFF',
424
+ borderColor: '#E0E0E0'
431
425
  },
432
- // Dark mode overrides
426
+ // Dark mode overrides (only needed if you want to customize dark theme)
433
427
  dark: {
434
428
  inputContainer: {
435
429
  backgroundColor: '#1A1A1A',
@@ -526,7 +520,7 @@ interface CSSProperties {
526
520
  fieldErrorColor?: string;
527
521
 
528
522
  // Theme-specific overrides
529
- light?: ThemeStyles;
523
+ // Base styles handle light theme by default
530
524
  dark?: ThemeStyles;
531
525
  }
532
526
  ```
@@ -111,6 +111,7 @@ declare interface CSSProperties {
111
111
  fieldErrorColor?: string;
112
112
  generalError?: GeneralMessageStyles;
113
113
  generalSuccess?: GeneralMessageStyles;
114
+ /** @deprecated Use base styles for light theme customization. This property will be removed in a future version. */
114
115
  light?: ThemeStyles;
115
116
  dark?: ThemeStyles;
116
117
  }
package/dist/sdk.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./payment-sdk-CvXfOxY6.js");class d{constructor(e){const E={apiKey:e.config.apiKey,iframeUrl:e.config.iframeUrl,timeout:e.config.timeout,debug:e.config.debug};this.sdk=new o.PaymentSDK(E)}createCardElement(e){let E;if(e.container)E=e.container;else{const t=document.createElement("div");t.id="inflowpay-card-element-container",document.body.appendChild(t),E=t}const l={container:E,paymentId:e.paymentId,...e.style&&{style:e.style},...e.buttonText&&{buttonText:e.buttonText},...e.placeholders&&{placeholders:e.placeholders},onComplete:t=>{e.onComplete&&e.onComplete(t)},onError:e.onError,onClose:e.onClose},C=this.sdk.createCardElement(l);if(e.onReady){const t=C.mount.bind(C);C.mount=()=>{t(),setTimeout(()=>{e.onReady&&e.onReady()},100)}}return e.onChange&&setTimeout(()=>{e.onChange&&e.onChange({complete:!1})},100),C}getSDK(){return this.sdk}}var i=(n=>(n.INITIATION="INITIATION",n.CHECKOUT_PENDING="CHECKOUT_PENDING",n.CHECKOUT_SUCCESS="CHECKOUT_SUCCESS",n.CHECKOUT_CANCELED="CHECKOUT_CANCELED",n.CANCELED="CANCELED",n.PAYMENT_RECEIVED="PAYMENT_RECEIVED",n.PAYMENT_SUCCESS="PAYMENT_SUCCESS",n.PAYMENT_FAILED="PAYMENT_FAILED",n))(i||{});const a="0.5.0";exports.CardElement=o.CardElement;exports.PaymentSDK=o.PaymentSDK;exports.SDK=o.SDK;exports.InflowPayProvider=d;exports.PaymentStatus=i;exports.VERSION=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./payment-sdk-CvXfOxY6.js");class d{constructor(e){const E={apiKey:e.config.apiKey,iframeUrl:e.config.iframeUrl,timeout:e.config.timeout,debug:e.config.debug};this.sdk=new o.PaymentSDK(E)}createCardElement(e){let E;if(e.container)E=e.container;else{const t=document.createElement("div");t.id="inflowpay-card-element-container",document.body.appendChild(t),E=t}const l={container:E,paymentId:e.paymentId,...e.style&&{style:e.style},...e.buttonText&&{buttonText:e.buttonText},...e.placeholders&&{placeholders:e.placeholders},onComplete:t=>{e.onComplete&&e.onComplete(t)},onError:e.onError,onClose:e.onClose},C=this.sdk.createCardElement(l);if(e.onReady){const t=C.mount.bind(C);C.mount=()=>{t(),setTimeout(()=>{e.onReady&&e.onReady()},100)}}return e.onChange&&setTimeout(()=>{e.onChange&&e.onChange({complete:!1})},100),C}getSDK(){return this.sdk}}var i=(n=>(n.INITIATION="INITIATION",n.CHECKOUT_PENDING="CHECKOUT_PENDING",n.CHECKOUT_SUCCESS="CHECKOUT_SUCCESS",n.CHECKOUT_CANCELED="CHECKOUT_CANCELED",n.CANCELED="CANCELED",n.PAYMENT_RECEIVED="PAYMENT_RECEIVED",n.PAYMENT_SUCCESS="PAYMENT_SUCCESS",n.PAYMENT_FAILED="PAYMENT_FAILED",n))(i||{});const a="0.6.0";exports.CardElement=o.CardElement;exports.PaymentSDK=o.PaymentSDK;exports.SDK=o.SDK;exports.InflowPayProvider=d;exports.PaymentStatus=i;exports.VERSION=a;
2
2
  //# sourceMappingURL=sdk.cjs.map
package/dist/sdk.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.cjs","sources":["../src/inflowpay-provider.ts","../src/index.ts"],"sourcesContent":["/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.5.0';\n"],"names":["InflowPayProvider","options","config","PaymentSDK","props","container","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":"6HA6DO,MAAMA,CAAkB,CAG7B,YAAYC,EAA8C,CACxD,MAAMC,EAA2B,CAC/B,OAAQD,EAAQ,OAAO,OACvB,UAAWA,EAAQ,OAAO,UAC1B,QAASA,EAAQ,OAAO,QACxB,MAAOA,EAAQ,OAAO,KAAA,EAGxB,KAAK,IAAM,IAAIE,EAAAA,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/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.6.0';\n"],"names":["InflowPayProvider","options","config","PaymentSDK","props","container","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":"6HA6DO,MAAMA,CAAkB,CAG7B,YAAYC,EAA8C,CACxD,MAAMC,EAA2B,CAC/B,OAAQD,EAAQ,OAAO,OACvB,UAAWA,EAAQ,OAAO,UAC1B,QAASA,EAAQ,OAAO,QACxB,MAAOA,EAAQ,OAAO,KAAA,EAGxB,KAAK,IAAM,IAAIE,EAAAA,WAAWD,CAAM,CAClC,CAQA,kBAAkBE,EAAsC,CACtD,IAAIC,EACJ,GAAID,EAAM,UACRC,EAAYD,EAAM,cACb,CACL,MAAME,EAAmB,SAAS,cAAc,KAAK,EACrDA,EAAiB,GAAK,mCACtB,SAAS,KAAK,YAAYA,CAAgB,EAC1CD,EAAYC,CACd,CAEA,MAAMC,EAAyC,CAC7C,UAAAF,EACA,UAAWD,EAAM,UACjB,GAAIA,EAAM,OAAS,CAAE,MAAOA,EAAM,KAAA,EAClC,GAAIA,EAAM,YAAc,CAAE,WAAYA,EAAM,UAAA,EAC5C,GAAIA,EAAM,cAAgB,CAAE,aAAcA,EAAM,YAAA,EAChD,WAAaI,GAAW,CAClBJ,EAAM,YACRA,EAAM,WAAWI,CAAM,CAE3B,EACA,QAASJ,EAAM,QACf,QAASA,EAAM,OAAA,EAGXK,EAAc,KAAK,IAAI,kBAAkBF,CAAkB,EAEjE,GAAIH,EAAM,QAAS,CACjB,MAAMM,EAAgBD,EAAY,MAAM,KAAKA,CAAW,EACxDA,EAAY,MAAQ,IAAM,CACxBC,EAAA,EACA,WAAW,IAAM,CACXN,EAAM,SACRA,EAAM,QAAA,CAEV,EAAG,GAAG,CACR,CACF,CAEA,OAAIA,EAAM,UACR,WAAW,IAAM,CACXA,EAAM,UACRA,EAAM,SAAS,CAAE,SAAU,EAAA,CAAO,CAEtC,EAAG,GAAG,EAGDK,CACT,CAKA,QAAqB,CACnB,OAAO,KAAK,GACd,CACF,CCtHO,IAAKE,GAAAA,IACVA,EAAA,WAAa,aACbA,EAAA,iBAAmB,mBACnBA,EAAA,iBAAmB,mBACnBA,EAAA,kBAAoB,oBACpBA,EAAA,SAAW,WACXA,EAAA,iBAAmB,mBACnBA,EAAA,gBAAkB,kBAClBA,EAAA,eAAiB,iBARPA,IAAAA,GAAA,CAAA,CAAA,EA+BL,MAAMC,EAAU"}
package/dist/sdk.d.ts CHANGED
@@ -96,6 +96,7 @@ declare interface CSSProperties {
96
96
  fieldErrorColor?: string;
97
97
  generalError?: GeneralMessageStyles;
98
98
  generalSuccess?: GeneralMessageStyles;
99
+ /** @deprecated Use base styles for light theme customization. This property will be removed in a future version. */
99
100
  light?: ThemeStyles;
100
101
  dark?: ThemeStyles;
101
102
  }
@@ -422,6 +423,6 @@ export declare interface TransactionData {
422
423
  [key: string]: any;
423
424
  }
424
425
 
425
- export declare const VERSION = "0.5.0";
426
+ export declare const VERSION = "0.6.0";
426
427
 
427
428
  export { }
package/dist/sdk.esm.js CHANGED
@@ -56,7 +56,7 @@ class d {
56
56
  }
57
57
  }
58
58
  var l = /* @__PURE__ */ ((n) => (n.INITIATION = "INITIATION", n.CHECKOUT_PENDING = "CHECKOUT_PENDING", n.CHECKOUT_SUCCESS = "CHECKOUT_SUCCESS", n.CHECKOUT_CANCELED = "CHECKOUT_CANCELED", n.CANCELED = "CANCELED", n.PAYMENT_RECEIVED = "PAYMENT_RECEIVED", n.PAYMENT_SUCCESS = "PAYMENT_SUCCESS", n.PAYMENT_FAILED = "PAYMENT_FAILED", n))(l || {});
59
- const a = "0.5.0";
59
+ const a = "0.6.0";
60
60
  export {
61
61
  m as CardElement,
62
62
  d as InflowPayProvider,
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.esm.js","sources":["../src/inflowpay-provider.ts","../src/index.ts"],"sourcesContent":["/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.5.0';\n"],"names":["InflowPayProvider","options","config","PaymentSDK","props","container","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":";;AA6DO,MAAMA,EAAkB;AAAA,EAG7B,YAAYC,GAA8C;AACxD,UAAMC,IAA2B;AAAA,MAC/B,QAAQD,EAAQ,OAAO;AAAA,MACvB,WAAWA,EAAQ,OAAO;AAAA,MAC1B,SAASA,EAAQ,OAAO;AAAA,MACxB,OAAOA,EAAQ,OAAO;AAAA,IAAA;AAGxB,SAAK,MAAM,IAAIE,EAAWD,CAAM;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,kBAAkBE,GAAsC;AACtD,QAAIC;AACJ,QAAID,EAAM;AACR,MAAAC,IAAYD,EAAM;AAAA,SACb;AACL,YAAME,IAAmB,SAAS,cAAc,KAAK;AACrD,MAAAA,EAAiB,KAAK,oCACtB,SAAS,KAAK,YAAYA,CAAgB,GAC1CD,IAAYC;AAAA,IACd;AAEA,UAAMC,IAAyC;AAAA,MAC7C,WAAAF;AAAA,MACA,WAAWD,EAAM;AAAA,MACjB,GAAIA,EAAM,SAAS,EAAE,OAAOA,EAAM,MAAA;AAAA,MAClC,GAAIA,EAAM,cAAc,EAAE,YAAYA,EAAM,WAAA;AAAA,MAC5C,GAAIA,EAAM,gBAAgB,EAAE,cAAcA,EAAM,aAAA;AAAA,MAChD,YAAY,CAACI,MAAW;AACtB,QAAIJ,EAAM,cACRA,EAAM,WAAWI,CAAM;AAAA,MAE3B;AAAA,MACA,SAASJ,EAAM;AAAA,MACf,SAASA,EAAM;AAAA,IAAA,GAGXK,IAAc,KAAK,IAAI,kBAAkBF,CAAkB;AAEjE,QAAIH,EAAM,SAAS;AACjB,YAAMM,IAAgBD,EAAY,MAAM,KAAKA,CAAW;AACxD,MAAAA,EAAY,QAAQ,MAAM;AACxB,QAAAC,EAAA,GACA,WAAW,MAAM;AACf,UAAIN,EAAM,WACRA,EAAM,QAAA;AAAA,QAEV,GAAG,GAAG;AAAA,MACR;AAAA,IACF;AAEA,WAAIA,EAAM,YACR,WAAW,MAAM;AACf,MAAIA,EAAM,YACRA,EAAM,SAAS,EAAE,UAAU,GAAA,CAAO;AAAA,IAEtC,GAAG,GAAG,GAGDK;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,SAAqB;AACnB,WAAO,KAAK;AAAA,EACd;AACF;ACtHO,IAAKE,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,mBAAmB,oBACnBA,EAAA,mBAAmB,oBACnBA,EAAA,oBAAoB,qBACpBA,EAAA,WAAW,YACXA,EAAA,mBAAmB,oBACnBA,EAAA,kBAAkB,mBAClBA,EAAA,iBAAiB,kBARPA,IAAAA,KAAA,CAAA,CAAA;AA+BL,MAAMC,IAAU;"}
1
+ {"version":3,"file":"sdk.esm.js","sources":["../src/inflowpay-provider.ts","../src/index.ts"],"sourcesContent":["/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.6.0';\n"],"names":["InflowPayProvider","options","config","PaymentSDK","props","container","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":";;AA6DO,MAAMA,EAAkB;AAAA,EAG7B,YAAYC,GAA8C;AACxD,UAAMC,IAA2B;AAAA,MAC/B,QAAQD,EAAQ,OAAO;AAAA,MACvB,WAAWA,EAAQ,OAAO;AAAA,MAC1B,SAASA,EAAQ,OAAO;AAAA,MACxB,OAAOA,EAAQ,OAAO;AAAA,IAAA;AAGxB,SAAK,MAAM,IAAIE,EAAWD,CAAM;AAAA,EAClC;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,EAAA,WAAW,YACXA,EAAA,mBAAmB,oBACnBA,EAAA,kBAAkB,mBAClBA,EAAA,iBAAiB,kBARPA,IAAAA,KAAA,CAAA,CAAA;AA+BL,MAAMC,IAAU;"}
package/dist/sdk.umd.js CHANGED
@@ -174,5 +174,5 @@
174
174
  width: 100%;
175
175
  height: 100%;
176
176
  border: none;
177
- `,a.setAttribute("allow","payment"),a.setAttribute("sandbox","allow-forms allow-scripts allow-same-origin allow-popups"),s.appendChild(a),o.appendChild(n),o.appendChild(s),i.appendChild(o),document.body.appendChild(i);const w=i.querySelector("#inflowpay-3ds-close"),h=()=>{i.remove(),window.removeEventListener("message",c),t(!1)};w?.addEventListener("click",h);const c=l=>{if(!l.data)return;const g=["https://dev.api.inflowpay.com","https://pre-prod.api.inflowpay.xyz","https://api.inflowpay.xyz"];if(this.environment==="sandbox"||this.environment==="development"){if(!(l.origin.includes("localhost")||l.origin.includes("127.0.0.1"))){if(!g.includes(l.origin)){this.config.debug&&console.warn("[SDK] Rejected 3DS message from unauthorized origin:",l.origin);return}}}else if(!g.includes(l.origin)){this.config.debug&&console.warn("[SDK] Rejected 3DS message from unauthorized origin:",l.origin);return}const m=l.data,f=m.type==="THREE_DS_COMPLETE"||m.type==="3ds-complete",u=m.status==="success",y=m.status==="failed"||m.status==="failure";if(f&&u){i.remove(),window.removeEventListener("message",c),t(!0);return}if(u&&!f){i.remove(),window.removeEventListener("message",c),t(!0);return}if(f&&y||m.type==="3ds-failed"||y){i.remove(),window.removeEventListener("message",c),t(!1);return}};window.addEventListener("message",c)})}getTargetOrigin(){return this.environment==="production"||this.environment==="preprod"?new URL(this.iframeUrl).origin:"*"}getEnvironmentFromApiKey(e){return!e||e.includes("_local_")||e.startsWith("inflow_local_")?"sandbox":e.includes("_prod_")&&!e.includes("_preprod_")?"production":e.includes("_preprod_")||e.startsWith("inflow_preprod_")?"preprod":e.includes("_dev_")?"development":"sandbox"}destroy(){this.close()}}class b{constructor(e,t){this.mounted=!1;let i;if(typeof t.container=="string"){if(i=document.querySelector(t.container),!i)throw new Error(`Container not found: ${t.container}`)}else i=t.container;this.container=i,this.sdk=new p({iframeUrl:e.iframeUrl,apiKey:e.apiKey,container:this.container,config:{paymentId:t.paymentId,...t.style&&{style:t.style},...t.buttonText&&{buttonText:t.buttonText},...t.placeholders&&{placeholders:t.placeholders}},onSuccess:o=>{t.onComplete&&t.onComplete({status:o?.data?.transaction?.status||"CHECKOUT_SUCCESS",data:o})},onError:o=>{t.onError?t.onError(o):t.onComplete&&t.onComplete({status:"PAYMENT_FAILED",error:o})},onClose:()=>{t.onClose&&t.onClose()}})}mount(){if(this.mounted)throw new Error("CardElement is already mounted");this.sdk.init(),this.mounted=!0}destroy(){this.mounted&&(this.sdk.destroy(),this.mounted=!1)}}class C{constructor(e){if(!e.apiKey||typeof e.apiKey!="string")throw new Error("API key is required");let t=e.iframeUrl;const i=this.getEnvironmentFromApiKey(e.apiKey);t||(i==="production"?t="https://api.inflowpay.xyz/iframe/checkout":i==="preprod"?t="https://pre-prod.api.inflowpay.xyz/iframe/checkout":i==="development"?t="https://dev.api.inflowpay.com/iframe/checkout":t="http://localhost:3000/iframe/checkout");const o=e.debug??!1;o&&(i==="production"||i==="preprod")&&console.warn("[InflowPay SDK] Debug mode is not allowed in production/pre-prod environments. Debug mode disabled.");const n=o&&(i==="sandbox"||i==="development");this.config={apiKey:e.apiKey,iframeUrl:t,timeout:e.timeout??3e4,debug:n}}createCardElement(e){return new b(this.config,e)}getIframeUrl(){return this.config.iframeUrl}getApiKey(){return this.config.apiKey}getEnvironmentFromApiKey(e){return e.includes("_local_")||e.startsWith("inflow_local_")?"sandbox":e.includes("_prod_")&&!e.includes("_preprod_")?"production":e.includes("_preprod_")||e.startsWith("inflow_preprod_")?"preprod":e.includes("_dev_")?"development":"sandbox"}}class k{constructor(e){const t={apiKey:e.config.apiKey,iframeUrl:e.config.iframeUrl,timeout:e.config.timeout,debug:e.config.debug};this.sdk=new C(t)}createCardElement(e){let t;if(e.container)t=e.container;else{const n=document.createElement("div");n.id="inflowpay-card-element-container",document.body.appendChild(n),t=n}const i={container:t,paymentId:e.paymentId,...e.style&&{style:e.style},...e.buttonText&&{buttonText:e.buttonText},...e.placeholders&&{placeholders:e.placeholders},onComplete:n=>{e.onComplete&&e.onComplete(n)},onError:e.onError,onClose:e.onClose},o=this.sdk.createCardElement(i);if(e.onReady){const n=o.mount.bind(o);o.mount=()=>{n(),setTimeout(()=>{e.onReady&&e.onReady()},100)}}return e.onChange&&setTimeout(()=>{e.onChange&&e.onChange({complete:!1})},100),o}getSDK(){return this.sdk}}var S=(r=>(r.INITIATION="INITIATION",r.CHECKOUT_PENDING="CHECKOUT_PENDING",r.CHECKOUT_SUCCESS="CHECKOUT_SUCCESS",r.CHECKOUT_CANCELED="CHECKOUT_CANCELED",r.CANCELED="CANCELED",r.PAYMENT_RECEIVED="PAYMENT_RECEIVED",r.PAYMENT_SUCCESS="PAYMENT_SUCCESS",r.PAYMENT_FAILED="PAYMENT_FAILED",r))(S||{});const v="0.5.0";d.CardElement=b,d.InflowPayProvider=k,d.PaymentSDK=C,d.PaymentStatus=S,d.SDK=p,d.VERSION=v,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
177
+ `,a.setAttribute("allow","payment"),a.setAttribute("sandbox","allow-forms allow-scripts allow-same-origin allow-popups"),s.appendChild(a),o.appendChild(n),o.appendChild(s),i.appendChild(o),document.body.appendChild(i);const w=i.querySelector("#inflowpay-3ds-close"),h=()=>{i.remove(),window.removeEventListener("message",c),t(!1)};w?.addEventListener("click",h);const c=l=>{if(!l.data)return;const g=["https://dev.api.inflowpay.com","https://pre-prod.api.inflowpay.xyz","https://api.inflowpay.xyz"];if(this.environment==="sandbox"||this.environment==="development"){if(!(l.origin.includes("localhost")||l.origin.includes("127.0.0.1"))){if(!g.includes(l.origin)){this.config.debug&&console.warn("[SDK] Rejected 3DS message from unauthorized origin:",l.origin);return}}}else if(!g.includes(l.origin)){this.config.debug&&console.warn("[SDK] Rejected 3DS message from unauthorized origin:",l.origin);return}const m=l.data,f=m.type==="THREE_DS_COMPLETE"||m.type==="3ds-complete",u=m.status==="success",y=m.status==="failed"||m.status==="failure";if(f&&u){i.remove(),window.removeEventListener("message",c),t(!0);return}if(u&&!f){i.remove(),window.removeEventListener("message",c),t(!0);return}if(f&&y||m.type==="3ds-failed"||y){i.remove(),window.removeEventListener("message",c),t(!1);return}};window.addEventListener("message",c)})}getTargetOrigin(){return this.environment==="production"||this.environment==="preprod"?new URL(this.iframeUrl).origin:"*"}getEnvironmentFromApiKey(e){return!e||e.includes("_local_")||e.startsWith("inflow_local_")?"sandbox":e.includes("_prod_")&&!e.includes("_preprod_")?"production":e.includes("_preprod_")||e.startsWith("inflow_preprod_")?"preprod":e.includes("_dev_")?"development":"sandbox"}destroy(){this.close()}}class b{constructor(e,t){this.mounted=!1;let i;if(typeof t.container=="string"){if(i=document.querySelector(t.container),!i)throw new Error(`Container not found: ${t.container}`)}else i=t.container;this.container=i,this.sdk=new p({iframeUrl:e.iframeUrl,apiKey:e.apiKey,container:this.container,config:{paymentId:t.paymentId,...t.style&&{style:t.style},...t.buttonText&&{buttonText:t.buttonText},...t.placeholders&&{placeholders:t.placeholders}},onSuccess:o=>{t.onComplete&&t.onComplete({status:o?.data?.transaction?.status||"CHECKOUT_SUCCESS",data:o})},onError:o=>{t.onError?t.onError(o):t.onComplete&&t.onComplete({status:"PAYMENT_FAILED",error:o})},onClose:()=>{t.onClose&&t.onClose()}})}mount(){if(this.mounted)throw new Error("CardElement is already mounted");this.sdk.init(),this.mounted=!0}destroy(){this.mounted&&(this.sdk.destroy(),this.mounted=!1)}}class C{constructor(e){if(!e.apiKey||typeof e.apiKey!="string")throw new Error("API key is required");let t=e.iframeUrl;const i=this.getEnvironmentFromApiKey(e.apiKey);t||(i==="production"?t="https://api.inflowpay.xyz/iframe/checkout":i==="preprod"?t="https://pre-prod.api.inflowpay.xyz/iframe/checkout":i==="development"?t="https://dev.api.inflowpay.com/iframe/checkout":t="http://localhost:3000/iframe/checkout");const o=e.debug??!1;o&&(i==="production"||i==="preprod")&&console.warn("[InflowPay SDK] Debug mode is not allowed in production/pre-prod environments. Debug mode disabled.");const n=o&&(i==="sandbox"||i==="development");this.config={apiKey:e.apiKey,iframeUrl:t,timeout:e.timeout??3e4,debug:n}}createCardElement(e){return new b(this.config,e)}getIframeUrl(){return this.config.iframeUrl}getApiKey(){return this.config.apiKey}getEnvironmentFromApiKey(e){return e.includes("_local_")||e.startsWith("inflow_local_")?"sandbox":e.includes("_prod_")&&!e.includes("_preprod_")?"production":e.includes("_preprod_")||e.startsWith("inflow_preprod_")?"preprod":e.includes("_dev_")?"development":"sandbox"}}class k{constructor(e){const t={apiKey:e.config.apiKey,iframeUrl:e.config.iframeUrl,timeout:e.config.timeout,debug:e.config.debug};this.sdk=new C(t)}createCardElement(e){let t;if(e.container)t=e.container;else{const n=document.createElement("div");n.id="inflowpay-card-element-container",document.body.appendChild(n),t=n}const i={container:t,paymentId:e.paymentId,...e.style&&{style:e.style},...e.buttonText&&{buttonText:e.buttonText},...e.placeholders&&{placeholders:e.placeholders},onComplete:n=>{e.onComplete&&e.onComplete(n)},onError:e.onError,onClose:e.onClose},o=this.sdk.createCardElement(i);if(e.onReady){const n=o.mount.bind(o);o.mount=()=>{n(),setTimeout(()=>{e.onReady&&e.onReady()},100)}}return e.onChange&&setTimeout(()=>{e.onChange&&e.onChange({complete:!1})},100),o}getSDK(){return this.sdk}}var S=(r=>(r.INITIATION="INITIATION",r.CHECKOUT_PENDING="CHECKOUT_PENDING",r.CHECKOUT_SUCCESS="CHECKOUT_SUCCESS",r.CHECKOUT_CANCELED="CHECKOUT_CANCELED",r.CANCELED="CANCELED",r.PAYMENT_RECEIVED="PAYMENT_RECEIVED",r.PAYMENT_SUCCESS="PAYMENT_SUCCESS",r.PAYMENT_FAILED="PAYMENT_FAILED",r))(S||{});const v="0.6.0";d.CardElement=b,d.InflowPayProvider=k,d.PaymentSDK=C,d.PaymentStatus=S,d.SDK=p,d.VERSION=v,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
178
178
  //# sourceMappingURL=sdk.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.umd.js","sources":["../src/sdk.ts","../src/card-element.ts","../src/payment-sdk.ts","../src/inflowpay-provider.ts","../src/index.ts"],"sourcesContent":["/**\n * InflowPay SDK v2 - Iframe-based Payment SDK\n * \n * This SDK creates an iframe and communicates with a React payment application\n * using postMessage API for secure cross-origin communication.\n */\n\nimport type { SDKConfig, IframeMessage } from './types';\n\nexport class SDK {\n private iframe: HTMLIFrameElement | null = null;\n private iframeUrl: string;\n private config: SDKConfig;\n private messageListener: ((event: MessageEvent) => void) | null = null;\n private containerElement: HTMLElement | null = null;\n private usePopup: boolean;\n private environment: 'sandbox' | 'production' | 'development' | 'preprod';\n\n constructor(config: SDKConfig) {\n this.config = config;\n this.iframeUrl = config.iframeUrl || 'http://localhost:3000/iframe/checkout';\n this.environment = this.getEnvironmentFromApiKey(config.apiKey || '');\n\n // Determine if we should use popup or inline\n this.usePopup = !config.container;\n\n // Resolve container if provided\n if (config.container) {\n if (typeof config.container === 'string') {\n this.containerElement = document.querySelector(config.container);\n if (!this.containerElement) {\n throw new Error(`Container not found: ${config.container}`);\n }\n } else {\n this.containerElement = config.container;\n }\n }\n }\n\n /**\n * Initialize and open the payment iframe\n */\n init(): void {\n if (this.iframe) {\n return;\n }\n\n this.createIframe();\n this.addMessageListener();\n }\n\n /**\n * Create and append the iframe to the document\n */\n private createIframe(): void {\n // Build iframe URL with API key and paymentId as query parameters\n const url = new URL(this.iframeUrl);\n if (this.config.apiKey) {\n url.searchParams.set('apiKey', this.config.apiKey);\n }\n if (this.config.config?.paymentId) {\n url.searchParams.set('paymentId', this.config.config.paymentId);\n }\n const iframeSrc = url.toString();\n\n if (this.usePopup) {\n // Create overlay for popup mode\n const overlay = document.createElement('div');\n overlay.id = 'inflowpay-sdk-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999999;\n `;\n\n // Create iframe container\n const container = document.createElement('div');\n container.style.cssText = `\n position: relative;\n width: 90%;\n max-width: 500px;\n height: 90%;\n max-height: 600px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n `;\n\n // Create close button\n const closeButton = document.createElement('button');\n closeButton.innerHTML = '×';\n closeButton.style.cssText = `\n position: absolute;\n top: 10px;\n right: 10px;\n width: 30px;\n height: 30px;\n border: none;\n background: transparent;\n font-size: 24px;\n cursor: pointer;\n z-index: 1000000;\n color: #333;\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n closeButton.onclick = () => this.close();\n\n // Create iframe\n this.iframe = document.createElement('iframe');\n this.iframe.src = iframeSrc;\n this.iframe.style.cssText = `\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 8px;\n `;\n this.iframe.setAttribute('allow', 'payment');\n\n // Assemble structure\n container.appendChild(closeButton);\n container.appendChild(this.iframe);\n overlay.appendChild(container);\n document.body.appendChild(overlay);\n\n // Show loader\n this.showLoader(container);\n\n // Close on overlay click (but not on container click)\n overlay.addEventListener('click', (e) => {\n if (e.target === overlay) {\n this.close();\n }\n });\n } else {\n // Inline mode - mount directly in container\n if (!this.containerElement) {\n throw new Error('Container element is required for inline mode');\n }\n\n // Clear container\n this.containerElement.innerHTML = '';\n\n // Set container styles for seamless integration\n if (this.containerElement instanceof HTMLElement) {\n const currentStyle = this.containerElement.getAttribute('style') || '';\n if (!currentStyle.includes('min-height')) {\n this.containerElement.style.minHeight = '196px';\n }\n if (!currentStyle.includes('position')) {\n this.containerElement.style.position = 'relative';\n }\n if (!currentStyle.includes('overflow')) {\n this.containerElement.style.overflow = 'hidden';\n }\n }\n\n // Create iframe\n this.iframe = document.createElement('iframe');\n this.iframe.src = iframeSrc;\n\n const iframeWidth = this.config.config?.style?.fillParent ? '100%' : '344px';\n const iframeMaxWidth = this.config.config?.style?.fillParent ? 'none' : '100%';\n\n this.iframe.style.cssText = `\n width: ${iframeWidth};\n max-width: ${iframeMaxWidth};\n height: 196px;\n min-height: 196px;\n border: none;\n display: block;\n transition: height 0.2s ease;\n `;\n\n this.iframe.setAttribute('allow', 'payment');\n\n // Append to container\n this.containerElement.appendChild(this.iframe);\n\n // Show loader\n this.showLoader(this.containerElement);\n }\n }\n\n /**\n * Add message listener for communication with iframe\n */\n private addMessageListener(): void {\n this.messageListener = (event: MessageEvent) => {\n const allowedOrigin = new URL(this.iframeUrl).origin;\n const isExactMatch = event.origin === allowedOrigin;\n\n let isAllowedOrigin = isExactMatch;\n\n if (!isAllowedOrigin) {\n if (this.environment === 'sandbox' || this.environment === 'development') {\n const isLocalhostDev =\n (event.origin.includes('localhost') || event.origin.includes('127.0.0.1')) &&\n (allowedOrigin.includes('localhost') || allowedOrigin.includes('127.0.0.1'));\n isAllowedOrigin = isLocalhostDev;\n }\n\n if (!isAllowedOrigin) {\n const isAllowedApiOrigin =\n event.origin === 'https://dev.api.inflowpay.com' ||\n event.origin === 'https://pre-prod.api.inflowpay.xyz' ||\n event.origin === 'https://api.inflowpay.xyz';\n isAllowedOrigin = isAllowedApiOrigin;\n }\n }\n\n if (!isAllowedOrigin) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected message from unauthorized origin:', event.origin);\n }\n return;\n }\n\n const data = event.data as IframeMessage;\n\n if (!data || !data.type) {\n return;\n }\n\n switch (data.type) {\n case 'iframe-ready':\n // Wait for iframe's javascript to be ready before sending config\n this.hideLoader();\n this.sendConfigToIframe();\n break;\n\n case 'content-height':\n // Adjust iframe height based on content\n if (data.height && this.iframe) {\n const height = Math.max(data.height, 196); // Minimum 196px\n this.iframe.style.height = `${height}px`;\n if (this.containerElement) {\n this.containerElement.style.minHeight = `${height}px`;\n }\n }\n break;\n\n case 'close':\n this.close();\n break;\n\n case 'success':\n if (this.config.onSuccess) {\n this.config.onSuccess(data.data);\n }\n break;\n\n case 'error':\n if (this.config.onError) {\n this.config.onError(data.data);\n }\n break;\n\n case '3ds-required':\n // Iframe requests SDK to open 3DS popup\n if (this.config.debug) {\n console.log('[SDK] Received 3DS request:', data.threeDsSessionUrl);\n }\n if (data.threeDsSessionUrl) {\n if (this.config.debug) {\n console.log('[SDK] Opening 3DS modal...');\n }\n this.open3DSModal(data.threeDsSessionUrl).then((success) => {\n if (this.config.debug) {\n console.log('[SDK] 3DS modal closed, result:', success);\n }\n if (this.iframe && this.iframe.contentWindow) {\n const targetOrigin = this.getTargetOrigin();\n this.iframe.contentWindow.postMessage({\n type: '3ds-result',\n success: success,\n paymentId: data.paymentId || this.config.config?.paymentId,\n }, targetOrigin);\n }\n });\n } else {\n if (this.config.debug) {\n console.error('[SDK] 3DS required but no threeDsSessionUrl provided');\n }\n }\n break;\n\n default:\n if (this.config.debug) {\n console.log('SDK: Received message:', data);\n }\n }\n };\n\n window.addEventListener('message', this.messageListener);\n }\n\n /**\n * Send configuration to the iframe\n */\n private sendConfigToIframe(): void {\n if (!this.iframe || !this.iframe.contentWindow) {\n // Wait for iframe to load\n if (this.iframe) {\n this.iframe.onload = () => {\n this.sendConfigToIframe();\n };\n }\n return;\n }\n\n const message: IframeMessage = {\n type: 'sdkData',\n config: {\n ...(this.config.config || {}),\n paymentId: this.config.config?.paymentId\n },\n data: {\n apiKey: this.config.apiKey,\n },\n };\n\n const targetOrigin = this.getTargetOrigin();\n this.iframe.contentWindow.postMessage(message, targetOrigin);\n }\n\n /**\n * Show skeleton loader while iframe is connecting\n */\n private showLoader(container: HTMLElement): void {\n // Hide iframe while loader is showing\n if (this.iframe) {\n this.iframe.style.display = 'none';\n }\n \n // Detect dark mode\n const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n \n // Color scheme based on dark mode\n const inputBgColor = isDarkMode ? '#2d2d2d' : '#F5F5F5';\n const shimmerBase = isDarkMode ? '#3d3d3d' : '#E5E5E5';\n const shimmerLight = isDarkMode ? '#4d4d4d' : '#F0F0F0';\n const shimmerGradient = `linear-gradient(90deg, ${shimmerBase} 25%, ${shimmerLight} 50%, ${shimmerBase} 75%)`;\n \n const loader = document.createElement('div');\n loader.id = 'inflowpay-loader';\n \n // Get container width to match SDK structure\n const containerWidth = this.config.config?.style?.fillParent ? '100%' : '344px';\n \n loader.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1000;\n padding: 20px;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n `;\n\n // Skeleton card element container (matching .inflowpay-card-element)\n const skeletonCard = document.createElement('div');\n skeletonCard.style.cssText = `\n width: ${containerWidth};\n max-width: 100%;\n margin: 0 auto;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n `;\n\n // Input container skeleton (matching .inflowpay-card-inp-wrap)\n const inputWrap = document.createElement('div');\n inputWrap.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n background-color: ${inputBgColor};\n padding: 8px;\n border-radius: 8px;\n margin-bottom: 20px;\n `;\n\n // Card number skeleton (flex: 1)\n const cardNumberSkeleton = document.createElement('div');\n cardNumberSkeleton.className = 'inflowpay-skeleton';\n cardNumberSkeleton.style.cssText = `\n flex: 1;\n min-width: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n // Expiry skeleton (21.5% width)\n const expirySkeleton = document.createElement('div');\n expirySkeleton.className = 'inflowpay-skeleton';\n expirySkeleton.style.cssText = `\n width: 21.5%;\n flex-shrink: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n // CVC skeleton (17.5% width)\n const cvcSkeleton = document.createElement('div');\n cvcSkeleton.className = 'inflowpay-skeleton';\n cvcSkeleton.style.cssText = `\n width: 17.5%;\n flex-shrink: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n inputWrap.appendChild(cardNumberSkeleton);\n inputWrap.appendChild(expirySkeleton);\n inputWrap.appendChild(cvcSkeleton);\n\n // Button skeleton (matching .inflowpay-button)\n const buttonSkeleton = document.createElement('div');\n buttonSkeleton.className = 'inflowpay-skeleton';\n buttonSkeleton.style.cssText = `\n width: 100%;\n height: 42px;\n border-radius: 8px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n margin-bottom: 16px;\n `;\n\n // Disclaimer skeleton (matching .inflowpay-disclaimer)\n const disclaimerSkeleton = document.createElement('div');\n disclaimerSkeleton.style.cssText = `\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n width: 100%;\n margin-top: 16px;\n `;\n\n const disclaimerIconSkeleton = document.createElement('div');\n disclaimerIconSkeleton.className = 'inflowpay-skeleton';\n disclaimerIconSkeleton.style.cssText = `\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n const disclaimerTextSkeleton = document.createElement('div');\n disclaimerTextSkeleton.className = 'inflowpay-skeleton';\n disclaimerTextSkeleton.style.cssText = `\n width: 80%;\n height: 16px;\n border-radius: 4px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n disclaimerSkeleton.appendChild(disclaimerIconSkeleton);\n disclaimerSkeleton.appendChild(disclaimerTextSkeleton);\n\n skeletonCard.appendChild(inputWrap);\n skeletonCard.appendChild(buttonSkeleton);\n skeletonCard.appendChild(disclaimerSkeleton);\n loader.appendChild(skeletonCard);\n\n // Add shimmer animation keyframes\n if (!document.getElementById('inflowpay-loader-styles')) {\n const style = document.createElement('style');\n style.id = 'inflowpay-loader-styles';\n style.textContent = `\n @keyframes inflowpay-shimmer {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n }\n `;\n document.head.appendChild(style);\n }\n\n container.appendChild(loader);\n }\n\n /**\n * Hide loader\n */\n private hideLoader(): void {\n const loader = document.getElementById('inflowpay-loader');\n if (loader) {\n loader.remove();\n }\n \n // Show iframe again when loader is hidden\n if (this.iframe) {\n this.iframe.style.display = '';\n }\n }\n\n /**\n * Close the iframe and cleanup\n */\n private close(): void {\n if (this.config.onClose) {\n this.config.onClose();\n }\n\n // Hide loader\n this.hideLoader();\n\n // Remove message listener\n if (this.messageListener) {\n window.removeEventListener('message', this.messageListener);\n this.messageListener = null;\n }\n\n if (this.usePopup) {\n // Remove overlay\n const overlay = document.getElementById('inflowpay-sdk-overlay');\n if (overlay) {\n overlay.remove();\n }\n } else {\n // Clear container\n if (this.containerElement) {\n this.containerElement.innerHTML = '';\n }\n }\n\n this.iframe = null;\n }\n\n /**\n * Open 3DS authentication modal\n * Called when iframe requests 3DS authentication\n */\n private open3DSModal(challengeUrl: string): Promise<boolean> {\n if (this.config.debug) {\n console.log('[SDK] open3DSModal called with URL:', challengeUrl);\n }\n return new Promise((resolve) => {\n // Create overlay\n const overlay = document.createElement('div');\n overlay.id = 'inflowpay-3ds-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999999;\n `;\n\n // Create modal\n const modal = document.createElement('div');\n modal.style.cssText = `\n position: relative;\n width: 90%;\n max-width: 500px;\n height: 90%;\n max-height: 600px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n display: flex;\n flex-direction: column;\n `;\n\n // Create header\n const header = document.createElement('div');\n header.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 15px 20px;\n border-bottom: 1px solid #e5e5e5;\n `;\n header.innerHTML = `\n <h3 style=\"margin: 0; font-size: 18px; font-weight: 600;\">Secure Payment Authentication</h3>\n <button id=\"inflowpay-3ds-close\" style=\"background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: #333;\">×</button>\n `;\n\n // Create content with iframe\n const content = document.createElement('div');\n content.style.cssText = `\n flex: 1;\n position: relative;\n overflow: hidden;\n `;\n const iframe = document.createElement('iframe');\n iframe.src = challengeUrl;\n iframe.style.cssText = `\n width: 100%;\n height: 100%;\n border: none;\n `;\n iframe.setAttribute('allow', 'payment');\n iframe.setAttribute('sandbox', 'allow-forms allow-scripts allow-same-origin allow-popups');\n content.appendChild(iframe);\n\n modal.appendChild(header);\n modal.appendChild(content);\n overlay.appendChild(modal);\n document.body.appendChild(overlay);\n\n // Close button handler\n const closeBtn = overlay.querySelector('#inflowpay-3ds-close');\n const closeHandler = () => {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(false);\n };\n closeBtn?.addEventListener('click', closeHandler);\n\n const messageHandler = (event: MessageEvent) => {\n if (!event.data) return;\n\n const allowed3DSOrigins = [\n 'https://dev.api.inflowpay.com',\n 'https://pre-prod.api.inflowpay.xyz',\n 'https://api.inflowpay.xyz',\n ];\n\n if (this.environment === 'sandbox' || this.environment === 'development') {\n if (event.origin.includes('localhost') || event.origin.includes('127.0.0.1')) {\n // Allow localhost in dev/sandbox\n } else if (!allowed3DSOrigins.includes(event.origin)) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected 3DS message from unauthorized origin:', event.origin);\n }\n return;\n }\n } else {\n if (!allowed3DSOrigins.includes(event.origin)) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected 3DS message from unauthorized origin:', event.origin);\n }\n return;\n }\n }\n\n const data = event.data;\n const is3DSComplete = data.type === 'THREE_DS_COMPLETE' || data.type === '3ds-complete';\n const isSuccess = data.status === 'success';\n const isFailure = data.status === 'failed' || data.status === 'failure';\n\n // Success case\n if (is3DSComplete && isSuccess) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(true);\n return;\n }\n\n // Also handle legacy format\n if (isSuccess && !is3DSComplete) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(true);\n return;\n }\n\n // Failure case\n if ((is3DSComplete && isFailure) || data.type === '3ds-failed' || isFailure) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(false);\n return;\n }\n };\n\n window.addEventListener('message', messageHandler);\n });\n }\n\n /**\n * Get target origin for postMessage based on environment\n * In production/pre-prod: use exact origin for security\n * In dev/sandbox: use wildcard for development flexibility\n */\n private getTargetOrigin(): string {\n if (this.environment === 'production' || this.environment === 'preprod') {\n return new URL(this.iframeUrl).origin;\n }\n return '*';\n }\n\n /**\n * Detect environment from API key\n */\n private getEnvironmentFromApiKey(apiKey: string): 'sandbox' | 'production' | 'development' | 'preprod' {\n if (!apiKey) return 'sandbox';\n if (apiKey.includes('_local_') || apiKey.startsWith('inflow_local_')) {\n return 'sandbox';\n } else if (apiKey.includes('_prod_') && !apiKey.includes('_preprod_')) {\n return 'production';\n } else if (apiKey.includes('_preprod_') || apiKey.startsWith('inflow_preprod_')) {\n return 'preprod';\n } else if (apiKey.includes('_dev_')) {\n return 'development';\n }\n return 'sandbox';\n }\n\n /**\n * Public method to close the iframe\n */\n public destroy(): void {\n this.close();\n }\n}\n\n","/**\n * CardElement - Iframe-based payment element\n * \n * Mounts an iframe with the payment checkout form\n */\n\nimport { SDK } from './sdk';\n\nimport type { CSSProperties } from './types';\n\nexport interface CardElementOptions {\n /** Container element or CSS selector where the iframe will be mounted */\n container: string | HTMLElement;\n /** Payment ID for this transaction */\n paymentId: string;\n /** Callback when payment completes */\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n /** Callback when payment fails */\n onError?: (error: any) => void;\n /** Callback when user closes the payment */\n onClose?: () => void;\n /** Custom styling for the card element */\n style?: CSSProperties;\n /** Custom button text (default: \"Complete Payment\") */\n buttonText?: string;\n /** Custom placeholder text for inputs */\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\ninterface InternalSDKConfig {\n apiKey: string;\n iframeUrl: string;\n timeout: number;\n debug: boolean;\n}\n\nexport class CardElement {\n private sdk: SDK;\n private container: HTMLElement;\n private mounted: boolean = false;\n\n constructor(\n config: InternalSDKConfig,\n options: CardElementOptions\n ) {\n let containerElement: HTMLElement | null;\n if (typeof options.container === 'string') {\n containerElement = document.querySelector(options.container);\n if (!containerElement) {\n throw new Error(`Container not found: ${options.container}`);\n }\n } else {\n containerElement = options.container;\n }\n this.container = containerElement;\n\n this.sdk = new SDK({\n iframeUrl: config.iframeUrl,\n apiKey: config.apiKey,\n container: this.container,\n config: {\n paymentId: options.paymentId,\n ...(options.style && { style: options.style }),\n ...(options.buttonText && { buttonText: options.buttonText }),\n ...(options.placeholders && { placeholders: options.placeholders }),\n },\n onSuccess: (data) => {\n if (options.onComplete) {\n options.onComplete({\n status: data?.data?.transaction?.status || 'CHECKOUT_SUCCESS',\n data: data,\n });\n }\n },\n onError: (error) => {\n if (options.onError) {\n options.onError(error);\n } else if (options.onComplete) {\n options.onComplete({\n status: 'PAYMENT_FAILED',\n error: error,\n });\n }\n },\n onClose: () => {\n if (options.onClose) {\n options.onClose();\n }\n },\n });\n }\n\n /**\n * Mount the CardElement to the DOM\n * This will create and display the iframe\n */\n mount(): void {\n if (this.mounted) {\n throw new Error('CardElement is already mounted');\n }\n\n this.sdk.init();\n this.mounted = true;\n }\n\n /**\n * Destroy the CardElement and cleanup\n */\n destroy(): void {\n if (this.mounted) {\n this.sdk.destroy();\n this.mounted = false;\n }\n }\n}\n","/**\n * InflowPay Payment SDK v2\n * \n * Provider class that manages global SDK configuration\n * Similar to the original SDK but uses iframe-based payment flow\n */\n\nimport type { SDKConfig, PaymentConfig, CSSProperties } from './types';\nimport { CardElement } from './card-element';\n\nexport interface PaymentSDKConfig {\n /** Public API key */\n apiKey: string;\n /** Backend API URL (optional, auto-detected from API key) */\n iframeUrl?: string;\n /** Request timeout in milliseconds (default: 30000) */\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport class PaymentSDK {\n private config: PaymentSDKConfig & { iframeUrl: string; timeout: number; debug: boolean };\n\n /**\n * Initialize the InflowPay Payment SDK\n * \n * @param config - SDK configuration\n * \n * @example\n * ```typescript\n * const sdk = new PaymentSDK({\n * apiKey: 'inflow_pub_local_xxx'\n * });\n * ```\n */\n constructor(config: PaymentSDKConfig) {\n // Validate API key\n if (!config.apiKey || typeof config.apiKey !== 'string') {\n throw new Error('API key is required');\n }\n\n // Auto-detect iframe URL from API key if not provided\n let iframeUrl = config.iframeUrl;\n const environment = this.getEnvironmentFromApiKey(config.apiKey);\n \n if (!iframeUrl) {\n if (environment === 'production') {\n iframeUrl = 'https://api.inflowpay.xyz/iframe/checkout';\n } else if (environment === 'preprod') {\n iframeUrl = 'https://pre-prod.api.inflowpay.xyz/iframe/checkout';\n } else if (environment === 'development') {\n iframeUrl = 'https://dev.api.inflowpay.com/iframe/checkout';\n } else {\n // sandbox/local\n iframeUrl = 'http://localhost:3000/iframe/checkout';\n }\n }\n\n // Validate debug mode - only allowed in local/dev environments\n const requestedDebug = config.debug ?? false;\n if (requestedDebug && (environment === 'production' || environment === 'preprod')) {\n console.warn('[InflowPay SDK] Debug mode is not allowed in production/pre-prod environments. Debug mode disabled.');\n }\n const debug = requestedDebug && (environment === 'sandbox' || environment === 'development');\n\n this.config = {\n apiKey: config.apiKey,\n iframeUrl,\n timeout: config.timeout ?? 30000,\n debug,\n };\n }\n\n /**\n * Create a CardElement for iframe-based payment UI\n * \n * @param options - CardElement configuration\n * @returns CardElement instance\n * \n * @example\n * ```typescript\n * const cardElement = sdk.createCardElement({\n * container: '#card-container',\n * paymentId: 'pay_123',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\n createCardElement(options: {\n container: string | HTMLElement;\n paymentId: string;\n style?: CSSProperties;\n buttonText?: string;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n }): CardElement {\n return new CardElement(this.config, options);\n }\n\n /**\n * Get the iframe URL being used\n */\n getIframeUrl(): string {\n return this.config.iframeUrl;\n }\n\n /**\n * Get the API key\n */\n getApiKey(): string {\n return this.config.apiKey;\n }\n\n /**\n * Auto-detect environment from API key\n */\n private getEnvironmentFromApiKey(apiKey: string): 'sandbox' | 'production' | 'development' | 'preprod' {\n if (apiKey.includes('_local_') || apiKey.startsWith('inflow_local_')) {\n return 'sandbox';\n } else if (apiKey.includes('_prod_') && !apiKey.includes('_preprod_')) {\n return 'production';\n } else if (apiKey.includes('_preprod_') || apiKey.startsWith('inflow_preprod_')) {\n return 'preprod';\n } else if (apiKey.includes('_dev_')) {\n return 'development';\n }\n return 'sandbox';\n }\n}\n\n","/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.5.0';\n"],"names":["SDK","config","url","iframeSrc","overlay","container","closeButton","e","currentStyle","iframeWidth","iframeMaxWidth","event","allowedOrigin","isAllowedOrigin","data","height","success","targetOrigin","message","isDarkMode","inputBgColor","shimmerBase","shimmerGradient","loader","containerWidth","skeletonCard","inputWrap","cardNumberSkeleton","expirySkeleton","cvcSkeleton","buttonSkeleton","disclaimerSkeleton","disclaimerIconSkeleton","disclaimerTextSkeleton","style","challengeUrl","resolve","modal","header","content","iframe","closeBtn","closeHandler","messageHandler","allowed3DSOrigins","is3DSComplete","isSuccess","isFailure","apiKey","CardElement","options","containerElement","error","PaymentSDK","iframeUrl","environment","requestedDebug","debug","InflowPayProvider","props","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":"oOASO,MAAMA,CAAI,CASf,YAAYC,EAAmB,CAS7B,GAjBF,KAAQ,OAAmC,KAG3C,KAAQ,gBAA0D,KAClE,KAAQ,iBAAuC,KAK7C,KAAK,OAASA,EACd,KAAK,UAAYA,EAAO,WAAa,wCACrC,KAAK,YAAc,KAAK,yBAAyBA,EAAO,QAAU,EAAE,EAGpE,KAAK,SAAW,CAACA,EAAO,UAGpBA,EAAO,UACT,GAAI,OAAOA,EAAO,WAAc,UAE9B,GADA,KAAK,iBAAmB,SAAS,cAAcA,EAAO,SAAS,EAC3D,CAAC,KAAK,iBACR,MAAM,IAAI,MAAM,wBAAwBA,EAAO,SAAS,EAAE,OAG5D,KAAK,iBAAmBA,EAAO,SAGrC,CAKA,MAAa,CACP,KAAK,SAIT,KAAK,aAAA,EACL,KAAK,mBAAA,EACP,CAKQ,cAAqB,CAE3B,MAAMC,EAAM,IAAI,IAAI,KAAK,SAAS,EAC9B,KAAK,OAAO,QACdA,EAAI,aAAa,IAAI,SAAU,KAAK,OAAO,MAAM,EAE/C,KAAK,OAAO,QAAQ,WACtBA,EAAI,aAAa,IAAI,YAAa,KAAK,OAAO,OAAO,SAAS,EAEhE,MAAMC,EAAYD,EAAI,SAAA,EAEtB,GAAI,KAAK,SAAU,CAEjB,MAAME,EAAU,SAAS,cAAc,KAAK,EAC5CA,EAAQ,GAAK,wBACbA,EAAQ,MAAM,QAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAcxB,MAAMC,EAAY,SAAS,cAAc,KAAK,EAC9CA,EAAU,MAAM,QAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAY1B,MAA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d,CAEA,MAAMC,EAAyC,CAC7C,UAAAxD,EACA,UAAWsD,EAAM,UACjB,GAAIA,EAAM,OAAS,CAAE,MAAOA,EAAM,KAAA,EAClC,GAAIA,EAAM,YAAc,CAAE,WAAYA,EAAM,UAAA,EAC5C,GAAIA,EAAM,cAAgB,CAAE,aAAcA,EAAM,YAAA,EAChD,WAAaG,GAAW,CAClBH,EAAM,YACRA,EAAM,WAAWG,CAAM,CAE3B,EACA,QAASH,EAAM,QACf,QAASA,EAAM,OAAA,EAGXI,EAAc,KAAK,IAAI,kBAAkBF,CAAkB,EAEjE,GAAIF,EAAM,QAAS,CACjB,MAAMK,EAAgBD,EAAY,MAAM,KAAKA,CAAW,EACxDA,EAAY,MAAQ,IAAM,CACxBC,EAAA,EACA,WAAW,IAAM,CACXL,EAAM,SACRA,EAAM,QAAA,CAEV,EAAG,GAAG,CACR,CACF,CAEA,OAAIA,EAAM,UACR,WAAW,IAAM,CACXA,EAAM,UACRA,EAAM,SAAS,CAAE,SAAU,EAAA,CAAO,CAEtC,EAAG,GAAG,EAGDI,CACT,CAKA,QAAqB,CACnB,OAAO,KAAK,GACd,CACF,CCtHO,IAAKE,GAAAA,IACVA,EAAA,WAAa,aACbA,EAAA,iBAAmB,mBACnBA,EAAA,iBAAmB,mBACnBA,EAAA,kBAAoB,oBACpBA,EAAA,SAAW,WACXA,EAAA,iBAAmB,mBACnBA,EAAA,gBAAkB,kBAClBA,EAAA,eAAiB,iBARPA,IAAAA,GAAA,CAAA,CAAA,EA+BL,MAAMC,EAAU"}
1
+ {"version":3,"file":"sdk.umd.js","sources":["../src/sdk.ts","../src/card-element.ts","../src/payment-sdk.ts","../src/inflowpay-provider.ts","../src/index.ts"],"sourcesContent":["/**\n * InflowPay SDK v2 - Iframe-based Payment SDK\n * \n * This SDK creates an iframe and communicates with a React payment application\n * using postMessage API for secure cross-origin communication.\n */\n\nimport type { SDKConfig, IframeMessage } from './types';\n\nexport class SDK {\n private iframe: HTMLIFrameElement | null = null;\n private iframeUrl: string;\n private config: SDKConfig;\n private messageListener: ((event: MessageEvent) => void) | null = null;\n private containerElement: HTMLElement | null = null;\n private usePopup: boolean;\n private environment: 'sandbox' | 'production' | 'development' | 'preprod';\n\n constructor(config: SDKConfig) {\n this.config = config;\n this.iframeUrl = config.iframeUrl || 'http://localhost:3000/iframe/checkout';\n this.environment = this.getEnvironmentFromApiKey(config.apiKey || '');\n\n // Determine if we should use popup or inline\n this.usePopup = !config.container;\n\n // Resolve container if provided\n if (config.container) {\n if (typeof config.container === 'string') {\n this.containerElement = document.querySelector(config.container);\n if (!this.containerElement) {\n throw new Error(`Container not found: ${config.container}`);\n }\n } else {\n this.containerElement = config.container;\n }\n }\n }\n\n /**\n * Initialize and open the payment iframe\n */\n init(): void {\n if (this.iframe) {\n return;\n }\n\n this.createIframe();\n this.addMessageListener();\n }\n\n /**\n * Create and append the iframe to the document\n */\n private createIframe(): void {\n // Build iframe URL with API key and paymentId as query parameters\n const url = new URL(this.iframeUrl);\n if (this.config.apiKey) {\n url.searchParams.set('apiKey', this.config.apiKey);\n }\n if (this.config.config?.paymentId) {\n url.searchParams.set('paymentId', this.config.config.paymentId);\n }\n const iframeSrc = url.toString();\n\n if (this.usePopup) {\n // Create overlay for popup mode\n const overlay = document.createElement('div');\n overlay.id = 'inflowpay-sdk-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999999;\n `;\n\n // Create iframe container\n const container = document.createElement('div');\n container.style.cssText = `\n position: relative;\n width: 90%;\n max-width: 500px;\n height: 90%;\n max-height: 600px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n `;\n\n // Create close button\n const closeButton = document.createElement('button');\n closeButton.innerHTML = '×';\n closeButton.style.cssText = `\n position: absolute;\n top: 10px;\n right: 10px;\n width: 30px;\n height: 30px;\n border: none;\n background: transparent;\n font-size: 24px;\n cursor: pointer;\n z-index: 1000000;\n color: #333;\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n closeButton.onclick = () => this.close();\n\n // Create iframe\n this.iframe = document.createElement('iframe');\n this.iframe.src = iframeSrc;\n this.iframe.style.cssText = `\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 8px;\n `;\n this.iframe.setAttribute('allow', 'payment');\n\n // Assemble structure\n container.appendChild(closeButton);\n container.appendChild(this.iframe);\n overlay.appendChild(container);\n document.body.appendChild(overlay);\n\n // Show loader\n this.showLoader(container);\n\n // Close on overlay click (but not on container click)\n overlay.addEventListener('click', (e) => {\n if (e.target === overlay) {\n this.close();\n }\n });\n } else {\n // Inline mode - mount directly in container\n if (!this.containerElement) {\n throw new Error('Container element is required for inline mode');\n }\n\n // Clear container\n this.containerElement.innerHTML = '';\n\n // Set container styles for seamless integration\n if (this.containerElement instanceof HTMLElement) {\n const currentStyle = this.containerElement.getAttribute('style') || '';\n if (!currentStyle.includes('min-height')) {\n this.containerElement.style.minHeight = '196px';\n }\n if (!currentStyle.includes('position')) {\n this.containerElement.style.position = 'relative';\n }\n if (!currentStyle.includes('overflow')) {\n this.containerElement.style.overflow = 'hidden';\n }\n }\n\n // Create iframe\n this.iframe = document.createElement('iframe');\n this.iframe.src = iframeSrc;\n\n const iframeWidth = this.config.config?.style?.fillParent ? '100%' : '344px';\n const iframeMaxWidth = this.config.config?.style?.fillParent ? 'none' : '100%';\n\n this.iframe.style.cssText = `\n width: ${iframeWidth};\n max-width: ${iframeMaxWidth};\n height: 196px;\n min-height: 196px;\n border: none;\n display: block;\n transition: height 0.2s ease;\n `;\n\n this.iframe.setAttribute('allow', 'payment');\n\n // Append to container\n this.containerElement.appendChild(this.iframe);\n\n // Show loader\n this.showLoader(this.containerElement);\n }\n }\n\n /**\n * Add message listener for communication with iframe\n */\n private addMessageListener(): void {\n this.messageListener = (event: MessageEvent) => {\n const allowedOrigin = new URL(this.iframeUrl).origin;\n const isExactMatch = event.origin === allowedOrigin;\n\n let isAllowedOrigin = isExactMatch;\n\n if (!isAllowedOrigin) {\n if (this.environment === 'sandbox' || this.environment === 'development') {\n const isLocalhostDev =\n (event.origin.includes('localhost') || event.origin.includes('127.0.0.1')) &&\n (allowedOrigin.includes('localhost') || allowedOrigin.includes('127.0.0.1'));\n isAllowedOrigin = isLocalhostDev;\n }\n\n if (!isAllowedOrigin) {\n const isAllowedApiOrigin =\n event.origin === 'https://dev.api.inflowpay.com' ||\n event.origin === 'https://pre-prod.api.inflowpay.xyz' ||\n event.origin === 'https://api.inflowpay.xyz';\n isAllowedOrigin = isAllowedApiOrigin;\n }\n }\n\n if (!isAllowedOrigin) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected message from unauthorized origin:', event.origin);\n }\n return;\n }\n\n const data = event.data as IframeMessage;\n\n if (!data || !data.type) {\n return;\n }\n\n switch (data.type) {\n case 'iframe-ready':\n // Wait for iframe's javascript to be ready before sending config\n this.hideLoader();\n this.sendConfigToIframe();\n break;\n\n case 'content-height':\n // Adjust iframe height based on content\n if (data.height && this.iframe) {\n const height = Math.max(data.height, 196); // Minimum 196px\n this.iframe.style.height = `${height}px`;\n if (this.containerElement) {\n this.containerElement.style.minHeight = `${height}px`;\n }\n }\n break;\n\n case 'close':\n this.close();\n break;\n\n case 'success':\n if (this.config.onSuccess) {\n this.config.onSuccess(data.data);\n }\n break;\n\n case 'error':\n if (this.config.onError) {\n this.config.onError(data.data);\n }\n break;\n\n case '3ds-required':\n // Iframe requests SDK to open 3DS popup\n if (this.config.debug) {\n console.log('[SDK] Received 3DS request:', data.threeDsSessionUrl);\n }\n if (data.threeDsSessionUrl) {\n if (this.config.debug) {\n console.log('[SDK] Opening 3DS modal...');\n }\n this.open3DSModal(data.threeDsSessionUrl).then((success) => {\n if (this.config.debug) {\n console.log('[SDK] 3DS modal closed, result:', success);\n }\n if (this.iframe && this.iframe.contentWindow) {\n const targetOrigin = this.getTargetOrigin();\n this.iframe.contentWindow.postMessage({\n type: '3ds-result',\n success: success,\n paymentId: data.paymentId || this.config.config?.paymentId,\n }, targetOrigin);\n }\n });\n } else {\n if (this.config.debug) {\n console.error('[SDK] 3DS required but no threeDsSessionUrl provided');\n }\n }\n break;\n\n default:\n if (this.config.debug) {\n console.log('SDK: Received message:', data);\n }\n }\n };\n\n window.addEventListener('message', this.messageListener);\n }\n\n /**\n * Send configuration to the iframe\n */\n private sendConfigToIframe(): void {\n if (!this.iframe || !this.iframe.contentWindow) {\n // Wait for iframe to load\n if (this.iframe) {\n this.iframe.onload = () => {\n this.sendConfigToIframe();\n };\n }\n return;\n }\n\n const message: IframeMessage = {\n type: 'sdkData',\n config: {\n ...(this.config.config || {}),\n paymentId: this.config.config?.paymentId\n },\n data: {\n apiKey: this.config.apiKey,\n },\n };\n\n const targetOrigin = this.getTargetOrigin();\n this.iframe.contentWindow.postMessage(message, targetOrigin);\n }\n\n /**\n * Show skeleton loader while iframe is connecting\n */\n private showLoader(container: HTMLElement): void {\n // Hide iframe while loader is showing\n if (this.iframe) {\n this.iframe.style.display = 'none';\n }\n \n // Detect dark mode\n const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n \n // Color scheme based on dark mode\n const inputBgColor = isDarkMode ? '#2d2d2d' : '#F5F5F5';\n const shimmerBase = isDarkMode ? '#3d3d3d' : '#E5E5E5';\n const shimmerLight = isDarkMode ? '#4d4d4d' : '#F0F0F0';\n const shimmerGradient = `linear-gradient(90deg, ${shimmerBase} 25%, ${shimmerLight} 50%, ${shimmerBase} 75%)`;\n \n const loader = document.createElement('div');\n loader.id = 'inflowpay-loader';\n \n // Get container width to match SDK structure\n const containerWidth = this.config.config?.style?.fillParent ? '100%' : '344px';\n \n loader.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1000;\n padding: 20px;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n `;\n\n // Skeleton card element container (matching .inflowpay-card-element)\n const skeletonCard = document.createElement('div');\n skeletonCard.style.cssText = `\n width: ${containerWidth};\n max-width: 100%;\n margin: 0 auto;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n `;\n\n // Input container skeleton (matching .inflowpay-card-inp-wrap)\n const inputWrap = document.createElement('div');\n inputWrap.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n background-color: ${inputBgColor};\n padding: 8px;\n border-radius: 8px;\n margin-bottom: 20px;\n `;\n\n // Card number skeleton (flex: 1)\n const cardNumberSkeleton = document.createElement('div');\n cardNumberSkeleton.className = 'inflowpay-skeleton';\n cardNumberSkeleton.style.cssText = `\n flex: 1;\n min-width: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n // Expiry skeleton (21.5% width)\n const expirySkeleton = document.createElement('div');\n expirySkeleton.className = 'inflowpay-skeleton';\n expirySkeleton.style.cssText = `\n width: 21.5%;\n flex-shrink: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n // CVC skeleton (17.5% width)\n const cvcSkeleton = document.createElement('div');\n cvcSkeleton.className = 'inflowpay-skeleton';\n cvcSkeleton.style.cssText = `\n width: 17.5%;\n flex-shrink: 0;\n height: 32px;\n border-radius: 6px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n inputWrap.appendChild(cardNumberSkeleton);\n inputWrap.appendChild(expirySkeleton);\n inputWrap.appendChild(cvcSkeleton);\n\n // Button skeleton (matching .inflowpay-button)\n const buttonSkeleton = document.createElement('div');\n buttonSkeleton.className = 'inflowpay-skeleton';\n buttonSkeleton.style.cssText = `\n width: 100%;\n height: 42px;\n border-radius: 8px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n margin-bottom: 16px;\n `;\n\n // Disclaimer skeleton (matching .inflowpay-disclaimer)\n const disclaimerSkeleton = document.createElement('div');\n disclaimerSkeleton.style.cssText = `\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n width: 100%;\n margin-top: 16px;\n `;\n\n const disclaimerIconSkeleton = document.createElement('div');\n disclaimerIconSkeleton.className = 'inflowpay-skeleton';\n disclaimerIconSkeleton.style.cssText = `\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n const disclaimerTextSkeleton = document.createElement('div');\n disclaimerTextSkeleton.className = 'inflowpay-skeleton';\n disclaimerTextSkeleton.style.cssText = `\n width: 80%;\n height: 16px;\n border-radius: 4px;\n background: ${shimmerGradient};\n background-size: 200% 100%;\n animation: inflowpay-shimmer 1.5s infinite;\n `;\n\n disclaimerSkeleton.appendChild(disclaimerIconSkeleton);\n disclaimerSkeleton.appendChild(disclaimerTextSkeleton);\n\n skeletonCard.appendChild(inputWrap);\n skeletonCard.appendChild(buttonSkeleton);\n skeletonCard.appendChild(disclaimerSkeleton);\n loader.appendChild(skeletonCard);\n\n // Add shimmer animation keyframes\n if (!document.getElementById('inflowpay-loader-styles')) {\n const style = document.createElement('style');\n style.id = 'inflowpay-loader-styles';\n style.textContent = `\n @keyframes inflowpay-shimmer {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n }\n `;\n document.head.appendChild(style);\n }\n\n container.appendChild(loader);\n }\n\n /**\n * Hide loader\n */\n private hideLoader(): void {\n const loader = document.getElementById('inflowpay-loader');\n if (loader) {\n loader.remove();\n }\n \n // Show iframe again when loader is hidden\n if (this.iframe) {\n this.iframe.style.display = '';\n }\n }\n\n /**\n * Close the iframe and cleanup\n */\n private close(): void {\n if (this.config.onClose) {\n this.config.onClose();\n }\n\n // Hide loader\n this.hideLoader();\n\n // Remove message listener\n if (this.messageListener) {\n window.removeEventListener('message', this.messageListener);\n this.messageListener = null;\n }\n\n if (this.usePopup) {\n // Remove overlay\n const overlay = document.getElementById('inflowpay-sdk-overlay');\n if (overlay) {\n overlay.remove();\n }\n } else {\n // Clear container\n if (this.containerElement) {\n this.containerElement.innerHTML = '';\n }\n }\n\n this.iframe = null;\n }\n\n /**\n * Open 3DS authentication modal\n * Called when iframe requests 3DS authentication\n */\n private open3DSModal(challengeUrl: string): Promise<boolean> {\n if (this.config.debug) {\n console.log('[SDK] open3DSModal called with URL:', challengeUrl);\n }\n return new Promise((resolve) => {\n // Create overlay\n const overlay = document.createElement('div');\n overlay.id = 'inflowpay-3ds-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 999999;\n `;\n\n // Create modal\n const modal = document.createElement('div');\n modal.style.cssText = `\n position: relative;\n width: 90%;\n max-width: 500px;\n height: 90%;\n max-height: 600px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n display: flex;\n flex-direction: column;\n `;\n\n // Create header\n const header = document.createElement('div');\n header.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 15px 20px;\n border-bottom: 1px solid #e5e5e5;\n `;\n header.innerHTML = `\n <h3 style=\"margin: 0; font-size: 18px; font-weight: 600;\">Secure Payment Authentication</h3>\n <button id=\"inflowpay-3ds-close\" style=\"background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: #333;\">×</button>\n `;\n\n // Create content with iframe\n const content = document.createElement('div');\n content.style.cssText = `\n flex: 1;\n position: relative;\n overflow: hidden;\n `;\n const iframe = document.createElement('iframe');\n iframe.src = challengeUrl;\n iframe.style.cssText = `\n width: 100%;\n height: 100%;\n border: none;\n `;\n iframe.setAttribute('allow', 'payment');\n iframe.setAttribute('sandbox', 'allow-forms allow-scripts allow-same-origin allow-popups');\n content.appendChild(iframe);\n\n modal.appendChild(header);\n modal.appendChild(content);\n overlay.appendChild(modal);\n document.body.appendChild(overlay);\n\n // Close button handler\n const closeBtn = overlay.querySelector('#inflowpay-3ds-close');\n const closeHandler = () => {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(false);\n };\n closeBtn?.addEventListener('click', closeHandler);\n\n const messageHandler = (event: MessageEvent) => {\n if (!event.data) return;\n\n const allowed3DSOrigins = [\n 'https://dev.api.inflowpay.com',\n 'https://pre-prod.api.inflowpay.xyz',\n 'https://api.inflowpay.xyz',\n ];\n\n if (this.environment === 'sandbox' || this.environment === 'development') {\n if (event.origin.includes('localhost') || event.origin.includes('127.0.0.1')) {\n // Allow localhost in dev/sandbox\n } else if (!allowed3DSOrigins.includes(event.origin)) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected 3DS message from unauthorized origin:', event.origin);\n }\n return;\n }\n } else {\n if (!allowed3DSOrigins.includes(event.origin)) {\n if (this.config.debug) {\n console.warn('[SDK] Rejected 3DS message from unauthorized origin:', event.origin);\n }\n return;\n }\n }\n\n const data = event.data;\n const is3DSComplete = data.type === 'THREE_DS_COMPLETE' || data.type === '3ds-complete';\n const isSuccess = data.status === 'success';\n const isFailure = data.status === 'failed' || data.status === 'failure';\n\n // Success case\n if (is3DSComplete && isSuccess) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(true);\n return;\n }\n\n // Also handle legacy format\n if (isSuccess && !is3DSComplete) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(true);\n return;\n }\n\n // Failure case\n if ((is3DSComplete && isFailure) || data.type === '3ds-failed' || isFailure) {\n overlay.remove();\n window.removeEventListener('message', messageHandler);\n resolve(false);\n return;\n }\n };\n\n window.addEventListener('message', messageHandler);\n });\n }\n\n /**\n * Get target origin for postMessage based on environment\n * In production/pre-prod: use exact origin for security\n * In dev/sandbox: use wildcard for development flexibility\n */\n private getTargetOrigin(): string {\n if (this.environment === 'production' || this.environment === 'preprod') {\n return new URL(this.iframeUrl).origin;\n }\n return '*';\n }\n\n /**\n * Detect environment from API key\n */\n private getEnvironmentFromApiKey(apiKey: string): 'sandbox' | 'production' | 'development' | 'preprod' {\n if (!apiKey) return 'sandbox';\n if (apiKey.includes('_local_') || apiKey.startsWith('inflow_local_')) {\n return 'sandbox';\n } else if (apiKey.includes('_prod_') && !apiKey.includes('_preprod_')) {\n return 'production';\n } else if (apiKey.includes('_preprod_') || apiKey.startsWith('inflow_preprod_')) {\n return 'preprod';\n } else if (apiKey.includes('_dev_')) {\n return 'development';\n }\n return 'sandbox';\n }\n\n /**\n * Public method to close the iframe\n */\n public destroy(): void {\n this.close();\n }\n}\n\n","/**\n * CardElement - Iframe-based payment element\n * \n * Mounts an iframe with the payment checkout form\n */\n\nimport { SDK } from './sdk';\n\nimport type { CSSProperties } from './types';\n\nexport interface CardElementOptions {\n /** Container element or CSS selector where the iframe will be mounted */\n container: string | HTMLElement;\n /** Payment ID for this transaction */\n paymentId: string;\n /** Callback when payment completes */\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n /** Callback when payment fails */\n onError?: (error: any) => void;\n /** Callback when user closes the payment */\n onClose?: () => void;\n /** Custom styling for the card element */\n style?: CSSProperties;\n /** Custom button text (default: \"Complete Payment\") */\n buttonText?: string;\n /** Custom placeholder text for inputs */\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\ninterface InternalSDKConfig {\n apiKey: string;\n iframeUrl: string;\n timeout: number;\n debug: boolean;\n}\n\nexport class CardElement {\n private sdk: SDK;\n private container: HTMLElement;\n private mounted: boolean = false;\n\n constructor(\n config: InternalSDKConfig,\n options: CardElementOptions\n ) {\n let containerElement: HTMLElement | null;\n if (typeof options.container === 'string') {\n containerElement = document.querySelector(options.container);\n if (!containerElement) {\n throw new Error(`Container not found: ${options.container}`);\n }\n } else {\n containerElement = options.container;\n }\n this.container = containerElement;\n\n this.sdk = new SDK({\n iframeUrl: config.iframeUrl,\n apiKey: config.apiKey,\n container: this.container,\n config: {\n paymentId: options.paymentId,\n ...(options.style && { style: options.style }),\n ...(options.buttonText && { buttonText: options.buttonText }),\n ...(options.placeholders && { placeholders: options.placeholders }),\n },\n onSuccess: (data) => {\n if (options.onComplete) {\n options.onComplete({\n status: data?.data?.transaction?.status || 'CHECKOUT_SUCCESS',\n data: data,\n });\n }\n },\n onError: (error) => {\n if (options.onError) {\n options.onError(error);\n } else if (options.onComplete) {\n options.onComplete({\n status: 'PAYMENT_FAILED',\n error: error,\n });\n }\n },\n onClose: () => {\n if (options.onClose) {\n options.onClose();\n }\n },\n });\n }\n\n /**\n * Mount the CardElement to the DOM\n * This will create and display the iframe\n */\n mount(): void {\n if (this.mounted) {\n throw new Error('CardElement is already mounted');\n }\n\n this.sdk.init();\n this.mounted = true;\n }\n\n /**\n * Destroy the CardElement and cleanup\n */\n destroy(): void {\n if (this.mounted) {\n this.sdk.destroy();\n this.mounted = false;\n }\n }\n}\n","/**\n * InflowPay Payment SDK v2\n * \n * Provider class that manages global SDK configuration\n * Similar to the original SDK but uses iframe-based payment flow\n */\n\nimport type { SDKConfig, PaymentConfig, CSSProperties } from './types';\nimport { CardElement } from './card-element';\n\nexport interface PaymentSDKConfig {\n /** Public API key */\n apiKey: string;\n /** Backend API URL (optional, auto-detected from API key) */\n iframeUrl?: string;\n /** Request timeout in milliseconds (default: 30000) */\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport class PaymentSDK {\n private config: PaymentSDKConfig & { iframeUrl: string; timeout: number; debug: boolean };\n\n /**\n * Initialize the InflowPay Payment SDK\n * \n * @param config - SDK configuration\n * \n * @example\n * ```typescript\n * const sdk = new PaymentSDK({\n * apiKey: 'inflow_pub_local_xxx'\n * });\n * ```\n */\n constructor(config: PaymentSDKConfig) {\n // Validate API key\n if (!config.apiKey || typeof config.apiKey !== 'string') {\n throw new Error('API key is required');\n }\n\n // Auto-detect iframe URL from API key if not provided\n let iframeUrl = config.iframeUrl;\n const environment = this.getEnvironmentFromApiKey(config.apiKey);\n \n if (!iframeUrl) {\n if (environment === 'production') {\n iframeUrl = 'https://api.inflowpay.xyz/iframe/checkout';\n } else if (environment === 'preprod') {\n iframeUrl = 'https://pre-prod.api.inflowpay.xyz/iframe/checkout';\n } else if (environment === 'development') {\n iframeUrl = 'https://dev.api.inflowpay.com/iframe/checkout';\n } else {\n // sandbox/local\n iframeUrl = 'http://localhost:3000/iframe/checkout';\n }\n }\n\n // Validate debug mode - only allowed in local/dev environments\n const requestedDebug = config.debug ?? false;\n if (requestedDebug && (environment === 'production' || environment === 'preprod')) {\n console.warn('[InflowPay SDK] Debug mode is not allowed in production/pre-prod environments. Debug mode disabled.');\n }\n const debug = requestedDebug && (environment === 'sandbox' || environment === 'development');\n\n this.config = {\n apiKey: config.apiKey,\n iframeUrl,\n timeout: config.timeout ?? 30000,\n debug,\n };\n }\n\n /**\n * Create a CardElement for iframe-based payment UI\n * \n * @param options - CardElement configuration\n * @returns CardElement instance\n * \n * @example\n * ```typescript\n * const cardElement = sdk.createCardElement({\n * container: '#card-container',\n * paymentId: 'pay_123',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\n createCardElement(options: {\n container: string | HTMLElement;\n paymentId: string;\n style?: CSSProperties;\n buttonText?: string;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n }): CardElement {\n return new CardElement(this.config, options);\n }\n\n /**\n * Get the iframe URL being used\n */\n getIframeUrl(): string {\n return this.config.iframeUrl;\n }\n\n /**\n * Get the API key\n */\n getApiKey(): string {\n return this.config.apiKey;\n }\n\n /**\n * Auto-detect environment from API key\n */\n private getEnvironmentFromApiKey(apiKey: string): 'sandbox' | 'production' | 'development' | 'preprod' {\n if (apiKey.includes('_local_') || apiKey.startsWith('inflow_local_')) {\n return 'sandbox';\n } else if (apiKey.includes('_prod_') && !apiKey.includes('_preprod_')) {\n return 'production';\n } else if (apiKey.includes('_preprod_') || apiKey.startsWith('inflow_preprod_')) {\n return 'preprod';\n } else if (apiKey.includes('_dev_')) {\n return 'development';\n }\n return 'sandbox';\n }\n}\n\n","/**\n * InflowPayProvider - Compatibility layer for React SDK API\n * \n * Provides the same API structure as the original React SDK\n * but works with vanilla JavaScript\n */\n\nimport { PaymentSDK } from './payment-sdk';\nimport type { PaymentSDKConfig } from './payment-sdk';\nimport { CardElement } from './card-element';\nimport type { CardElementOptions } from './card-element';\n\nexport interface InflowPayProviderConfig {\n apiKey: string;\n iframeUrl?: string;\n timeout?: number;\n /** Enable debug logging (default: false, only allowed in local/dev environments) */\n debug?: boolean;\n}\n\nexport interface CardElementProps {\n paymentId: string;\n container?: string | HTMLElement;\n onComplete?: (result: { status: string; data?: any; error?: any }) => void;\n onError?: (error: any) => void;\n onClose?: () => void;\n onReady?: () => void;\n onChange?: (state: { complete: boolean }) => void;\n buttonText?: string;\n buttonStyle?: any;\n style?: any;\n placeholders?: {\n cardNumber?: string;\n expiry?: string;\n cvc?: string;\n };\n}\n\n/**\n * InflowPayProvider - Global SDK configuration\n * \n * Similar to React's InflowPayProvider but for vanilla JS\n * \n * @example\n * ```typescript\n * const provider = new InflowPayProvider({\n * config: { apiKey: 'inflow_pub_xxx' }\n * });\n * \n * const cardElement = provider.createCardElement({\n * paymentId: 'pay_xxx',\n * onComplete: (result) => {\n * if (result.status === 'CHECKOUT_SUCCESS') {\n * window.location.href = '/success';\n * }\n * }\n * });\n * \n * cardElement.mount();\n * ```\n */\nexport class InflowPayProvider {\n private sdk: PaymentSDK;\n\n constructor(options: { config: InflowPayProviderConfig }) {\n const config: PaymentSDKConfig = {\n apiKey: options.config.apiKey,\n iframeUrl: options.config.iframeUrl,\n timeout: options.config.timeout,\n debug: options.config.debug,\n };\n\n this.sdk = new PaymentSDK(config);\n }\n\n /**\n * Create a CardElement (similar to React's <CardElement />)\n * \n * @param props - CardElement props (same as React SDK)\n * @returns CardElement instance\n */\n createCardElement(props: CardElementProps): CardElement {\n let container: string | HTMLElement;\n if (props.container) {\n container = props.container;\n } else {\n const defaultContainer = document.createElement('div');\n defaultContainer.id = 'inflowpay-card-element-container';\n document.body.appendChild(defaultContainer);\n container = defaultContainer;\n }\n\n const cardElementOptions: CardElementOptions = {\n container: container,\n paymentId: props.paymentId,\n ...(props.style && { style: props.style }),\n ...(props.buttonText && { buttonText: props.buttonText }),\n ...(props.placeholders && { placeholders: props.placeholders }),\n onComplete: (result) => {\n if (props.onComplete) {\n props.onComplete(result);\n }\n },\n onError: props.onError,\n onClose: props.onClose,\n };\n\n const cardElement = this.sdk.createCardElement(cardElementOptions);\n\n if (props.onReady) {\n const originalMount = cardElement.mount.bind(cardElement);\n cardElement.mount = () => {\n originalMount();\n setTimeout(() => {\n if (props.onReady) {\n props.onReady();\n }\n }, 100);\n };\n }\n\n if (props.onChange) {\n setTimeout(() => {\n if (props.onChange) {\n props.onChange({ complete: false });\n }\n }, 100);\n }\n\n return cardElement;\n }\n\n /**\n * Get the underlying PaymentSDK instance\n */\n getSDK(): PaymentSDK {\n return this.sdk;\n }\n}\n\n","/**\n * InflowPay SDK v2 - Entry point\n * \n * Provides the same API as the original React SDK but using iframe-based payment flow\n * Compatible with vanilla JavaScript and easy migration from React SDK\n */\n\nexport { InflowPayProvider } from './inflowpay-provider';\nexport type { InflowPayProviderConfig, CardElementProps } from './inflowpay-provider';\n\nexport { PaymentSDK } from './payment-sdk';\nexport type { PaymentSDKConfig } from './payment-sdk';\n\nexport { CardElement } from './card-element';\nexport type { CardElementOptions } from './card-element';\n\nexport { SDK } from './sdk';\n\nexport type { IframeMessage, PaymentConfig, TransactionData } from './types';\n\nexport enum PaymentStatus {\n INITIATION = 'INITIATION',\n CHECKOUT_PENDING = 'CHECKOUT_PENDING',\n CHECKOUT_SUCCESS = 'CHECKOUT_SUCCESS',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CANCELED = 'CANCELED',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n PAYMENT_SUCCESS = 'PAYMENT_SUCCESS',\n PAYMENT_FAILED = 'PAYMENT_FAILED',\n}\n\nexport type PaymentResult = {\n status: string;\n data?: any;\n error?: {\n code: string;\n message: string;\n retryable: boolean;\n };\n};\n\nexport type PaymentError = {\n code: string;\n message: string;\n retryable: boolean;\n};\n\nexport type CardElementState = {\n complete: boolean;\n};\n\nexport const VERSION = '0.6.0';\n"],"names":["SDK","config","url","iframeSrc","overlay","container","closeButton","e","currentStyle","iframeWidth","iframeMaxWidth","event","allowedOrigin","isAllowedOrigin","data","height","success","targetOrigin","message","isDarkMode","inputBgColor","shimmerBase","shimmerGradient","loader","containerWidth","skeletonCard","inputWrap","cardNumberSkeleton","expirySkeleton","cvcSkeleton","buttonSkeleton","disclaimerSkeleton","disclaimerIconSkeleton","disclaimerTextSkeleton","style","challengeUrl","resolve","modal","header","content","iframe","closeBtn","closeHandler","messageHandler","allowed3DSOrigins","is3DSComplete","isSuccess","isFailure","apiKey","CardElement","options","containerElement","error","PaymentSDK","iframeUrl","environment","requestedDebug","debug","InflowPayProvider","props","defaultContainer","cardElementOptions","result","cardElement","originalMount","PaymentStatus","VERSION"],"mappings":"oOASO,MAAMA,CAAI,CASf,YAAYC,EAAmB,CAS7B,GAjBF,KAAQ,OAAmC,KAG3C,KAAQ,gBAA0D,KAClE,KAAQ,iBAAuC,KAK7C,KAAK,OAASA,EACd,KAAK,UAAYA,EAAO,WAAa,wCACrC,KAAK,YAAc,KAAK,yBAAyBA,EAAO,QAAU,EAAE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,CACjB,MAAMK,EAAgBD,EAAY,MAAM,KAAKA,CAAW,EACxDA,EAAY,MAAQ,IAAM,CACxBC,EAAA,EACA,WAAW,IAAM,CACXL,EAAM,SACRA,EAAM,QAAA,CAEV,EAAG,GAAG,CACR,CACF,CAEA,OAAIA,EAAM,UACR,WAAW,IAAM,CACXA,EAAM,UACRA,EAAM,SAAS,CAAE,SAAU,EAAA,CAAO,CAEtC,EAAG,GAAG,EAGDI,CACT,CAKA,QAAqB,CACnB,OAAO,KAAK,GACd,CACF,CCtHO,IAAKE,GAAAA,IACVA,EAAA,WAAa,aACbA,EAAA,iBAAmB,mBACnBA,EAAA,iBAAmB,mBACnBA,EAAA,kBAAoB,oBACpBA,EAAA,SAAW,WACXA,EAAA,iBAAmB,mBACnBA,EAAA,gBAAkB,kBAClBA,EAAA,eAAiB,iBARPA,IAAAA,GAAA,CAAA,CAAA,EA+BL,MAAMC,EAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflow_pay/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "InflowPay SDK v2 - payment SDK with React and vanilla JS support",
5
5
  "keywords": [
6
6
  "inflowpay",