flintn-checkout 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@ import { useFlintNPayment } from 'flintn-checkout/react';
16
16
  function Checkout() {
17
17
  const { containerRef, isReady, paymentResult, error } = useFlintNPayment({
18
18
  config: {
19
- clientToken: 'your_client_token',
19
+ clientSessionId: 'your_client_session_id',
20
20
  },
21
21
  onPayment: (result) => {
22
22
  if (result.status === 'PAYMENT_SUCCESS') {
@@ -32,7 +32,7 @@ function Checkout() {
32
32
 
33
33
  return (
34
34
  <div style={{ display: 'flex', justifyContent: 'center' }}>
35
- <div ref={containerRef} style={{ width: '100%', maxWidth: '440px', height: '600px' }} />
35
+ <div ref={containerRef} style={{ width: '100%', height: '600px' }} />
36
36
  </div>
37
37
  );
38
38
  }
@@ -44,10 +44,7 @@ import { FlintNPayment } from 'flintn-checkout';
44
44
 
45
45
  const payment = new FlintNPayment({
46
46
  config: {
47
- clientToken: 'your_client_token',
48
- maxWidth: '440px',
49
- isCardHolderRequired: true,
50
- successRedirectUrl: 'https://example.com/success',
47
+ clientSessionId: 'your_client_session_id',
51
48
  },
52
49
  onPayment: (result) => {
53
50
  if (result.status === 'PAYMENT_SUCCESS') {
@@ -86,7 +83,7 @@ payment.unmount();
86
83
 
87
84
  const payment = new FlintNPayment({
88
85
  config: {
89
- clientToken: 'your_client_token',
86
+ clientSessionId: 'your_client_session_id',
90
87
  },
91
88
  onPayment: (result) => {
92
89
  console.log('Payment result:', result);
@@ -103,11 +100,12 @@ payment.unmount();
103
100
 
104
101
  | Option | Type | Required | Default | Description |
105
102
  |--------|------|----------|---------|-------------|
106
- | `clientToken` | `string` | ✅ | — | Client token from your backend |
107
- | `maxWidth` | `string` | ❌ | `'440px'` | Maximum width of widget |
103
+ | `clientSessionId` | `string` | ✅ | — | Client session ID from backend |
108
104
  | `isCardHolderRequired` | `boolean` | ❌ | `true` | Show cardholder name field |
109
105
  | `successRedirectUrl` | `string` | ❌ | — | Redirect URL after successful payment |
110
106
 
107
+ > **Note:** `isCardHolderRequired` only applies when using Primer as the payment provider.
108
+
111
109
  ## Callbacks
112
110
 
113
111
  | Callback | Description |
@@ -132,7 +130,7 @@ payment.unmount();
132
130
  ```typescript
133
131
  interface PaymentResult {
134
132
  status: 'PAYMENT_SUCCESS' | 'PAYMENT_ERROR' | 'PAYMENT_CANCELLED';
135
- data?: string; // Payment ID on success
133
+ data?: string; // Payment ID on success
136
134
  error?: {
137
135
  code: string;
138
136
  message: string;
@@ -161,13 +159,13 @@ Enable debug logs in console:
161
159
  ```typescript
162
160
  // React
163
161
  useFlintNPayment({
164
- config: { clientToken: '...' },
162
+ config: { clientSessionId: '...' },
165
163
  debug: true,
166
164
  });
167
165
 
168
166
  // Vanilla JS
169
167
  new FlintNPayment({
170
- config: { clientToken: '...' },
168
+ config: { clientSessionId: '...' },
171
169
  debug: true,
172
170
  });
173
171
  ```
package/dist/index.d.mts CHANGED
@@ -10,7 +10,7 @@ declare const EventType: {
10
10
  };
11
11
  type TEventType = (typeof EventType)[keyof typeof EventType];
12
12
  interface FlintNConfig {
13
- clientToken: string;
13
+ clientSessionId: string;
14
14
  maxWidth?: string;
15
15
  isCardHolderRequired?: boolean;
16
16
  successRedirectUrl?: string;
@@ -59,7 +59,7 @@ declare const parseOrigin: (origin: string) => string;
59
59
  declare const buildIframeSrc: (origin: string) => string;
60
60
  declare const createIframeElement: (src: string) => HTMLIFrameElement;
61
61
  declare const validateConfig: (config: {
62
- clientToken?: string;
62
+ clientSessionId?: string;
63
63
  }) => void;
64
64
  declare const sanitizeToken: (token: string) => string;
65
65
 
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ declare const EventType: {
10
10
  };
11
11
  type TEventType = (typeof EventType)[keyof typeof EventType];
12
12
  interface FlintNConfig {
13
- clientToken: string;
13
+ clientSessionId: string;
14
14
  maxWidth?: string;
15
15
  isCardHolderRequired?: boolean;
16
16
  successRedirectUrl?: string;
@@ -59,7 +59,7 @@ declare const parseOrigin: (origin: string) => string;
59
59
  declare const buildIframeSrc: (origin: string) => string;
60
60
  declare const createIframeElement: (src: string) => HTMLIFrameElement;
61
61
  declare const validateConfig: (config: {
62
- clientToken?: string;
62
+ clientSessionId?: string;
63
63
  }) => void;
64
64
  declare const sanitizeToken: (token: string) => string;
65
65
 
package/dist/index.js CHANGED
@@ -67,8 +67,8 @@ var createIframeElement = (src) => {
67
67
  return iframe;
68
68
  };
69
69
  var validateConfig = (config) => {
70
- if (!config.clientToken) {
71
- throw new Error("[FlintN SDK] clientToken is required");
70
+ if (!config.clientSessionId) {
71
+ throw new Error("[FlintN SDK] clientSessionId is required");
72
72
  }
73
73
  };
74
74
  var sanitizeToken = (token) => {
@@ -177,7 +177,7 @@ var FlintNPayment = class {
177
177
  },
178
178
  this.origin
179
179
  );
180
- this.log("Sent config:", sanitizeToken(this.options.config.clientToken));
180
+ this.log("Sent config:", sanitizeToken(this.options.config.clientSessionId));
181
181
  }
182
182
  log(...args) {
183
183
  if (this.options.debug) {
package/dist/index.mjs CHANGED
@@ -35,8 +35,8 @@ var createIframeElement = (src) => {
35
35
  return iframe;
36
36
  };
37
37
  var validateConfig = (config) => {
38
- if (!config.clientToken) {
39
- throw new Error("[FlintN SDK] clientToken is required");
38
+ if (!config.clientSessionId) {
39
+ throw new Error("[FlintN SDK] clientSessionId is required");
40
40
  }
41
41
  };
42
42
  var sanitizeToken = (token) => {
@@ -145,7 +145,7 @@ var FlintNPayment = class {
145
145
  },
146
146
  this.origin
147
147
  );
148
- this.log("Sent config:", sanitizeToken(this.options.config.clientToken));
148
+ this.log("Sent config:", sanitizeToken(this.options.config.clientSessionId));
149
149
  }
150
150
  log(...args) {
151
151
  if (this.options.debug) {
package/dist/react.d.mts CHANGED
@@ -10,7 +10,7 @@ declare const EventType: {
10
10
  };
11
11
  type TEventType = (typeof EventType)[keyof typeof EventType];
12
12
  interface FlintNConfig {
13
- clientToken: string;
13
+ clientSessionId: string;
14
14
  maxWidth?: string;
15
15
  isCardHolderRequired?: boolean;
16
16
  successRedirectUrl?: string;
package/dist/react.d.ts CHANGED
@@ -10,7 +10,7 @@ declare const EventType: {
10
10
  };
11
11
  type TEventType = (typeof EventType)[keyof typeof EventType];
12
12
  interface FlintNConfig {
13
- clientToken: string;
13
+ clientSessionId: string;
14
14
  maxWidth?: string;
15
15
  isCardHolderRequired?: boolean;
16
16
  successRedirectUrl?: string;
package/dist/react.js CHANGED
@@ -65,8 +65,8 @@ var createIframeElement = (src) => {
65
65
  return iframe;
66
66
  };
67
67
  var validateConfig = (config) => {
68
- if (!config.clientToken) {
69
- throw new Error("[FlintN SDK] clientToken is required");
68
+ if (!config.clientSessionId) {
69
+ throw new Error("[FlintN SDK] clientSessionId is required");
70
70
  }
71
71
  };
72
72
  var sanitizeToken = (token) => {
@@ -175,7 +175,7 @@ var FlintNPayment = class {
175
175
  },
176
176
  this.origin
177
177
  );
178
- this.log("Sent config:", sanitizeToken(this.options.config.clientToken));
178
+ this.log("Sent config:", sanitizeToken(this.options.config.clientSessionId));
179
179
  }
180
180
  log(...args) {
181
181
  if (this.options.debug) {
@@ -232,8 +232,7 @@ function useFlintNPayment(options) {
232
232
  }, [
233
233
  options.origin,
234
234
  options.debug,
235
- options.config.clientToken,
236
- options.config.maxWidth,
235
+ options.config.clientSessionId,
237
236
  options.config.isCardHolderRequired,
238
237
  options.config.successRedirectUrl
239
238
  ]);
package/dist/react.mjs CHANGED
@@ -38,8 +38,8 @@ var createIframeElement = (src) => {
38
38
  return iframe;
39
39
  };
40
40
  var validateConfig = (config) => {
41
- if (!config.clientToken) {
42
- throw new Error("[FlintN SDK] clientToken is required");
41
+ if (!config.clientSessionId) {
42
+ throw new Error("[FlintN SDK] clientSessionId is required");
43
43
  }
44
44
  };
45
45
  var sanitizeToken = (token) => {
@@ -148,7 +148,7 @@ var FlintNPayment = class {
148
148
  },
149
149
  this.origin
150
150
  );
151
- this.log("Sent config:", sanitizeToken(this.options.config.clientToken));
151
+ this.log("Sent config:", sanitizeToken(this.options.config.clientSessionId));
152
152
  }
153
153
  log(...args) {
154
154
  if (this.options.debug) {
@@ -205,8 +205,7 @@ function useFlintNPayment(options) {
205
205
  }, [
206
206
  options.origin,
207
207
  options.debug,
208
- options.config.clientToken,
209
- options.config.maxWidth,
208
+ options.config.clientSessionId,
210
209
  options.config.isCardHolderRequired,
211
210
  options.config.successRedirectUrl
212
211
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flintn-checkout",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "FlintN Payment SDK — drop-in iframe checkout for card payments and wallets with localization and theming.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",