@coinflowlabs/react 5.19.0 → 5.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -10
- package/build/cjs/card-form/CoinflowCardFormV2.js +87 -10
- package/build/cjs/card-form/CoinflowCardFormV2.js.map +1 -1
- package/build/cjs/common/CoinflowTypes.d.ts +6 -5
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +1 -1
- package/build/cjs/common/CoinflowUtils.js +3 -1
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/cjs/common/card-form/cardEntryLayout.d.ts +88 -0
- package/build/cjs/common/card-form/cardEntryLayout.js +185 -0
- package/build/cjs/common/card-form/cardEntryLayout.js.map +1 -0
- package/build/cjs/common/card-form/cardFormSkeleton.d.ts +104 -0
- package/build/cjs/common/card-form/cardFormSkeleton.js +190 -0
- package/build/cjs/common/card-form/cardFormSkeleton.js.map +1 -0
- package/build/cjs/common/index.d.ts +2 -0
- package/build/cjs/common/index.js +2 -0
- package/build/cjs/common/index.js.map +1 -1
- package/build/esm/card-form/CoinflowCardFormV2.js +88 -11
- package/build/esm/card-form/CoinflowCardFormV2.js.map +1 -1
- package/build/esm/common/CoinflowTypes.d.ts +6 -5
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +1 -1
- package/build/esm/common/CoinflowUtils.js +3 -1
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/esm/common/card-form/cardEntryLayout.d.ts +88 -0
- package/build/esm/common/card-form/cardEntryLayout.js +180 -0
- package/build/esm/common/card-form/cardEntryLayout.js.map +1 -0
- package/build/esm/common/card-form/cardFormSkeleton.d.ts +104 -0
- package/build/esm/common/card-form/cardFormSkeleton.js +181 -0
- package/build/esm/common/card-form/cardFormSkeleton.js.map +1 -0
- package/build/esm/common/index.d.ts +2 -0
- package/build/esm/common/index.js +2 -0
- package/build/esm/common/index.js.map +1 -1
- package/build/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-agnostic definitions for the V2 card-form skeleton loader.
|
|
3
|
+
*
|
|
4
|
+
* The React, Vue, and Angular libraries all render the same skeleton while the
|
|
5
|
+
* card-form iframe loads. The grid templates and breakpoint come from the shared
|
|
6
|
+
* {@link buildCardEntryLayout} — the SAME source of truth the real form uses —
|
|
7
|
+
* so the skeleton reflows at exactly the width the loaded form does. Only the
|
|
8
|
+
* box styling and per-framework wiring live here.
|
|
9
|
+
*/
|
|
10
|
+
export type CardFormVariant = 'card-form' | 'card-number-form' | 'cvv-form';
|
|
11
|
+
export declare const INLINE_SKELETON_HEIGHT_PX: number;
|
|
12
|
+
/** Two-row layouts are a second field row plus the 1px divider taller. */
|
|
13
|
+
export declare const COMPACT_SKELETON_HEIGHT_PX: number;
|
|
14
|
+
export type SkeletonLayout = {
|
|
15
|
+
/** Single-row grid used at the iframe's default (wide) width. */
|
|
16
|
+
inline: string;
|
|
17
|
+
/** Two-row grid applied below `compactMaxWidthPx`; omitted when it never reflows. */
|
|
18
|
+
compact?: string;
|
|
19
|
+
/** Container width (px) below which the two-row grid applies. */
|
|
20
|
+
compactMaxWidthPx?: number;
|
|
21
|
+
/** grid-area names to render one skeleton box for, in DOM order (same in both layouts). */
|
|
22
|
+
areas: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare const SKELETON_LAYOUTS: Record<CardFormVariant, SkeletonLayout>;
|
|
25
|
+
/** Name of the shared pulse keyframes; referenced by the box `animation`. */
|
|
26
|
+
export declare const SKELETON_PULSE_ANIMATION_NAME = "coinflow-card-form-skeleton-pulse";
|
|
27
|
+
/**
|
|
28
|
+
* Duration (ms) of the skeleton's opacity fade-out. Matches the `opacity 300ms`
|
|
29
|
+
* transition each renderer applies. Renderers unmount the skeleton on
|
|
30
|
+
* `transitionend`, but that event can be skipped (reduced-motion, an ancestor
|
|
31
|
+
* `display:none`, or opacity already 0) — so they also use this as a fallback
|
|
32
|
+
* timeout to force the unmount and avoid a stuck (invisible) skeleton.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SKELETON_FADE_MS = 300;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the given container width would trigger the variant's two-row layout.
|
|
37
|
+
* Mirrors the real form's container query (`width < breakpoint`). Variants
|
|
38
|
+
* without a two-row layout never reflow.
|
|
39
|
+
*/
|
|
40
|
+
export declare function shouldStackSkeleton({ variant, width, }: {
|
|
41
|
+
variant: CardFormVariant;
|
|
42
|
+
width: number;
|
|
43
|
+
}): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Height to guess before the iframe reports its real height. The two-row layout
|
|
46
|
+
* is a field row plus divider taller than the inline one.
|
|
47
|
+
*/
|
|
48
|
+
export declare function guessSkeletonHeightPx({ variant, width, }: {
|
|
49
|
+
variant: CardFormVariant;
|
|
50
|
+
width: number;
|
|
51
|
+
}): number;
|
|
52
|
+
/**
|
|
53
|
+
* The `grid-template` to apply for the given container width. Frameworks that
|
|
54
|
+
* drive the layout from JS (Vue, Angular) call this from their resize observer;
|
|
55
|
+
* React instead injects a CSS container query via {@link buildSkeletonCss}.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getSkeletonGridTemplate({ variant, width, }: {
|
|
58
|
+
variant: CardFormVariant;
|
|
59
|
+
width: number;
|
|
60
|
+
}): string;
|
|
61
|
+
/** Stable class name for a variant's skeleton grid element. */
|
|
62
|
+
export declare function getSkeletonGridClass(variant: CardFormVariant): string;
|
|
63
|
+
/**
|
|
64
|
+
* CSS (keyframes + grid + container-query breakpoint) for the container-query
|
|
65
|
+
* driven renderer used by React, where the skeleton root is a query container.
|
|
66
|
+
*/
|
|
67
|
+
export declare function buildSkeletonCss(variant: CardFormVariant): string;
|
|
68
|
+
/**
|
|
69
|
+
* Padding (px) to inset the skeleton grid by, applied on the skeleton root. It
|
|
70
|
+
* equals the form's own chrome — its `m-0.5` margin plus 1px border — so the
|
|
71
|
+
* boxes land in the same area the real fields will, and the grid fills the root
|
|
72
|
+
* exactly (no dead space that would make the boxes look too short).
|
|
73
|
+
*/
|
|
74
|
+
export declare const SKELETON_ROOT_PADDING_PX: number;
|
|
75
|
+
/**
|
|
76
|
+
* Inline style for each skeleton box, MINUS the `background` — the fill color is
|
|
77
|
+
* theme-dependent (see {@link getSkeletonColors}) so each renderer merges it in.
|
|
78
|
+
* A hairline margin keeps a subtle gap between boxes while letting them fill
|
|
79
|
+
* nearly the full field height (the root padding handles the outer inset). Uses
|
|
80
|
+
* string units so it renders identically in React, Vue, and Angular.
|
|
81
|
+
*/
|
|
82
|
+
export declare const SKELETON_BOX_STYLE: {
|
|
83
|
+
readonly minWidth: '0';
|
|
84
|
+
readonly margin: '1px';
|
|
85
|
+
readonly borderRadius: '4px';
|
|
86
|
+
readonly opacity: '1';
|
|
87
|
+
readonly animation: "coinflow-card-form-skeleton-pulse 1.5s ease-in-out infinite";
|
|
88
|
+
};
|
|
89
|
+
export type SkeletonColors = {
|
|
90
|
+
/** Faint backdrop behind the boxes. */
|
|
91
|
+
backdrop: string;
|
|
92
|
+
/** Box fill. */
|
|
93
|
+
box: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Best-effort skeleton palette. The skeleton renders in the SDK (parent), so it
|
|
97
|
+
* can't see the form's resolved colors — it only has the optional `theme` the
|
|
98
|
+
* integrator passed. When `theme.background` is a parseable color we tint the
|
|
99
|
+
* skeleton light-on-dark or dark-on-light to match; otherwise we fall back to a
|
|
100
|
+
* neutral mid-grey that stays visible on any surface.
|
|
101
|
+
*/
|
|
102
|
+
export declare function getSkeletonColors(theme?: {
|
|
103
|
+
background?: string;
|
|
104
|
+
}): SkeletonColors;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic definitions for the V2 card-form skeleton loader.
|
|
4
|
+
*
|
|
5
|
+
* The React, Vue, and Angular libraries all render the same skeleton while the
|
|
6
|
+
* card-form iframe loads. The grid templates and breakpoint come from the shared
|
|
7
|
+
* {@link buildCardEntryLayout} — the SAME source of truth the real form uses —
|
|
8
|
+
* so the skeleton reflows at exactly the width the loaded form does. Only the
|
|
9
|
+
* box styling and per-framework wiring live here.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SKELETON_BOX_STYLE = exports.SKELETON_ROOT_PADDING_PX = exports.SKELETON_FADE_MS = exports.SKELETON_PULSE_ANIMATION_NAME = exports.SKELETON_LAYOUTS = exports.COMPACT_SKELETON_HEIGHT_PX = exports.INLINE_SKELETON_HEIGHT_PX = void 0;
|
|
13
|
+
exports.shouldStackSkeleton = shouldStackSkeleton;
|
|
14
|
+
exports.guessSkeletonHeightPx = guessSkeletonHeightPx;
|
|
15
|
+
exports.getSkeletonGridTemplate = getSkeletonGridTemplate;
|
|
16
|
+
exports.getSkeletonGridClass = getSkeletonGridClass;
|
|
17
|
+
exports.buildSkeletonCss = buildSkeletonCss;
|
|
18
|
+
exports.getSkeletonColors = getSkeletonColors;
|
|
19
|
+
const cardEntryLayout_1 = require("./cardEntryLayout");
|
|
20
|
+
/** Which fields each iframe variant mounts. */
|
|
21
|
+
const VARIANT_INPUTS = {
|
|
22
|
+
'card-form': ['card-number', 'expiration', 'cvv'],
|
|
23
|
+
'card-number-form': ['card-number', 'expiration'],
|
|
24
|
+
'cvv-form': ['cvv'],
|
|
25
|
+
};
|
|
26
|
+
// The iframe skeletons render without the optional card-brand icon.
|
|
27
|
+
const CARD_ENTRY_LAYOUTS = {
|
|
28
|
+
'card-form': (0, cardEntryLayout_1.buildCardEntryLayout)({ inputs: VARIANT_INPUTS['card-form'] }),
|
|
29
|
+
'card-number-form': (0, cardEntryLayout_1.buildCardEntryLayout)({
|
|
30
|
+
inputs: VARIANT_INPUTS['card-number-form'],
|
|
31
|
+
}),
|
|
32
|
+
'cvv-form': (0, cardEntryLayout_1.buildCardEntryLayout)({ inputs: VARIANT_INPUTS['cvv-form'] }),
|
|
33
|
+
};
|
|
34
|
+
// Iframe height (px) to guess before it reports its real height. Matches the
|
|
35
|
+
// form's rendered height so the skeleton→form swap doesn't jump: field row(s) +
|
|
36
|
+
// the 1px border and the box's `m-0.5` margin on top and bottom.
|
|
37
|
+
const CARD_ENTRY_VERTICAL_CHROME_PX = 2 * cardEntryLayout_1.CARD_ENTRY_BORDER_PX + 2 * cardEntryLayout_1.CARD_ENTRY_MARGIN_PX;
|
|
38
|
+
exports.INLINE_SKELETON_HEIGHT_PX = cardEntryLayout_1.CARD_ENTRY_ROW_HEIGHT_PX + CARD_ENTRY_VERTICAL_CHROME_PX;
|
|
39
|
+
/** Two-row layouts are a second field row plus the 1px divider taller. */
|
|
40
|
+
exports.COMPACT_SKELETON_HEIGHT_PX = 2 * cardEntryLayout_1.CARD_ENTRY_ROW_HEIGHT_PX +
|
|
41
|
+
cardEntryLayout_1.CARD_ENTRY_DIVIDER_PX +
|
|
42
|
+
CARD_ENTRY_VERTICAL_CHROME_PX;
|
|
43
|
+
function toSkeletonLayout(layout) {
|
|
44
|
+
return {
|
|
45
|
+
inline: layout.inline,
|
|
46
|
+
compact: layout.twoRow ?? undefined,
|
|
47
|
+
compactMaxWidthPx: layout.breakpointPx ?? undefined,
|
|
48
|
+
areas: layout.fieldAreas,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.SKELETON_LAYOUTS = {
|
|
52
|
+
'card-form': toSkeletonLayout(CARD_ENTRY_LAYOUTS['card-form']),
|
|
53
|
+
'card-number-form': toSkeletonLayout(CARD_ENTRY_LAYOUTS['card-number-form']),
|
|
54
|
+
'cvv-form': toSkeletonLayout(CARD_ENTRY_LAYOUTS['cvv-form']),
|
|
55
|
+
};
|
|
56
|
+
/** Name of the shared pulse keyframes; referenced by the box `animation`. */
|
|
57
|
+
exports.SKELETON_PULSE_ANIMATION_NAME = 'coinflow-card-form-skeleton-pulse';
|
|
58
|
+
/**
|
|
59
|
+
* Duration (ms) of the skeleton's opacity fade-out. Matches the `opacity 300ms`
|
|
60
|
+
* transition each renderer applies. Renderers unmount the skeleton on
|
|
61
|
+
* `transitionend`, but that event can be skipped (reduced-motion, an ancestor
|
|
62
|
+
* `display:none`, or opacity already 0) — so they also use this as a fallback
|
|
63
|
+
* timeout to force the unmount and avoid a stuck (invisible) skeleton.
|
|
64
|
+
*/
|
|
65
|
+
exports.SKELETON_FADE_MS = 300;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the given container width would trigger the variant's two-row layout.
|
|
68
|
+
* Mirrors the real form's container query (`width < breakpoint`). Variants
|
|
69
|
+
* without a two-row layout never reflow.
|
|
70
|
+
*/
|
|
71
|
+
function shouldStackSkeleton({ variant, width, }) {
|
|
72
|
+
const { compact, compactMaxWidthPx } = exports.SKELETON_LAYOUTS[variant];
|
|
73
|
+
return (compact !== undefined &&
|
|
74
|
+
compactMaxWidthPx !== undefined &&
|
|
75
|
+
width > 0 &&
|
|
76
|
+
width < compactMaxWidthPx);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Height to guess before the iframe reports its real height. The two-row layout
|
|
80
|
+
* is a field row plus divider taller than the inline one.
|
|
81
|
+
*/
|
|
82
|
+
function guessSkeletonHeightPx({ variant, width, }) {
|
|
83
|
+
return shouldStackSkeleton({ variant, width })
|
|
84
|
+
? exports.COMPACT_SKELETON_HEIGHT_PX
|
|
85
|
+
: exports.INLINE_SKELETON_HEIGHT_PX;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The `grid-template` to apply for the given container width. Frameworks that
|
|
89
|
+
* drive the layout from JS (Vue, Angular) call this from their resize observer;
|
|
90
|
+
* React instead injects a CSS container query via {@link buildSkeletonCss}.
|
|
91
|
+
*/
|
|
92
|
+
function getSkeletonGridTemplate({ variant, width, }) {
|
|
93
|
+
const { inline, compact } = exports.SKELETON_LAYOUTS[variant];
|
|
94
|
+
if (compact && shouldStackSkeleton({ variant, width }))
|
|
95
|
+
return compact;
|
|
96
|
+
return inline;
|
|
97
|
+
}
|
|
98
|
+
/** Stable class name for a variant's skeleton grid element. */
|
|
99
|
+
function getSkeletonGridClass(variant) {
|
|
100
|
+
return `coinflow-card-form-skeleton-grid--${variant}`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* CSS (keyframes + grid + container-query breakpoint) for the container-query
|
|
104
|
+
* driven renderer used by React, where the skeleton root is a query container.
|
|
105
|
+
*/
|
|
106
|
+
function buildSkeletonCss(variant) {
|
|
107
|
+
const gridClass = getSkeletonGridClass(variant);
|
|
108
|
+
const grid = (0, cardEntryLayout_1.buildCardEntryGridCss)({
|
|
109
|
+
gridSelector: `.${gridClass}`,
|
|
110
|
+
layout: CARD_ENTRY_LAYOUTS[variant],
|
|
111
|
+
extraBaseRules: `.${gridClass} { gap: 0; flex: 1; }`,
|
|
112
|
+
});
|
|
113
|
+
return `@keyframes ${exports.SKELETON_PULSE_ANIMATION_NAME} {0%,100%{opacity:1}50%{opacity:0.4}}
|
|
114
|
+
${grid}`;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Padding (px) to inset the skeleton grid by, applied on the skeleton root. It
|
|
118
|
+
* equals the form's own chrome — its `m-0.5` margin plus 1px border — so the
|
|
119
|
+
* boxes land in the same area the real fields will, and the grid fills the root
|
|
120
|
+
* exactly (no dead space that would make the boxes look too short).
|
|
121
|
+
*/
|
|
122
|
+
exports.SKELETON_ROOT_PADDING_PX = cardEntryLayout_1.CARD_ENTRY_MARGIN_PX + cardEntryLayout_1.CARD_ENTRY_BORDER_PX;
|
|
123
|
+
/**
|
|
124
|
+
* Inline style for each skeleton box, MINUS the `background` — the fill color is
|
|
125
|
+
* theme-dependent (see {@link getSkeletonColors}) so each renderer merges it in.
|
|
126
|
+
* A hairline margin keeps a subtle gap between boxes while letting them fill
|
|
127
|
+
* nearly the full field height (the root padding handles the outer inset). Uses
|
|
128
|
+
* string units so it renders identically in React, Vue, and Angular.
|
|
129
|
+
*/
|
|
130
|
+
exports.SKELETON_BOX_STYLE = {
|
|
131
|
+
minWidth: '0',
|
|
132
|
+
margin: '1px',
|
|
133
|
+
borderRadius: '4px',
|
|
134
|
+
opacity: '1',
|
|
135
|
+
animation: `${exports.SKELETON_PULSE_ANIMATION_NAME} 1.5s ease-in-out infinite`,
|
|
136
|
+
};
|
|
137
|
+
// Dark surface → light skeleton; light surface → dark skeleton (the original
|
|
138
|
+
// look); unknown → a neutral mid-grey that reads on either.
|
|
139
|
+
const DARK_SURFACE_COLORS = {
|
|
140
|
+
backdrop: 'rgba(255, 255, 255, 0.05)',
|
|
141
|
+
box: 'rgba(255, 255, 255, 0.30)',
|
|
142
|
+
};
|
|
143
|
+
const LIGHT_SURFACE_COLORS = {
|
|
144
|
+
backdrop: 'rgba(0, 0, 0, 0.04)',
|
|
145
|
+
box: 'rgba(0, 0, 0, 0.30)',
|
|
146
|
+
};
|
|
147
|
+
const NEUTRAL_COLORS = {
|
|
148
|
+
backdrop: 'rgba(128, 128, 128, 0.08)',
|
|
149
|
+
box: 'rgba(128, 128, 128, 0.38)',
|
|
150
|
+
};
|
|
151
|
+
/** Parse a hex (#rgb/#rrggbb/#rrggbbaa) or rgb()/rgba() string to [r,g,b]. */
|
|
152
|
+
function parseRgb(color) {
|
|
153
|
+
const c = color.trim().toLowerCase();
|
|
154
|
+
let hex = c.startsWith('#') ? c.slice(1) : '';
|
|
155
|
+
if (hex && /^[0-9a-f]+$/.test(hex)) {
|
|
156
|
+
if (hex.length === 3)
|
|
157
|
+
hex = hex
|
|
158
|
+
.split('')
|
|
159
|
+
.map(x => x + x)
|
|
160
|
+
.join('');
|
|
161
|
+
if (hex.length === 8)
|
|
162
|
+
hex = hex.slice(0, 6);
|
|
163
|
+
if (hex.length === 6)
|
|
164
|
+
return [
|
|
165
|
+
parseInt(hex.slice(0, 2), 16),
|
|
166
|
+
parseInt(hex.slice(2, 4), 16),
|
|
167
|
+
parseInt(hex.slice(4, 6), 16),
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
const m = c.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/);
|
|
171
|
+
if (m)
|
|
172
|
+
return [Number(m[1]), Number(m[2]), Number(m[3])];
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Best-effort skeleton palette. The skeleton renders in the SDK (parent), so it
|
|
177
|
+
* can't see the form's resolved colors — it only has the optional `theme` the
|
|
178
|
+
* integrator passed. When `theme.background` is a parseable color we tint the
|
|
179
|
+
* skeleton light-on-dark or dark-on-light to match; otherwise we fall back to a
|
|
180
|
+
* neutral mid-grey that stays visible on any surface.
|
|
181
|
+
*/
|
|
182
|
+
function getSkeletonColors(theme) {
|
|
183
|
+
const rgb = theme?.background ? parseRgb(theme.background) : null;
|
|
184
|
+
if (!rgb)
|
|
185
|
+
return NEUTRAL_COLORS;
|
|
186
|
+
const [r, g, b] = rgb;
|
|
187
|
+
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
188
|
+
return luminance < 0.5 ? DARK_SURFACE_COLORS : LIGHT_SURFACE_COLORS;
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=cardFormSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardFormSkeleton.js","sourceRoot":"","sources":["../../../../src/common/card-form/cardFormSkeleton.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;AAEH,uDAS2B;AAI3B,+CAA+C;AAC/C,MAAM,cAAc,GAAkD;IACpE,WAAW,EAAE,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,CAAC;IACjD,kBAAkB,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC;IACjD,UAAU,EAAE,CAAC,KAAK,CAAC;CACpB,CAAC;AAEF,oEAAoE;AACpE,MAAM,kBAAk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AC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;gBAC7B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;gBAC7B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;aAC9B,CAAC;IACN,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,IAAI,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,2BAAkC,KAEjC;IACC,MAAM,GAAG,GAAG,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClE,IAAI,CAAC,GAAG;QAAE,OAAO,cAAc,CAAC;IAChC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;IACtB,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC5D,OAAO,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,oBAAoB,CAAC;AACtE,CAAC"}
|
|
@@ -4,6 +4,8 @@ export * from './CoinflowLibMessageHandlers';
|
|
|
4
4
|
export * from './EventBus';
|
|
5
5
|
export * from './card-form/TokenEx';
|
|
6
6
|
export * from './card-form/tokenexHelpers';
|
|
7
|
+
export * from './card-form/cardEntryLayout';
|
|
8
|
+
export * from './card-form/cardFormSkeleton';
|
|
7
9
|
export * from './types/Subtotal';
|
|
8
10
|
export * from './types/AnyObject';
|
|
9
11
|
export * from './types/giftCardCartItem';
|
|
@@ -8,6 +8,8 @@ tslib_1.__exportStar(require("./CoinflowLibMessageHandlers"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./EventBus"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./card-form/TokenEx"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./card-form/tokenexHelpers"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./card-form/cardEntryLayout"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./card-form/cardFormSkeleton"), exports);
|
|
11
13
|
tslib_1.__exportStar(require("./types/Subtotal"), exports);
|
|
12
14
|
tslib_1.__exportStar(require("./types/AnyObject"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./types/giftCardCartItem"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,uEAA6C;AAC7C,qDAA2B;AAC3B,8DAAoC;AACpC,qEAA2C;AAC3C,2DAAiC;AACjC,4DAAkC;AAClC,mEAAyC;AACzC,8DAAoC;AACpC,iEAAuC;AACvC,8EAAoD;AACpD,mEAAyC;AACzC,mCAIkB;AAHhB,iIAAA,OAAO,OAAkB;AACzB,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,uEAA6C;AAC7C,qDAA2B;AAC3B,8DAAoC;AACpC,qEAA2C;AAC3C,sEAA4C;AAC5C,uEAA6C;AAC7C,2DAAiC;AACjC,4DAAkC;AAClC,mEAAyC;AACzC,8DAAoC;AACpC,iEAAuC;AACvC,8EAAoD;AACpD,mEAAyC;AACzC,mCAIkB;AAHhB,iIAAA,OAAO,OAAkB;AACzB,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
2
2
|
import LZString from 'lz-string';
|
|
3
|
-
import { CoinflowUtils, IFrameMessageMethods, } from '../common';
|
|
3
|
+
import { buildSkeletonCss, CoinflowUtils, getSkeletonColors, getSkeletonGridClass, guessSkeletonHeightPx, IFrameMessageMethods, INLINE_SKELETON_HEIGHT_PX, SKELETON_BOX_STYLE, SKELETON_FADE_MS, SKELETON_LAYOUTS, SKELETON_ROOT_PADDING_PX, } from '../common';
|
|
4
4
|
function useCardFormIframe({ variant, merchantId, env, theme, token, onLoad, }) {
|
|
5
5
|
const iframeRef = useRef(null);
|
|
6
6
|
const [loaded, setLoaded] = useState(false);
|
|
@@ -18,7 +18,13 @@ function useCardFormIframe({ variant, merchantId, env, theme, token, onLoad, })
|
|
|
18
18
|
}
|
|
19
19
|
return url.toString();
|
|
20
20
|
}, [variant, merchantId, env, theme, token]);
|
|
21
|
-
const handleMessage = useCallback((
|
|
21
|
+
const handleMessage = useCallback((event) => {
|
|
22
|
+
const { data, origin, source } = event;
|
|
23
|
+
// Only honor messages from THIS instance's iframe. Multiple card forms on
|
|
24
|
+
// one page each listen on `window`, so without this every instance would
|
|
25
|
+
// apply every other iframe's height/loaded events to itself.
|
|
26
|
+
if (source !== iframeRef.current?.contentWindow)
|
|
27
|
+
return;
|
|
22
28
|
const expectedOrigin = new URL(CoinflowUtils.getCoinflowBaseUrl(env))
|
|
23
29
|
.origin;
|
|
24
30
|
if (origin !== expectedOrigin)
|
|
@@ -94,7 +100,7 @@ const CoinflowCardFormComponent = forwardRef((props, ref) => {
|
|
|
94
100
|
variant: 'card-form',
|
|
95
101
|
});
|
|
96
102
|
useImperativeHandle(ref, () => ({ tokenize }), [tokenize]);
|
|
97
|
-
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "Card Form" }));
|
|
103
|
+
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "Card Form", variant: "card-form", theme: props.theme }));
|
|
98
104
|
});
|
|
99
105
|
const CoinflowCardNumberFormComponent = forwardRef((props, ref) => {
|
|
100
106
|
const { iframeRef, url, loaded, tokenize, iframeHeight } = useCardFormIframe({
|
|
@@ -102,7 +108,7 @@ const CoinflowCardNumberFormComponent = forwardRef((props, ref) => {
|
|
|
102
108
|
variant: 'card-number-form',
|
|
103
109
|
});
|
|
104
110
|
useImperativeHandle(ref, () => ({ tokenize }), [tokenize]);
|
|
105
|
-
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "Card Number Form" }));
|
|
111
|
+
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "Card Number Form", variant: "card-number-form", theme: props.theme }));
|
|
106
112
|
});
|
|
107
113
|
const CoinflowCvvFormComponent = forwardRef((props, ref) => {
|
|
108
114
|
const { iframeRef, url, loaded, tokenize, iframeHeight } = useCardFormIframe({
|
|
@@ -110,16 +116,87 @@ const CoinflowCvvFormComponent = forwardRef((props, ref) => {
|
|
|
110
116
|
variant: 'cvv-form',
|
|
111
117
|
});
|
|
112
118
|
useImperativeHandle(ref, () => ({ tokenize }), [tokenize]);
|
|
113
|
-
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "CVV Form" }));
|
|
119
|
+
return (React.createElement(CardFormIFrame, { iframeRef: iframeRef, url: url, loaded: loaded, iframeHeight: iframeHeight, title: "CVV Form", variant: "cvv-form", theme: props.theme }));
|
|
114
120
|
});
|
|
115
|
-
function CardFormIFrame({ iframeRef, url, loaded, iframeHeight, title, }) {
|
|
116
|
-
|
|
121
|
+
function CardFormIFrame({ iframeRef, url, loaded, iframeHeight, title, variant, theme, }) {
|
|
122
|
+
const wrapperRef = useRef(null);
|
|
123
|
+
// Guess the skeleton height from the container width until the iframe reports
|
|
124
|
+
// its real height: compact (stacked) layouts are taller than the inline one.
|
|
125
|
+
const [guessHeight, setGuessHeight] = useState(INLINE_SKELETON_HEIGHT_PX);
|
|
126
|
+
useLayoutEffect(() => {
|
|
127
|
+
// Measure the wrapper div, not the iframe: a freshly-mounted <iframe> is a
|
|
128
|
+
// replaced element with an intrinsic 300px default width before its
|
|
129
|
+
// width:100% resolves, which would briefly (and wrongly) trip the compact
|
|
130
|
+
// breakpoint and jump the height. A block div reports the true container
|
|
131
|
+
// width immediately.
|
|
132
|
+
const el = wrapperRef.current;
|
|
133
|
+
if (!el || !SKELETON_LAYOUTS[variant].compact)
|
|
134
|
+
return;
|
|
135
|
+
const measure = () => setGuessHeight(guessSkeletonHeightPx({ variant, width: el.clientWidth }));
|
|
136
|
+
measure();
|
|
137
|
+
const observer = new ResizeObserver(measure);
|
|
138
|
+
observer.observe(el);
|
|
139
|
+
return () => observer.disconnect();
|
|
140
|
+
}, [variant]);
|
|
141
|
+
const height = loaded && iframeHeight ? `${iframeHeight}px` : `${guessHeight}px`;
|
|
142
|
+
return (React.createElement("div", { ref: wrapperRef, style: { position: 'relative', width: '100%', height } },
|
|
143
|
+
React.createElement(CardFormSkeleton, { variant: variant, hidden: loaded, theme: theme }),
|
|
144
|
+
React.createElement("iframe", { ref: iframeRef, src: url, title: title, frameBorder: "0", allow: "payment", style: {
|
|
145
|
+
width: '100%',
|
|
146
|
+
height,
|
|
147
|
+
border: 'none',
|
|
148
|
+
opacity: loaded ? 1 : 0,
|
|
149
|
+
transition: 'opacity 300ms linear, height 150ms ease-out',
|
|
150
|
+
} })));
|
|
151
|
+
}
|
|
152
|
+
function CardFormSkeleton({ variant, hidden, theme, }) {
|
|
153
|
+
// Stay mounted while fading out so the opacity transition can play, then
|
|
154
|
+
// unmount on transition end. Remount instantly when shown again.
|
|
155
|
+
const [rendered, setRendered] = useState(!hidden);
|
|
156
|
+
if (!hidden && !rendered)
|
|
157
|
+
setRendered(true);
|
|
158
|
+
// Fallback unmount: `transitionend` may never fire (reduced-motion, an
|
|
159
|
+
// ancestor display:none, or opacity already 0), so force cleanup after the
|
|
160
|
+
// fade window regardless.
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!hidden)
|
|
163
|
+
return;
|
|
164
|
+
const timer = setTimeout(() => setRendered(false), SKELETON_FADE_MS);
|
|
165
|
+
return () => clearTimeout(timer);
|
|
166
|
+
}, [hidden]);
|
|
167
|
+
if (!rendered)
|
|
168
|
+
return null;
|
|
169
|
+
const layout = SKELETON_LAYOUTS[variant];
|
|
170
|
+
const gridClass = getSkeletonGridClass(variant);
|
|
171
|
+
// Best-effort tint from the merchant theme's background (neutral when absent).
|
|
172
|
+
const colors = getSkeletonColors(theme);
|
|
173
|
+
return (React.createElement("div", { role: "status", "aria-label": "Loading card form", onTransitionEnd: e => {
|
|
174
|
+
if (e.propertyName === 'opacity' && hidden)
|
|
175
|
+
setRendered(false);
|
|
176
|
+
}, style: {
|
|
177
|
+
position: 'absolute',
|
|
178
|
+
top: 0,
|
|
179
|
+
left: 0,
|
|
117
180
|
width: '100%',
|
|
118
|
-
height:
|
|
119
|
-
|
|
120
|
-
|
|
181
|
+
height: '100%',
|
|
182
|
+
display: 'flex',
|
|
183
|
+
pointerEvents: 'none',
|
|
184
|
+
flexDirection: 'column',
|
|
185
|
+
gap: 8,
|
|
186
|
+
padding: SKELETON_ROOT_PADDING_PX,
|
|
187
|
+
boxSizing: 'border-box',
|
|
188
|
+
borderRadius: 8,
|
|
189
|
+
background: colors.backdrop,
|
|
190
|
+
containerType: 'inline-size',
|
|
191
|
+
opacity: hidden ? '0%' : '100%',
|
|
121
192
|
transition: 'opacity 300ms linear, height 150ms ease-out',
|
|
122
|
-
} }
|
|
193
|
+
} },
|
|
194
|
+
React.createElement("style", null, buildSkeletonCss(variant)),
|
|
195
|
+
React.createElement("div", { className: gridClass }, layout.areas.map(area => (React.createElement("div", { key: area, style: {
|
|
196
|
+
...SKELETON_BOX_STYLE,
|
|
197
|
+
background: colors.box,
|
|
198
|
+
gridArea: area,
|
|
199
|
+
} }))))));
|
|
123
200
|
}
|
|
124
201
|
export const CoinflowCardForm = memo(CoinflowCardFormComponent);
|
|
125
202
|
export const CoinflowCardNumberForm = memo(CoinflowCardNumberFormComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardFormV2.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardFormV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,IAAI,EACJ,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"CoinflowCardFormV2.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardFormV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,IAAI,EACJ,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,gBAAgB,EAGhB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAEzB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AA6BnB,SAAS,iBAAiB,CAAC,EACzB,OAAO,EACP,UAAU,EACV,GAAG,EACH,KAAK,EACL,KAA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
* The DeviceID gotten from the Coinflow SDK:
|
|
287
287
|
* https://docs.coinflow.cash/guides/checkout/fraud-protection/chargeback-protection/implement-chargeback-protection#how-to-add-chargeback-protection
|
|
288
|
-
*
|
|
289
|
-
* nSureSDK.getDeviceId()
|
|
290
288
|
*/
|
|
291
289
|
deviceId?: string;
|
|
292
290
|
/**
|
|
@@ -347,8 +345,6 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
347
345
|
/**
|
|
348
346
|
* The DeviceID gotten from the Coinflow SDK:
|
|
349
347
|
* https://docs.coinflow.cash/guides/checkout/fraud-protection/chargeback-protection/implement-chargeback-protection#how-to-add-chargeback-protection
|
|
350
|
-
*
|
|
351
|
-
* nSureSDK.getDeviceId()
|
|
352
348
|
*/
|
|
353
349
|
deviceId?: string;
|
|
354
350
|
jwtToken?: string;
|
|
@@ -368,6 +364,11 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
368
364
|
threeDsChallengePreference?: ThreeDsChallengePreference;
|
|
369
365
|
destinationAuthKey?: string;
|
|
370
366
|
accountFundingTransaction?: AccountFundingTransaction;
|
|
367
|
+
/**
|
|
368
|
+
* Custom preset deposit amounts (in dollars) to display in the AmountSelector.
|
|
369
|
+
* Only the first 3 values are used. Defaults to [10, 25, 50] if not provided.
|
|
370
|
+
*/
|
|
371
|
+
depositAmounts?: number[];
|
|
371
372
|
}
|
|
372
373
|
export interface WithGeo {
|
|
373
374
|
/**
|
|
@@ -638,7 +639,7 @@ export interface DecentRedeem extends CommonEvmRedeem {
|
|
|
638
639
|
* Gas fees for the transaction will be automatically calculated and added to the total charged to the customer. Optionally the merchant can opt to pay for these gas fees.
|
|
639
640
|
*/
|
|
640
641
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem;
|
|
641
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
|
|
642
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
|
|
642
643
|
walletPubkey: string | null | undefined;
|
|
643
644
|
sessionKey?: string;
|
|
644
645
|
route: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","s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;IACnC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK;IAC3B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ;IACjC,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO;IAC/B,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS;CACpC,CAAC;AAqhBF,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AA4CD,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC,CAAC,gBAAgB"}
|
|
@@ -7,7 +7,7 @@ export declare class CoinflowUtils {
|
|
|
7
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
8
|
static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
|
|
9
9
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
10
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, baseUrl, }: CoinflowIFrameProps & {
|
|
10
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, depositAmounts, baseUrl, }: CoinflowIFrameProps & {
|
|
11
11
|
baseUrl?: string;
|
|
12
12
|
} & WithGeo): string;
|
|
13
13
|
static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
|
|
@@ -50,7 +50,7 @@ export class CoinflowUtils {
|
|
|
50
50
|
return 'http://localhost:5000';
|
|
51
51
|
return `https://api-${env}.coinflow.cash`;
|
|
52
52
|
}
|
|
53
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain = 'solana', webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, baseUrl, }) {
|
|
53
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain = 'solana', webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, depositAmounts, baseUrl, }) {
|
|
54
54
|
const prefix = routePrefix
|
|
55
55
|
? `/${routePrefix}/${blockchain}`
|
|
56
56
|
: `/${blockchain}`;
|
|
@@ -162,6 +162,8 @@ export class CoinflowUtils {
|
|
|
162
162
|
url.searchParams.append('origins', LZString.compressToEncodedURIComponent(JSON.stringify(origins)));
|
|
163
163
|
if (allowedPaymentMethods)
|
|
164
164
|
url.searchParams.append('allowedPaymentMethods', allowedPaymentMethods.join(','));
|
|
165
|
+
if (depositAmounts)
|
|
166
|
+
url.searchParams.append('depositAmounts', depositAmounts.join(','));
|
|
165
167
|
if (threeDsChallengePreference)
|
|
166
168
|
url.searchParams.append('threeDsChallengePreference', threeDsChallengePreference);
|
|
167
169
|
if (destinationAuthKey)
|