@coinflowlabs/react 5.20.0 → 5.21.1
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/CoinflowIFrame.js +4 -0
- package/build/cjs/CoinflowIFrame.js.map +1 -1
- package/build/cjs/MobileWalletButton.js +3 -1
- package/build/cjs/MobileWalletButton.js.map +1 -1
- 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 +26 -3
- package/build/cjs/common/CoinflowTypes.js +1 -0
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +1 -1
- package/build/cjs/common/CoinflowUtils.js +5 -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 +6 -0
- package/build/cjs/common/index.js +6 -0
- package/build/cjs/common/index.js.map +1 -1
- package/build/cjs/common/types/flightTicketCartItem.d.ts +49 -0
- package/build/cjs/common/types/flightTicketCartItem.js +3 -0
- package/build/cjs/common/types/flightTicketCartItem.js.map +1 -0
- package/build/cjs/common/types/flightUpgradeCartItem.d.ts +49 -0
- package/build/cjs/common/types/flightUpgradeCartItem.js +3 -0
- package/build/cjs/common/types/flightUpgradeCartItem.js.map +1 -0
- package/build/cjs/common/types/lodgingCartItem.d.ts +37 -0
- package/build/cjs/common/types/lodgingCartItem.js +3 -0
- package/build/cjs/common/types/lodgingCartItem.js.map +1 -0
- package/build/cjs/common/types/travelCartItem.d.ts +212 -0
- package/build/cjs/common/types/travelCartItem.js +3 -0
- package/build/cjs/common/types/travelCartItem.js.map +1 -0
- package/build/esm/CoinflowIFrame.js +4 -0
- package/build/esm/CoinflowIFrame.js.map +1 -1
- package/build/esm/MobileWalletButton.js +3 -1
- package/build/esm/MobileWalletButton.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 +26 -3
- package/build/esm/common/CoinflowTypes.js +1 -0
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +1 -1
- package/build/esm/common/CoinflowUtils.js +5 -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 +6 -0
- package/build/esm/common/index.js +6 -0
- package/build/esm/common/index.js.map +1 -1
- package/build/esm/common/types/flightTicketCartItem.d.ts +49 -0
- package/build/esm/common/types/flightTicketCartItem.js +2 -0
- package/build/esm/common/types/flightTicketCartItem.js.map +1 -0
- package/build/esm/common/types/flightUpgradeCartItem.d.ts +49 -0
- package/build/esm/common/types/flightUpgradeCartItem.js +2 -0
- package/build/esm/common/types/flightUpgradeCartItem.js.map +1 -0
- package/build/esm/common/types/lodgingCartItem.d.ts +37 -0
- package/build/esm/common/types/lodgingCartItem.js +2 -0
- package/build/esm/common/types/lodgingCartItem.js.map +1 -0
- package/build/esm/common/types/travelCartItem.d.ts +212 -0
- package/build/esm/common/types/travelCartItem.js +2 -0
- package/build/esm/common/types/travelCartItem.js.map +1 -0
- package/build/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CurrencyAmount, RecipientInfo } from './CartitemCommon';
|
|
2
|
+
import { AnyObject } from './AnyObject';
|
|
3
|
+
import { TravelLodging } from './travelCartItem';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a lodging reservation item in a shopping cart.
|
|
6
|
+
* The reservation fields are flattened at the top level of the item.
|
|
7
|
+
*/
|
|
8
|
+
export interface LodgingCartItem extends TravelLodging {
|
|
9
|
+
/**
|
|
10
|
+
* Denotes the cart item class. The item schema is chosen based on this value.
|
|
11
|
+
* Allowed value: lodging
|
|
12
|
+
* Example: lodging
|
|
13
|
+
*/
|
|
14
|
+
itemClass: 'lodging';
|
|
15
|
+
/**
|
|
16
|
+
* The cart items's unique ID
|
|
17
|
+
* Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Any additional product data which can be provided, e.g. description, link to image, etc
|
|
22
|
+
* Example: {"any":"data","description":"This is the product description"}
|
|
23
|
+
*/
|
|
24
|
+
rawProductData?: AnyObject;
|
|
25
|
+
/**
|
|
26
|
+
* The item's selling price
|
|
27
|
+
*/
|
|
28
|
+
sellingPrice: CurrencyAmount;
|
|
29
|
+
/**
|
|
30
|
+
* The item's list price
|
|
31
|
+
*/
|
|
32
|
+
listPrice?: CurrencyAmount;
|
|
33
|
+
/**
|
|
34
|
+
* The user's personal info
|
|
35
|
+
*/
|
|
36
|
+
recipientInfo?: RecipientInfo;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lodgingCartItem.js","sourceRoot":"","sources":["../../../../src/common/types/lodgingCartItem.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { CurrencyAmount, RecipientInfo } from './CartitemCommon';
|
|
2
|
+
import { AnyObject } from './AnyObject';
|
|
3
|
+
/**
|
|
4
|
+
* The booked hotel details
|
|
5
|
+
*/
|
|
6
|
+
export interface TravelLodgingHotel {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the hotel
|
|
9
|
+
* Example: The Plaza Hotel
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The two-letter code of the country in which the hotel is located
|
|
14
|
+
* Example: US
|
|
15
|
+
* Pattern: ^[A-Z]{2}$
|
|
16
|
+
*/
|
|
17
|
+
country: string;
|
|
18
|
+
/**
|
|
19
|
+
* The city in which the hotel is located
|
|
20
|
+
* Example: New York
|
|
21
|
+
*/
|
|
22
|
+
city: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The lodging details of the travel booking
|
|
26
|
+
*/
|
|
27
|
+
export interface TravelLodging {
|
|
28
|
+
/**
|
|
29
|
+
* Hotel reservation id
|
|
30
|
+
* Example: X36Q9C
|
|
31
|
+
*/
|
|
32
|
+
reservationId: string;
|
|
33
|
+
/**
|
|
34
|
+
* The number of nights booked in the reservation
|
|
35
|
+
* Min value: 1
|
|
36
|
+
* Example: 2
|
|
37
|
+
*/
|
|
38
|
+
nights: number;
|
|
39
|
+
/**
|
|
40
|
+
* The check-in date
|
|
41
|
+
* Example: 2022-05-02
|
|
42
|
+
*/
|
|
43
|
+
checkInDate: string;
|
|
44
|
+
/**
|
|
45
|
+
* The hour of day in which the check-in is done
|
|
46
|
+
* Example: 18
|
|
47
|
+
* Pattern: ^([01][0-9]|2[0-3])$
|
|
48
|
+
*/
|
|
49
|
+
checkInHour: string;
|
|
50
|
+
/**
|
|
51
|
+
* The booked hotel details
|
|
52
|
+
*/
|
|
53
|
+
hotel: TravelLodgingHotel;
|
|
54
|
+
/**
|
|
55
|
+
* Indicates whether extras were purchased in the reservation
|
|
56
|
+
*/
|
|
57
|
+
wereExtrasPurchased: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates whether the reservation is refundable
|
|
60
|
+
*/
|
|
61
|
+
isRefundable: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The most luxurious room booked in the reservation
|
|
64
|
+
* Example: Presidential Suite
|
|
65
|
+
*/
|
|
66
|
+
highestRoomType: string;
|
|
67
|
+
/**
|
|
68
|
+
* The number of rooms booked in the reservation
|
|
69
|
+
* Min value: 1
|
|
70
|
+
* Example: 2
|
|
71
|
+
*/
|
|
72
|
+
numberOfRooms: number;
|
|
73
|
+
/**
|
|
74
|
+
* The number of guests in the reservation
|
|
75
|
+
* Min value: 1
|
|
76
|
+
* Example: 4
|
|
77
|
+
*/
|
|
78
|
+
numberOfGuests: number;
|
|
79
|
+
/**
|
|
80
|
+
* The number of kids, out of the number of guests in the reservation
|
|
81
|
+
* Min value: 0
|
|
82
|
+
* Example: 2
|
|
83
|
+
*/
|
|
84
|
+
numberOfKids: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The trip details of the travel booking
|
|
88
|
+
*/
|
|
89
|
+
export interface TravelTrip {
|
|
90
|
+
/**
|
|
91
|
+
* The number of flights in the trip
|
|
92
|
+
* Min value: 1
|
|
93
|
+
* Example: 2
|
|
94
|
+
*/
|
|
95
|
+
numberOfFlights: number;
|
|
96
|
+
/**
|
|
97
|
+
* The number of checked bags
|
|
98
|
+
* Min value: 0
|
|
99
|
+
* Example: 1
|
|
100
|
+
*/
|
|
101
|
+
numberOfCheckedBags: number;
|
|
102
|
+
/**
|
|
103
|
+
* The first-way destination's three-letter IATA airport code
|
|
104
|
+
* Example: JFK
|
|
105
|
+
* Pattern: ^[A-Z]{3}$
|
|
106
|
+
*/
|
|
107
|
+
firstWayDestination: string;
|
|
108
|
+
/**
|
|
109
|
+
* `true` if the trip is a round-trip
|
|
110
|
+
* Example: true
|
|
111
|
+
*/
|
|
112
|
+
isRoundTrip: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* `luxurious` if the highest bought travel class in the trip is a luxury class (business/first), `economy` otherwise
|
|
115
|
+
* Example: luxurious
|
|
116
|
+
*/
|
|
117
|
+
highestClass: 'economy' | 'luxurious';
|
|
118
|
+
/**
|
|
119
|
+
* True if the trip ticket is a flexible ticket
|
|
120
|
+
* Example: true
|
|
121
|
+
*/
|
|
122
|
+
isFlexibleTicket: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* True if extras were included in the trip purchase
|
|
125
|
+
* Example: true
|
|
126
|
+
*/
|
|
127
|
+
wereExtrasPurchased: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The first flight details of the trip
|
|
131
|
+
*/
|
|
132
|
+
export interface TravelFirstFlight {
|
|
133
|
+
/**
|
|
134
|
+
* The number of travelers in the first flight
|
|
135
|
+
* Min value: 1
|
|
136
|
+
* Example: 2
|
|
137
|
+
*/
|
|
138
|
+
numberOfTravelers: number;
|
|
139
|
+
/**
|
|
140
|
+
* The timestamp of the departure, in *milliseconds* since the unix epoch
|
|
141
|
+
* Example: 1551398400000
|
|
142
|
+
*/
|
|
143
|
+
departureTime: number;
|
|
144
|
+
/**
|
|
145
|
+
* The first-flight departure airport's three-letter IATA code
|
|
146
|
+
* Example: JFK
|
|
147
|
+
* Pattern: ^[A-Z]{3}$
|
|
148
|
+
*/
|
|
149
|
+
departureAirport: string;
|
|
150
|
+
/**
|
|
151
|
+
* The first-flight duration, in hours
|
|
152
|
+
* Min value: 0
|
|
153
|
+
* Example: 3.5
|
|
154
|
+
*/
|
|
155
|
+
duration: number;
|
|
156
|
+
/**
|
|
157
|
+
* The alphanumeric flight code
|
|
158
|
+
* Example: BA2491A
|
|
159
|
+
* Pattern: ^[A-Z0-9]+$
|
|
160
|
+
*/
|
|
161
|
+
flightNumber: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Represents a travel booking item in a shopping cart
|
|
165
|
+
*/
|
|
166
|
+
export interface TravelCartItem {
|
|
167
|
+
/**
|
|
168
|
+
* Denotes the cart item class. The item schema is chosen based on this value.
|
|
169
|
+
* Allowed value: travel
|
|
170
|
+
* Example: travel
|
|
171
|
+
*/
|
|
172
|
+
itemClass: 'travel';
|
|
173
|
+
/**
|
|
174
|
+
* The cart items's unique ID
|
|
175
|
+
* Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
|
|
176
|
+
*/
|
|
177
|
+
id?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Any additional product data which can be provided, e.g. description, link to image, etc
|
|
180
|
+
* Example: {"any":"data","description":"This is the product description"}
|
|
181
|
+
*/
|
|
182
|
+
rawProductData?: AnyObject;
|
|
183
|
+
/**
|
|
184
|
+
* The item's selling price
|
|
185
|
+
*/
|
|
186
|
+
sellingPrice: CurrencyAmount;
|
|
187
|
+
/**
|
|
188
|
+
* The item's list price
|
|
189
|
+
*/
|
|
190
|
+
listPrice?: CurrencyAmount;
|
|
191
|
+
/**
|
|
192
|
+
* The user's personal info
|
|
193
|
+
*/
|
|
194
|
+
recipientInfo?: RecipientInfo;
|
|
195
|
+
/**
|
|
196
|
+
* The lodging details of the travel booking
|
|
197
|
+
*/
|
|
198
|
+
lodging: TravelLodging;
|
|
199
|
+
/**
|
|
200
|
+
* The flight ticket's PNR code
|
|
201
|
+
* Example: X36Q9C
|
|
202
|
+
*/
|
|
203
|
+
pnr: string;
|
|
204
|
+
/**
|
|
205
|
+
* The trip details of the travel booking
|
|
206
|
+
*/
|
|
207
|
+
trip: TravelTrip;
|
|
208
|
+
/**
|
|
209
|
+
* The first flight details of the trip
|
|
210
|
+
*/
|
|
211
|
+
firstFlight: TravelFirstFlight;
|
|
212
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"travelCartItem.js","sourceRoot":"","sources":["../../../../src/common/types/travelCartItem.ts"],"names":[],"mappings":""}
|
|
@@ -23,6 +23,8 @@ export const CoinflowIFrame = forwardRef((props, ref) => {
|
|
|
23
23
|
const expectedOrigin = new URL(CoinflowUtils.getCoinflowBaseUrl(props.env)).origin;
|
|
24
24
|
if (origin !== expectedOrigin)
|
|
25
25
|
return;
|
|
26
|
+
if (typeof data !== 'string')
|
|
27
|
+
return;
|
|
26
28
|
if (data.startsWith('ERROR')) {
|
|
27
29
|
reject(new Error(data.replace('ERROR', '')));
|
|
28
30
|
return;
|
|
@@ -52,6 +54,8 @@ export const CoinflowIFrame = forwardRef((props, ref) => {
|
|
|
52
54
|
const expectedOrigin = new URL(CoinflowUtils.getCoinflowBaseUrl(props.env)).origin;
|
|
53
55
|
if (origin !== expectedOrigin)
|
|
54
56
|
return;
|
|
57
|
+
if (typeof data !== 'string')
|
|
58
|
+
return;
|
|
55
59
|
const promise = handleIFrameMessage(data, props, props.handleHeightChangeId);
|
|
56
60
|
if (!promise)
|
|
57
61
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowIFrame.js","sourceRoot":"","sources":["../../src/CoinflowIFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,aAAa,EACb,mBAAmB,GAEpB,MAAM,UAAU,CAAC;AAclB,MAAM,UAAU,6BAA6B;IAC3C,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CACtC,CACE,KACuB,EACvB,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;QACvB,OAAO,UAAU,IAAI,KAAK;YACxB,CAAC,CAAC,aAAa,CAAC,qBAAqB,CAAC,KAAK,CAAC;YAC5C,CAAC,CAA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=> {
|
|
16
16
|
try {
|
|
17
17
|
const res = JSON.parse(data);
|
|
18
|
-
if ('method' in res &&
|
|
18
|
+
if ('method' in res &&
|
|
19
|
+
typeof res.data === 'string' &&
|
|
20
|
+
res.data.startsWith('ERROR')) {
|
|
19
21
|
onError?.(res.info);
|
|
20
22
|
return false;
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileWalletButton.js","sourceRoot":"","sources":["../../src/MobileWalletButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,eAAe,GAEhB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,EACL,cAAc,EAEd,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,KAAK,EACL,sBAAsB,EACtB,QAAQ,EACR,UAAU,GAOX;IACC,MAAM,SAAS,GAAG,MAAM,CAAiC,IAAI,CAAC,CAAC;IAC/D,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,EAAC,SAAS,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,IAAI,CAAC,SAAS,EAAE,OAAO;YAAE,OAAO;QAChC,SAAS,CAAC,OAAO;aACd,gBAAgB,CAAC,CAAC,IAAY,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAE7B,
|
|
1
|
+
{"version":3,"file":"MobileWalletButton.js","sourceRoot":"","sources":["../../src/MobileWalletButton.tsx"],"names":[],"mapp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AQ,EAAE,UAAU;gBACpB,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,MAAM;aACf;YAED,oBAAC,cAAc,IAAC,GAAG,EAAE,SAAS,KAAM,WAAW,KAAM,eAAe,GAAI,CACpE,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -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,iBAAi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from './types/giftCardCartItem';
|
|
|
4
4
|
import { nftCartItem } from './types/nftCartItem';
|
|
5
5
|
import { CryptoCartItem } from './types/cryptoCartItem';
|
|
6
6
|
import { MoneyTopUpCartItem } from './types/moneyTopUpCartItem';
|
|
7
|
+
import { TravelCartItem } from './types/travelCartItem';
|
|
8
|
+
import { FlightTicketCartItem } from './types/flightTicketCartItem';
|
|
9
|
+
import { FlightUpgradeCartItem } from './types/flightUpgradeCartItem';
|
|
10
|
+
import { LodgingCartItem } from './types/lodgingCartItem';
|
|
7
11
|
export declare enum WithdrawCategory {
|
|
8
12
|
USER = "user",
|
|
9
13
|
BUSINESS = "business",
|
|
@@ -20,7 +24,8 @@ export declare enum WithdrawSpeed {
|
|
|
20
24
|
VENMO = "venmo",
|
|
21
25
|
PAYPAL = "paypal",
|
|
22
26
|
WIRE = "wire",
|
|
23
|
-
INTERAC = "interac"
|
|
27
|
+
INTERAC = "interac",
|
|
28
|
+
SWIFT = "swift"
|
|
24
29
|
}
|
|
25
30
|
export declare enum SettlementType {
|
|
26
31
|
Credits = "Credits",
|
|
@@ -244,11 +249,11 @@ export declare enum ChargebackProtectionAccountType {
|
|
|
244
249
|
PRIVATE = "private",
|
|
245
250
|
BUSINESS = "business"
|
|
246
251
|
}
|
|
247
|
-
export type CartItemClassOmitted = NftCartItemClassOmitted | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem;
|
|
252
|
+
export type CartItemClassOmitted = NftCartItemClassOmitted | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem | TravelCartItem | FlightTicketCartItem | FlightUpgradeCartItem | LodgingCartItem;
|
|
248
253
|
export type ChargebackProtectionItem = CartItemClassOmitted;
|
|
249
254
|
export type NftCartItemClassOmitted = Omit<nftCartItem, 'sellingPrice' | 'itemClass'>;
|
|
250
255
|
export type Cart = CartItem[];
|
|
251
|
-
export type CartItem = Omit<nftCartItem, 'listPrice' | 'sellingPrice'> | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem;
|
|
256
|
+
export type CartItem = Omit<nftCartItem, 'listPrice' | 'sellingPrice'> | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem | TravelCartItem | FlightTicketCartItem | FlightUpgradeCartItem | LodgingCartItem;
|
|
252
257
|
export declare enum ThreeDsChallengePreference {
|
|
253
258
|
NoPreference = "NoPreference",
|
|
254
259
|
Frictionless = "Frictionless",
|
|
@@ -382,6 +387,13 @@ export interface WithGeo {
|
|
|
382
387
|
lat: number;
|
|
383
388
|
lng: number;
|
|
384
389
|
};
|
|
390
|
+
/**
|
|
391
|
+
* Deep link (custom scheme or universal link) that reopens the host app.
|
|
392
|
+
* Used by browser-handoff checkouts (e.g. Venmo on React Native) so the
|
|
393
|
+
* standalone checkout page can route the customer back into the app after
|
|
394
|
+
* the payment app returns them to the browser.
|
|
395
|
+
*/
|
|
396
|
+
appReturnUrl?: string;
|
|
385
397
|
}
|
|
386
398
|
/**
|
|
387
399
|
* Used for Account Funding Transactions
|
|
@@ -483,12 +495,22 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
483
495
|
lat: number;
|
|
484
496
|
lng: number;
|
|
485
497
|
};
|
|
498
|
+
/**
|
|
499
|
+
* Deep link (custom scheme or universal link) that reopens the host app.
|
|
500
|
+
* Used by browser-handoff flows on React Native — Venmo checkout and the
|
|
501
|
+
* "Log in with PayPal" payout flow — so the standalone page routes the user
|
|
502
|
+
* back into the app after the payment/login app returns them to the browser.
|
|
503
|
+
* When omitted, PayPal linking still completes via polling but the user must
|
|
504
|
+
* switch back to the app manually.
|
|
505
|
+
*/
|
|
506
|
+
appReturnUrl?: string;
|
|
486
507
|
}
|
|
487
508
|
export type WalletTypes = SolanaWallet | EthWallet | StellarWallet;
|
|
488
509
|
export interface SolanaWalletProps {
|
|
489
510
|
wallet: SolanaWallet;
|
|
490
511
|
connection: Connection;
|
|
491
512
|
blockchain: 'solana';
|
|
513
|
+
ownerOverride?: string;
|
|
492
514
|
}
|
|
493
515
|
export type CoinflowSolanaWithdrawProps = CoinflowCommonWithdrawProps & SolanaWalletProps;
|
|
494
516
|
interface EvmWalletProps {
|
|
@@ -652,6 +674,7 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' |
|
|
|
652
674
|
disableGooglePay?: boolean;
|
|
653
675
|
theme?: MerchantTheme;
|
|
654
676
|
usePermit?: boolean;
|
|
677
|
+
ownerOverride?: string;
|
|
655
678
|
handleHeightChangeId: string | number;
|
|
656
679
|
}
|
|
657
680
|
export interface CoinflowIntentsIFrameProps {
|
|
@@ -17,6 +17,7 @@ export var WithdrawSpeed;
|
|
|
17
17
|
WithdrawSpeed["PAYPAL"] = "paypal";
|
|
18
18
|
WithdrawSpeed["WIRE"] = "wire";
|
|
19
19
|
WithdrawSpeed["INTERAC"] = "interac";
|
|
20
|
+
WithdrawSpeed["SWIFT"] = "swift";
|
|
20
21
|
})(WithdrawSpeed || (WithdrawSpeed = {}));
|
|
21
22
|
export var SettlementType;
|
|
22
23
|
(function (SettlementType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,8CAA0B,CAAA;AAC5B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW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tils {
|
|
|
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, depositAmounts, 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, appReturnUrl, depositAmounts, ownerOverride, 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,13 +50,15 @@ 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, depositAmounts, 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, appReturnUrl, depositAmounts, ownerOverride, baseUrl, }) {
|
|
54
54
|
const prefix = routePrefix
|
|
55
55
|
? `/${routePrefix}/${blockchain}`
|
|
56
56
|
: `/${blockchain}`;
|
|
57
57
|
const url = new URL(prefix + route, baseUrl ?? CoinflowUtils.getCoinflowBaseUrl(env));
|
|
58
58
|
if (walletPubkey)
|
|
59
59
|
url.searchParams.append('pubkey', walletPubkey);
|
|
60
|
+
if (ownerOverride)
|
|
61
|
+
url.searchParams.append('ownerOverride', ownerOverride);
|
|
60
62
|
if (sessionKey)
|
|
61
63
|
url.searchParams.append('sessionKey', sessionKey);
|
|
62
64
|
if (transaction) {
|
|
@@ -176,6 +178,8 @@ export class CoinflowUtils {
|
|
|
176
178
|
url.searchParams.append('lat', userLocation.lat.toString());
|
|
177
179
|
url.searchParams.append('lng', userLocation.lng.toString());
|
|
178
180
|
}
|
|
181
|
+
if (appReturnUrl)
|
|
182
|
+
url.searchParams.append('appReturnUrl', appReturnUrl);
|
|
179
183
|
return url.toString();
|
|
180
184
|
}
|
|
181
185
|
static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }) {
|