{"_id":"@codefly2026/checkout-sdk","name":"@codefly2026/checkout-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@codefly2026/checkout-sdk","version":"1.0.0","description":"A lightweight, embeddable payment checkout SDK with iframe isolation and dynamic form rendering","author":{"name":"codefly2026"},"license":"MIT","homepage":"https://github.com/codefly2026/checkout-sdk#readme","repository":{"type":"git","url":"git+https://github.com/codefly2026/checkout-sdk.git"},"bugs":{"url":"https://github.com/codefly2026/checkout-sdk/issues"},"keywords":["checkout","payment","sdk","iframe","payment-gateway","credit-card","wallet","dynamic-form"],"main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js","types":"./dist/index.d.ts"}},"sideEffects":false,"scripts":{"build":"rollup -c","dev":"rollup -c -w","prepublishOnly":"npm run build"},"devDependencies":{"@rollup/plugin-typescript":"^11.1.5","@rollup/plugin-terser":"^0.4.4","@types/node":"^20.10.6","rollup":"^4.6.1","tslib":"^2.6.2","typescript":"^5.3.3"},"engines":{"node":">=16.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@codefly2026/checkout-sdk@1.0.0","gitHead":"073864f9d5d2c10d6a118df41c9ae6d877dc1f3f","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-x5O3GXrp4UONP75zAEhzDVAspBX2fsXzN4HE19M/3wo7deb6tTjI8hEYgl3vWAwtTpcCaPl60PRF/zERtJF5QQ==","shasum":"05650654f4130e5bbe0a9db84ade1b5b04631591","tarball":"https://registry.npmjs.org/@codefly2026/checkout-sdk/-/checkout-sdk-1.0.0.tgz","fileCount":15,"unpackedSize":39882,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGhKG/HoDaoD4ppibobZ+qDUy9Wcng7WqpK0e9iqhSXzAiEA+rUc8bkjUnRbuUAZrijTay9Rxaz4UeLv+P+EKLPw/Nk="}]},"_npmUser":{"name":"codefly2026","email":"gongfeideng@gmail.com"},"directories":{},"maintainers":[{"name":"codefly2026","email":"gongfeideng@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/checkout-sdk_1.0.0_1767772482736_0.3310058496711821"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-07T07:54:42.640Z","1.0.0":"2026-01-07T07:54:42.877Z","modified":"2026-01-07T07:54:43.178Z"},"maintainers":[{"name":"codefly2026","email":"gongfeideng@gmail.com"}],"description":"A lightweight, embeddable payment checkout SDK with iframe isolation and dynamic form rendering","homepage":"https://github.com/codefly2026/checkout-sdk#readme","keywords":["checkout","payment","sdk","iframe","payment-gateway","credit-card","wallet","dynamic-form"],"repository":{"type":"git","url":"git+https://github.com/codefly2026/checkout-sdk.git"},"author":{"name":"codefly2026"},"bugs":{"url":"https://github.com/codefly2026/checkout-sdk/issues"},"license":"MIT","readme":"# @codefly2026/checkout-sdk\r\n\r\nA lightweight, embeddable payment checkout SDK with iframe isolation and dynamic form rendering.\r\n\r\n[![npm version](https://img.shields.io/npm/v/@codefly2026/checkout-sdk.svg)](https://www.npmjs.com/package/@codefly2026/checkout-sdk)\r\n[![npm downloads](https://img.shields.io/npm/dm/@codefly2026/checkout-sdk.svg)](https://www.npmjs.com/package/@codefly2026/checkout-sdk)\r\n[![license](https://img.shields.io/npm/l/@codefly2026/checkout-sdk.svg)](https://github.com/codefly2026/checkout-sdk/blob/main/LICENSE)\r\n\r\n## Features\r\n\r\n- 🔒 **Iframe Isolation** - Secure payment form in isolated iframe\r\n- 🎨 **Customizable Theme** - Full theme customization (colors, fonts, logo)\r\n- 📝 **Dynamic Forms** - JSON-driven form rendering with validation\r\n- 💳 **Multiple Payment Methods** - Credit cards, wallets, bank transfers\r\n- 📱 **Responsive Design** - Works on all screen sizes\r\n- 🔌 **Easy Integration** - Simple API with TypeScript support\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @codefly2026/checkout-sdk\r\n# or\r\nyarn add @codefly2026/checkout-sdk\r\n# or\r\npnpm add @codefly2026/checkout-sdk\r\n```\r\n\r\n## Quick Start\r\n\r\n### 1. Add a container element\r\n\r\n```html\r\n<div id=\"checkout-container\"></div>\r\n```\r\n\r\n### 2. Initialize the SDK\r\n\r\n```typescript\r\nimport PaySDK from '@codefly2026/checkout-sdk';\r\n\r\nconst checkout = PaySDK.createCheckout(\r\n  {\r\n    container: '#checkout-container',\r\n    payment: {\r\n      orderId: 'ORDER_123456',\r\n      amount: 199.99,\r\n      currency: 'USD',\r\n    },\r\n    theme: {\r\n      primaryColor: '#1677ff',\r\n      fontFamily: 'Inter, sans-serif',\r\n      borderRadius: 8,\r\n    },\r\n    onSuccess: (result) => {\r\n      console.log('Payment successful:', result);\r\n      // { orderId, transactionId, amount, currency }\r\n    },\r\n    onFail: (error) => {\r\n      console.error('Payment failed:', error);\r\n      // { code, message }\r\n    },\r\n    onClose: () => {\r\n      console.log('Checkout closed');\r\n    },\r\n  },\r\n  'https://checkout.your-domain.com' // Your checkout app URL\r\n);\r\n\r\n// Open the checkout\r\ncheckout.open();\r\n```\r\n\r\n## API Reference\r\n\r\n### PaySDK.createCheckout(options, iframeUrl)\r\n\r\nCreates a new checkout instance.\r\n\r\n#### Parameters\r\n\r\n| Parameter | Type | Required | Description |\r\n|-----------|------|----------|-------------|\r\n| `options` | `CheckoutOptions` | Yes | Configuration options |\r\n| `iframeUrl` | `string` | Yes | URL of the checkout iframe application |\r\n\r\n#### CheckoutOptions\r\n\r\n| Property | Type | Required | Description |\r\n|----------|------|----------|-------------|\r\n| `container` | `string \\| HTMLElement` | Yes | Container selector or DOM element |\r\n| `width` | `number \\| string` | No | Iframe width (default: `'100%'`) |\r\n| `height` | `number \\| string` | No | Iframe height (default: `'100%'`) |\r\n| `payment` | `PaymentConfig` | Yes | Payment parameters |\r\n| `theme` | `ThemeConfig` | No | Theme customization |\r\n| `onSuccess` | `(result: PaymentResult) => void` | No | Success callback |\r\n| `onFail` | `(error: PaymentError) => void` | No | Failure callback |\r\n| `onClose` | `() => void` | No | Close callback |\r\n\r\n#### PaymentConfig\r\n\r\n| Property | Type | Required | Description |\r\n|----------|------|----------|-------------|\r\n| `orderId` | `string` | Yes | Order ID |\r\n| `amount` | `number` | Yes | Payment amount |\r\n| `currency` | `string` | Yes | Currency code (USD, EUR, CNY, etc.) |\r\n\r\n#### ThemeConfig\r\n\r\n| Property | Type | Description |\r\n|----------|------|-------------|\r\n| `primaryColor` | `string` | Primary color (e.g., `'#1677ff'`) |\r\n| `primaryHoverColor` | `string` | Primary hover color |\r\n| `fontFamily` | `string` | Font family |\r\n| `logo` | `string` | Logo URL |\r\n| `borderRadius` | `number` | Border radius in pixels |\r\n| `backgroundColor` | `string` | Background color |\r\n| `cardBackgroundColor` | `string` | Card background color |\r\n| `textColor` | `string` | Text color |\r\n| `borderColor` | `string` | Border color |\r\n\r\n### Checkout Instance Methods\r\n\r\n#### checkout.open()\r\n\r\nOpens the checkout and displays the payment form.\r\n\r\n#### checkout.update(options)\r\n\r\nUpdates the checkout configuration.\r\n\r\n```typescript\r\ncheckout.update({\r\n  payment: {\r\n    orderId: 'ORDER_123456',\r\n    amount: 299.99,\r\n    currency: 'USD',\r\n  },\r\n  theme: {\r\n    primaryColor: '#ff4d4f',\r\n  },\r\n});\r\n```\r\n\r\n#### checkout.close()\r\n\r\nCloses and removes the checkout from the DOM.\r\n\r\n#### checkout.destroy()\r\n\r\nDestroys the checkout instance and cleans up resources.\r\n\r\n## Browser Support\r\n\r\n- Chrome (latest)\r\n- Firefox (latest)\r\n- Safari (latest)\r\n- Edge (latest)\r\n\r\n## TypeScript\r\n\r\nThis package includes TypeScript definitions out of the box.\r\n\r\n```typescript\r\nimport PaySDK, { \r\n  Checkout, \r\n  CheckoutOptions, \r\n  PaymentResult, \r\n  PaymentError,\r\n  ThemeConfig \r\n} from '@codefly2026/checkout-sdk';\r\n```\r\n\r\n## Security\r\n\r\n- Payment forms are rendered in an isolated iframe\r\n- Cross-origin communication via postMessage with origin validation\r\n- No sensitive data is exposed to the parent page\r\n- All financial data should be validated on your backend\r\n\r\n## License\r\n\r\nMIT © codefly2026\r\n\r\n","readmeFilename":"README.md","_rev":"1-2673e10a7c3e13fee35b1a47a205f7e4"}