flintn-checkout 0.0.6 → 0.0.7
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 +38 -3
- package/dist/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +6 -0
- package/dist/index.mjs +5 -0
- package/dist/react.d.mts +13 -2
- package/dist/react.d.ts +13 -2
- package/dist/react.js +6 -0
- package/dist/react.mjs +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,8 +150,9 @@ interface PaymentError {
|
|
|
150
150
|
### FormFields
|
|
151
151
|
```typescript
|
|
152
152
|
interface FormFields {
|
|
153
|
-
isEmailVisible?: boolean;
|
|
154
|
-
isCardholderNameRequired?: boolean;
|
|
153
|
+
isEmailVisible?: boolean; // Primer only
|
|
154
|
+
isCardholderNameRequired?: boolean; // Primer only
|
|
155
|
+
formVariant?: 'DEFAULT' | 'LIST';
|
|
155
156
|
}
|
|
156
157
|
```
|
|
157
158
|
|
|
@@ -159,8 +160,10 @@ interface FormFields {
|
|
|
159
160
|
```typescript
|
|
160
161
|
interface FormStyles {
|
|
161
162
|
loaderColor?: string;
|
|
162
|
-
|
|
163
|
+
backgroundColor?: string;
|
|
163
164
|
expressButtonsSpacing?: string;
|
|
165
|
+
inputBackgroundColor?: string;
|
|
166
|
+
inputBorderRadius?: string;
|
|
164
167
|
inputBorderColor?: string;
|
|
165
168
|
inputBorderHoverColor?: string;
|
|
166
169
|
inputBorderFocusColor?: string;
|
|
@@ -170,9 +173,41 @@ interface FormStyles {
|
|
|
170
173
|
buttonHoverColor?: string;
|
|
171
174
|
buttonBorderRadius?: string;
|
|
172
175
|
buttonText?: string;
|
|
176
|
+
cardButtonColor?: string;
|
|
177
|
+
cardButtonHoverColor?: string;
|
|
178
|
+
cardButtonText?: string;
|
|
173
179
|
}
|
|
174
180
|
```
|
|
175
181
|
|
|
182
|
+
### FormStyles Reference
|
|
183
|
+
|
|
184
|
+
| Property | Description |
|
|
185
|
+
|----------|-------------|
|
|
186
|
+
| `loaderColor` | Color of the loading spinner |
|
|
187
|
+
| `backgroundColor` | Background color of the checkout form |
|
|
188
|
+
| `expressButtonsSpacing` | Spacing between express payment buttons (Apple Pay, Google Pay, PayPal) |
|
|
189
|
+
| `inputBackgroundColor` | Background color of input fields |
|
|
190
|
+
| `inputBorderRadius` | Border radius of input fields |
|
|
191
|
+
| `inputBorderColor` | Default border color of input fields |
|
|
192
|
+
| `inputBorderHoverColor` | Border color of input fields on hover |
|
|
193
|
+
| `inputBorderFocusColor` | Border color of input fields on focus |
|
|
194
|
+
| `inputBorderErrorColor` | Border color of input fields in error state |
|
|
195
|
+
| `errorMessageColor` | Color of error messages below inputs |
|
|
196
|
+
| `buttonColor` | Background color of the submit button |
|
|
197
|
+
| `buttonHoverColor` | Background color of the submit button on hover/active |
|
|
198
|
+
| `buttonBorderRadius` | Border radius of the submit button |
|
|
199
|
+
| `buttonText` | Custom text for the submit button (overrides default "Pay $X.XX") |
|
|
200
|
+
| `cardButtonColor` | Background color of the "Credit or Debit Card" button (LIST variant only) |
|
|
201
|
+
| `cardButtonHoverColor` | Hover/active color of the card button (LIST variant only) |
|
|
202
|
+
| `cardButtonText` | Custom text for the card button (LIST variant only) |
|
|
203
|
+
|
|
204
|
+
## Form Variants
|
|
205
|
+
|
|
206
|
+
The checkout form supports two layout variants via `formFields.formVariant`:
|
|
207
|
+
|
|
208
|
+
- **DEFAULT** — Express payment methods shown above the card form with dividers
|
|
209
|
+
- **LIST** — Express payment methods shown as a list with a "Credit or Debit Card" button; clicking it navigates to the card form with a back arrow
|
|
210
|
+
|
|
176
211
|
## Supported Payment Methods
|
|
177
212
|
|
|
178
213
|
- 💳 Credit/Debit Cards (Visa, Mastercard, Amex, Discover)
|
package/dist/index.d.mts
CHANGED
|
@@ -9,14 +9,22 @@ declare const EventType: {
|
|
|
9
9
|
readonly REDIRECT: "REDIRECT";
|
|
10
10
|
};
|
|
11
11
|
type TEventType = (typeof EventType)[keyof typeof EventType];
|
|
12
|
+
declare const CheckoutFormVariant: {
|
|
13
|
+
readonly DEFAULT: "DEFAULT";
|
|
14
|
+
readonly LIST: "LIST";
|
|
15
|
+
};
|
|
16
|
+
type TCheckoutFormVariant = (typeof CheckoutFormVariant)[keyof typeof CheckoutFormVariant];
|
|
12
17
|
interface FormFields {
|
|
13
18
|
isEmailVisible?: boolean;
|
|
14
19
|
isCardholderNameRequired?: boolean;
|
|
20
|
+
formVariant?: TCheckoutFormVariant;
|
|
15
21
|
}
|
|
16
22
|
interface FormStyles {
|
|
17
23
|
loaderColor?: string;
|
|
18
|
-
|
|
24
|
+
backgroundColor?: string;
|
|
19
25
|
expressButtonsSpacing?: string;
|
|
26
|
+
inputBackgroundColor?: string;
|
|
27
|
+
inputBorderRadius?: string;
|
|
20
28
|
inputBorderColor?: string;
|
|
21
29
|
inputBorderHoverColor?: string;
|
|
22
30
|
inputBorderFocusColor?: string;
|
|
@@ -26,6 +34,9 @@ interface FormStyles {
|
|
|
26
34
|
buttonHoverColor?: string;
|
|
27
35
|
buttonBorderRadius?: string;
|
|
28
36
|
buttonText?: string;
|
|
37
|
+
cardButtonColor?: string;
|
|
38
|
+
cardButtonHoverColor?: string;
|
|
39
|
+
cardButtonText?: string;
|
|
29
40
|
}
|
|
30
41
|
interface FlintNConfig {
|
|
31
42
|
clientSessionId: string;
|
|
@@ -81,4 +92,4 @@ declare const validateConfig: (config: {
|
|
|
81
92
|
}) => void;
|
|
82
93
|
declare const sanitizeToken: (token: string) => string;
|
|
83
94
|
|
|
84
|
-
export { EventType, type FlintNConfig, FlintNPayment, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TEventType, buildIframeSrc, createIframeElement, parseOrigin, sanitizeToken, validateConfig };
|
|
95
|
+
export { CheckoutFormVariant, EventType, type FlintNConfig, FlintNPayment, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TCheckoutFormVariant, type TEventType, buildIframeSrc, createIframeElement, parseOrigin, sanitizeToken, validateConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,22 @@ declare const EventType: {
|
|
|
9
9
|
readonly REDIRECT: "REDIRECT";
|
|
10
10
|
};
|
|
11
11
|
type TEventType = (typeof EventType)[keyof typeof EventType];
|
|
12
|
+
declare const CheckoutFormVariant: {
|
|
13
|
+
readonly DEFAULT: "DEFAULT";
|
|
14
|
+
readonly LIST: "LIST";
|
|
15
|
+
};
|
|
16
|
+
type TCheckoutFormVariant = (typeof CheckoutFormVariant)[keyof typeof CheckoutFormVariant];
|
|
12
17
|
interface FormFields {
|
|
13
18
|
isEmailVisible?: boolean;
|
|
14
19
|
isCardholderNameRequired?: boolean;
|
|
20
|
+
formVariant?: TCheckoutFormVariant;
|
|
15
21
|
}
|
|
16
22
|
interface FormStyles {
|
|
17
23
|
loaderColor?: string;
|
|
18
|
-
|
|
24
|
+
backgroundColor?: string;
|
|
19
25
|
expressButtonsSpacing?: string;
|
|
26
|
+
inputBackgroundColor?: string;
|
|
27
|
+
inputBorderRadius?: string;
|
|
20
28
|
inputBorderColor?: string;
|
|
21
29
|
inputBorderHoverColor?: string;
|
|
22
30
|
inputBorderFocusColor?: string;
|
|
@@ -26,6 +34,9 @@ interface FormStyles {
|
|
|
26
34
|
buttonHoverColor?: string;
|
|
27
35
|
buttonBorderRadius?: string;
|
|
28
36
|
buttonText?: string;
|
|
37
|
+
cardButtonColor?: string;
|
|
38
|
+
cardButtonHoverColor?: string;
|
|
39
|
+
cardButtonText?: string;
|
|
29
40
|
}
|
|
30
41
|
interface FlintNConfig {
|
|
31
42
|
clientSessionId: string;
|
|
@@ -81,4 +92,4 @@ declare const validateConfig: (config: {
|
|
|
81
92
|
}) => void;
|
|
82
93
|
declare const sanitizeToken: (token: string) => string;
|
|
83
94
|
|
|
84
|
-
export { EventType, type FlintNConfig, FlintNPayment, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TEventType, buildIframeSrc, createIframeElement, parseOrigin, sanitizeToken, validateConfig };
|
|
95
|
+
export { CheckoutFormVariant, EventType, type FlintNConfig, FlintNPayment, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TCheckoutFormVariant, type TEventType, buildIframeSrc, createIframeElement, parseOrigin, sanitizeToken, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
CheckoutFormVariant: () => CheckoutFormVariant,
|
|
23
24
|
EventType: () => EventType,
|
|
24
25
|
FlintNPayment: () => FlintNPayment,
|
|
25
26
|
buildIframeSrc: () => buildIframeSrc,
|
|
@@ -41,6 +42,10 @@ var EventType = {
|
|
|
41
42
|
PAYMENT_CANCELLED: "PAYMENT_CANCELLED",
|
|
42
43
|
REDIRECT: "REDIRECT"
|
|
43
44
|
};
|
|
45
|
+
var CheckoutFormVariant = {
|
|
46
|
+
DEFAULT: "DEFAULT",
|
|
47
|
+
LIST: "LIST"
|
|
48
|
+
};
|
|
44
49
|
|
|
45
50
|
// src/utils.ts
|
|
46
51
|
var parseOrigin = (origin) => {
|
|
@@ -190,6 +195,7 @@ var FlintNPayment = class {
|
|
|
190
195
|
};
|
|
191
196
|
// Annotate the CommonJS export names for ESM import in node:
|
|
192
197
|
0 && (module.exports = {
|
|
198
|
+
CheckoutFormVariant,
|
|
193
199
|
EventType,
|
|
194
200
|
FlintNPayment,
|
|
195
201
|
buildIframeSrc,
|
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,10 @@ var EventType = {
|
|
|
9
9
|
PAYMENT_CANCELLED: "PAYMENT_CANCELLED",
|
|
10
10
|
REDIRECT: "REDIRECT"
|
|
11
11
|
};
|
|
12
|
+
var CheckoutFormVariant = {
|
|
13
|
+
DEFAULT: "DEFAULT",
|
|
14
|
+
LIST: "LIST"
|
|
15
|
+
};
|
|
12
16
|
|
|
13
17
|
// src/utils.ts
|
|
14
18
|
var parseOrigin = (origin) => {
|
|
@@ -157,6 +161,7 @@ var FlintNPayment = class {
|
|
|
157
161
|
}
|
|
158
162
|
};
|
|
159
163
|
export {
|
|
164
|
+
CheckoutFormVariant,
|
|
160
165
|
EventType,
|
|
161
166
|
FlintNPayment,
|
|
162
167
|
buildIframeSrc,
|
package/dist/react.d.mts
CHANGED
|
@@ -9,14 +9,22 @@ declare const EventType: {
|
|
|
9
9
|
readonly REDIRECT: "REDIRECT";
|
|
10
10
|
};
|
|
11
11
|
type TEventType = (typeof EventType)[keyof typeof EventType];
|
|
12
|
+
declare const CheckoutFormVariant: {
|
|
13
|
+
readonly DEFAULT: "DEFAULT";
|
|
14
|
+
readonly LIST: "LIST";
|
|
15
|
+
};
|
|
16
|
+
type TCheckoutFormVariant = (typeof CheckoutFormVariant)[keyof typeof CheckoutFormVariant];
|
|
12
17
|
interface FormFields {
|
|
13
18
|
isEmailVisible?: boolean;
|
|
14
19
|
isCardholderNameRequired?: boolean;
|
|
20
|
+
formVariant?: TCheckoutFormVariant;
|
|
15
21
|
}
|
|
16
22
|
interface FormStyles {
|
|
17
23
|
loaderColor?: string;
|
|
18
|
-
|
|
24
|
+
backgroundColor?: string;
|
|
19
25
|
expressButtonsSpacing?: string;
|
|
26
|
+
inputBackgroundColor?: string;
|
|
27
|
+
inputBorderRadius?: string;
|
|
20
28
|
inputBorderColor?: string;
|
|
21
29
|
inputBorderHoverColor?: string;
|
|
22
30
|
inputBorderFocusColor?: string;
|
|
@@ -26,6 +34,9 @@ interface FormStyles {
|
|
|
26
34
|
buttonHoverColor?: string;
|
|
27
35
|
buttonBorderRadius?: string;
|
|
28
36
|
buttonText?: string;
|
|
37
|
+
cardButtonColor?: string;
|
|
38
|
+
cardButtonHoverColor?: string;
|
|
39
|
+
cardButtonText?: string;
|
|
29
40
|
}
|
|
30
41
|
interface FlintNConfig {
|
|
31
42
|
clientSessionId: string;
|
|
@@ -75,4 +86,4 @@ interface UseFlintNPaymentReturn {
|
|
|
75
86
|
}
|
|
76
87
|
declare function useFlintNPayment(options: UseFlintNPaymentOptions): UseFlintNPaymentReturn;
|
|
77
88
|
|
|
78
|
-
export { EventType, type FlintNConfig, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TEventType, type UseFlintNPaymentOptions, type UseFlintNPaymentReturn, useFlintNPayment };
|
|
89
|
+
export { CheckoutFormVariant, EventType, type FlintNConfig, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TCheckoutFormVariant, type TEventType, type UseFlintNPaymentOptions, type UseFlintNPaymentReturn, useFlintNPayment };
|
package/dist/react.d.ts
CHANGED
|
@@ -9,14 +9,22 @@ declare const EventType: {
|
|
|
9
9
|
readonly REDIRECT: "REDIRECT";
|
|
10
10
|
};
|
|
11
11
|
type TEventType = (typeof EventType)[keyof typeof EventType];
|
|
12
|
+
declare const CheckoutFormVariant: {
|
|
13
|
+
readonly DEFAULT: "DEFAULT";
|
|
14
|
+
readonly LIST: "LIST";
|
|
15
|
+
};
|
|
16
|
+
type TCheckoutFormVariant = (typeof CheckoutFormVariant)[keyof typeof CheckoutFormVariant];
|
|
12
17
|
interface FormFields {
|
|
13
18
|
isEmailVisible?: boolean;
|
|
14
19
|
isCardholderNameRequired?: boolean;
|
|
20
|
+
formVariant?: TCheckoutFormVariant;
|
|
15
21
|
}
|
|
16
22
|
interface FormStyles {
|
|
17
23
|
loaderColor?: string;
|
|
18
|
-
|
|
24
|
+
backgroundColor?: string;
|
|
19
25
|
expressButtonsSpacing?: string;
|
|
26
|
+
inputBackgroundColor?: string;
|
|
27
|
+
inputBorderRadius?: string;
|
|
20
28
|
inputBorderColor?: string;
|
|
21
29
|
inputBorderHoverColor?: string;
|
|
22
30
|
inputBorderFocusColor?: string;
|
|
@@ -26,6 +34,9 @@ interface FormStyles {
|
|
|
26
34
|
buttonHoverColor?: string;
|
|
27
35
|
buttonBorderRadius?: string;
|
|
28
36
|
buttonText?: string;
|
|
37
|
+
cardButtonColor?: string;
|
|
38
|
+
cardButtonHoverColor?: string;
|
|
39
|
+
cardButtonText?: string;
|
|
29
40
|
}
|
|
30
41
|
interface FlintNConfig {
|
|
31
42
|
clientSessionId: string;
|
|
@@ -75,4 +86,4 @@ interface UseFlintNPaymentReturn {
|
|
|
75
86
|
}
|
|
76
87
|
declare function useFlintNPayment(options: UseFlintNPaymentOptions): UseFlintNPaymentReturn;
|
|
77
88
|
|
|
78
|
-
export { EventType, type FlintNConfig, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TEventType, type UseFlintNPaymentOptions, type UseFlintNPaymentReturn, useFlintNPayment };
|
|
89
|
+
export { CheckoutFormVariant, EventType, type FlintNConfig, type FlintNPaymentOptions, type FormFields, type FormStyles, type PaymentError, type PaymentResult, type TCheckoutFormVariant, type TEventType, type UseFlintNPaymentOptions, type UseFlintNPaymentReturn, useFlintNPayment };
|
package/dist/react.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/react/index.ts
|
|
21
21
|
var react_exports = {};
|
|
22
22
|
__export(react_exports, {
|
|
23
|
+
CheckoutFormVariant: () => CheckoutFormVariant,
|
|
23
24
|
EventType: () => EventType,
|
|
24
25
|
useFlintNPayment: () => useFlintNPayment
|
|
25
26
|
});
|
|
@@ -39,6 +40,10 @@ var EventType = {
|
|
|
39
40
|
PAYMENT_CANCELLED: "PAYMENT_CANCELLED",
|
|
40
41
|
REDIRECT: "REDIRECT"
|
|
41
42
|
};
|
|
43
|
+
var CheckoutFormVariant = {
|
|
44
|
+
DEFAULT: "DEFAULT",
|
|
45
|
+
LIST: "LIST"
|
|
46
|
+
};
|
|
42
47
|
|
|
43
48
|
// src/utils.ts
|
|
44
49
|
var parseOrigin = (origin) => {
|
|
@@ -249,6 +254,7 @@ function useFlintNPayment(options) {
|
|
|
249
254
|
}
|
|
250
255
|
// Annotate the CommonJS export names for ESM import in node:
|
|
251
256
|
0 && (module.exports = {
|
|
257
|
+
CheckoutFormVariant,
|
|
252
258
|
EventType,
|
|
253
259
|
useFlintNPayment
|
|
254
260
|
});
|
package/dist/react.mjs
CHANGED
|
@@ -12,6 +12,10 @@ var EventType = {
|
|
|
12
12
|
PAYMENT_CANCELLED: "PAYMENT_CANCELLED",
|
|
13
13
|
REDIRECT: "REDIRECT"
|
|
14
14
|
};
|
|
15
|
+
var CheckoutFormVariant = {
|
|
16
|
+
DEFAULT: "DEFAULT",
|
|
17
|
+
LIST: "LIST"
|
|
18
|
+
};
|
|
15
19
|
|
|
16
20
|
// src/utils.ts
|
|
17
21
|
var parseOrigin = (origin) => {
|
|
@@ -221,6 +225,7 @@ function useFlintNPayment(options) {
|
|
|
221
225
|
};
|
|
222
226
|
}
|
|
223
227
|
export {
|
|
228
|
+
CheckoutFormVariant,
|
|
224
229
|
EventType,
|
|
225
230
|
useFlintNPayment
|
|
226
231
|
};
|
package/package.json
CHANGED