@rebilly/framepay-react 4.0.6 → 5.0.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/CHANGELOG.md +11 -0
- package/build/index.d.ts +1 -1
- package/build/index.spec.js +1 -1
- package/build/lib/components/elements/applepay-element.js +2 -2
- package/build/lib/components/elements/bank-element.js +3 -3
- package/build/lib/components/elements/base-element.js +14 -13
- package/build/lib/components/elements/card-element.js +3 -3
- package/build/lib/components/elements/googlepay-element.js +2 -2
- package/build/lib/components/elements/iban-element.js +4 -4
- package/build/lib/components/elements/paypal-element.js +2 -2
- package/build/lib/components/injector.js +20 -20
- package/build/lib/components/provider.js +11 -11
- package/build/lib/constants.js +1 -1
- package/build/lib/context.js +2 -4
- package/build/lib/dom-util.js +1 -5
- package/build/lib/framepay-error.d.ts +1 -1
- package/build/lib/framepay-error.js +4 -4
- package/build/lib/get-rebilly-api.js +2 -2
- package/package.json +6 -16
- package/src/index.spec.ts +1 -1
- package/src/index.ts +3 -3
- package/src/lib/components/elements/applepay-element.tsx +2 -2
- package/src/lib/components/elements/bank-element.spec.tsx +12 -12
- package/src/lib/components/elements/bank-element.tsx +4 -4
- package/src/lib/components/elements/base-element.tsx +16 -16
- package/src/lib/components/elements/card-element.spec.tsx +13 -13
- package/src/lib/components/elements/card-element.tsx +4 -4
- package/src/lib/components/elements/googlepay-element.tsx +2 -2
- package/src/lib/components/elements/iban-element.spec.tsx +9 -9
- package/src/lib/components/elements/iban-element.tsx +4 -4
- package/src/lib/components/elements/paypal-element.tsx +2 -2
- package/src/lib/components/injector.spec.tsx +3 -4
- package/src/lib/components/injector.tsx +50 -48
- package/src/lib/components/provider.spec.tsx +5 -7
- package/src/lib/components/provider.tsx +15 -15
- package/src/lib/constants.ts +1 -1
- package/src/lib/context.ts +1 -3
- package/src/lib/dom-util.ts +0 -4
- package/src/lib/framepay-error.ts +9 -6
- package/src/lib/get-rebilly-api.ts +1 -1
- package/test/e2e/cypress-support.js +1 -1
- package/test/e2e/fixtures/apple-pay.js +4 -8
- package/test/e2e/fixtures/bank-separate.js +68 -67
- package/test/e2e/fixtures/card-separate-brands.js +256 -139
- package/test/e2e/fixtures/card-separate-rebilly-fields.js +48 -57
- package/test/e2e/fixtures/card-separate.js +214 -112
- package/test/e2e/fixtures/checkout-combined.js +145 -95
- package/test/e2e/fixtures/google-pay.js +6 -10
- package/test/e2e/fixtures/iban.js +47 -45
- package/test/e2e/fixtures/multiple-methods.js +104 -98
- package/test/e2e/fixtures/nav.js +3 -4
- package/test/e2e/fixtures/paypal.js +5 -12
- package/test/e2e/fixtures/util.js +50 -37
- package/test/e2e/specs/card-separate-brands.cy.ts +2 -2
- package/test/e2e/specs/react-version.cy.ts +1 -1
- package/test/e2e/switch-react-version.js +5 -6
- package/test/unit/jest.config.js +18 -28
- package/test/unit/specs/declaration-mock.spec.tsx +1 -0
- package/tslint.json +0 -36
|
@@ -6,7 +6,7 @@ import { deepMerge, prettyDebugRender, ReactVersion } from './util';
|
|
|
6
6
|
import './style.css';
|
|
7
7
|
|
|
8
8
|
const params = {
|
|
9
|
-
publishableKey: 'pk_sandbox_c6cqKLddciVikuBOjhcng-rLccTz70NT4W_qZ_h'
|
|
9
|
+
publishableKey: 'pk_sandbox_c6cqKLddciVikuBOjhcng-rLccTz70NT4W_qZ_h',
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
class CardElementComponent extends Component {
|
|
@@ -18,32 +18,32 @@ class CardElementComponent extends Component {
|
|
|
18
18
|
onReady: null,
|
|
19
19
|
onChange: null,
|
|
20
20
|
onFocus: null,
|
|
21
|
-
onBlur: null
|
|
21
|
+
onBlur: null,
|
|
22
22
|
},
|
|
23
23
|
bankAccountNumber: {
|
|
24
24
|
onReady: null,
|
|
25
25
|
onChange: null,
|
|
26
26
|
onFocus: null,
|
|
27
|
-
onBlur: null
|
|
27
|
+
onBlur: null,
|
|
28
28
|
},
|
|
29
29
|
bankRoutingNumber: {
|
|
30
30
|
onReady: null,
|
|
31
31
|
onChange: null,
|
|
32
32
|
onFocus: null,
|
|
33
|
-
onBlur: null
|
|
34
|
-
}
|
|
33
|
+
onBlur: null,
|
|
34
|
+
},
|
|
35
35
|
},
|
|
36
36
|
billingAddress: {
|
|
37
37
|
firstName: 'first-name-value',
|
|
38
38
|
lastName: 'last-name-value',
|
|
39
39
|
address: 'address-value',
|
|
40
40
|
country: 'GB',
|
|
41
|
-
region: 'region-value'
|
|
41
|
+
region: 'region-value',
|
|
42
42
|
},
|
|
43
43
|
token: {
|
|
44
44
|
error: null,
|
|
45
|
-
data: null
|
|
46
|
-
}
|
|
45
|
+
data: null,
|
|
46
|
+
},
|
|
47
47
|
};
|
|
48
48
|
this.handleSubmit = this.handleSubmit.bind(this);
|
|
49
49
|
}
|
|
@@ -57,30 +57,30 @@ class CardElementComponent extends Component {
|
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
59
|
const billingAddress = {
|
|
60
|
-
...this.state.billingAddress
|
|
60
|
+
...this.state.billingAddress,
|
|
61
61
|
};
|
|
62
62
|
if (billingAddress.emails) {
|
|
63
63
|
billingAddress.emails = [
|
|
64
64
|
{
|
|
65
65
|
label: 'Email',
|
|
66
|
-
value: billingAddress.emails
|
|
67
|
-
}
|
|
66
|
+
value: billingAddress.emails,
|
|
67
|
+
},
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
70
|
if (billingAddress.phoneNumbers) {
|
|
71
71
|
billingAddress.phoneNumbers = [
|
|
72
72
|
{
|
|
73
73
|
label: 'Phone Number',
|
|
74
|
-
value: billingAddress.phoneNumbers
|
|
75
|
-
}
|
|
74
|
+
value: billingAddress.phoneNumbers,
|
|
75
|
+
},
|
|
76
76
|
];
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
this.props.Rebilly.createToken(this.formNode, { billingAddress })
|
|
80
|
-
.then(data => {
|
|
80
|
+
.then((data) => {
|
|
81
81
|
this.deepUpdateState({ token: { error: false, data } });
|
|
82
82
|
})
|
|
83
|
-
.catch(err => {
|
|
83
|
+
.catch((err) => {
|
|
84
84
|
this.deepUpdateState({ token: { error: true, data: err } });
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -99,7 +99,7 @@ class CardElementComponent extends Component {
|
|
|
99
99
|
<div className="example-2">
|
|
100
100
|
<form
|
|
101
101
|
id="form"
|
|
102
|
-
ref={node => (this.formNode = node)}
|
|
102
|
+
ref={(node) => (this.formNode = node)}
|
|
103
103
|
method="post"
|
|
104
104
|
onSubmit={this.handleSubmit}
|
|
105
105
|
>
|
|
@@ -112,11 +112,11 @@ class CardElementComponent extends Component {
|
|
|
112
112
|
defaultValue={
|
|
113
113
|
this.state.billingAddress.firstName
|
|
114
114
|
}
|
|
115
|
-
onChange={e => {
|
|
115
|
+
onChange={(e) => {
|
|
116
116
|
this.deepUpdateState({
|
|
117
117
|
billingAddress: {
|
|
118
|
-
firstName: e.target.value
|
|
119
|
-
}
|
|
118
|
+
firstName: e.target.value,
|
|
119
|
+
},
|
|
120
120
|
});
|
|
121
121
|
}}
|
|
122
122
|
/>
|
|
@@ -129,11 +129,11 @@ class CardElementComponent extends Component {
|
|
|
129
129
|
defaultValue={
|
|
130
130
|
this.state.billingAddress.lastName
|
|
131
131
|
}
|
|
132
|
-
onChange={e => {
|
|
132
|
+
onChange={(e) => {
|
|
133
133
|
this.deepUpdateState({
|
|
134
134
|
billingAddress: {
|
|
135
|
-
lastName: e.target.value
|
|
136
|
-
}
|
|
135
|
+
lastName: e.target.value,
|
|
136
|
+
},
|
|
137
137
|
});
|
|
138
138
|
}}
|
|
139
139
|
/>
|
|
@@ -146,11 +146,11 @@ class CardElementComponent extends Component {
|
|
|
146
146
|
defaultValue={
|
|
147
147
|
this.state.billingAddress.emails
|
|
148
148
|
}
|
|
149
|
-
onChange={e => {
|
|
149
|
+
onChange={(e) => {
|
|
150
150
|
this.deepUpdateState({
|
|
151
151
|
billingAddress: {
|
|
152
|
-
emails: e.target.value
|
|
153
|
-
}
|
|
152
|
+
emails: e.target.value,
|
|
153
|
+
},
|
|
154
154
|
});
|
|
155
155
|
}}
|
|
156
156
|
/>
|
|
@@ -164,11 +164,12 @@ class CardElementComponent extends Component {
|
|
|
164
164
|
this.state.billingAddress
|
|
165
165
|
.phoneNumbers
|
|
166
166
|
}
|
|
167
|
-
onChange={e => {
|
|
167
|
+
onChange={(e) => {
|
|
168
168
|
this.deepUpdateState({
|
|
169
169
|
billingAddress: {
|
|
170
|
-
phoneNumbers:
|
|
171
|
-
|
|
170
|
+
phoneNumbers:
|
|
171
|
+
e.target.value,
|
|
172
|
+
},
|
|
172
173
|
});
|
|
173
174
|
}}
|
|
174
175
|
/>
|
|
@@ -179,36 +180,36 @@ class CardElementComponent extends Component {
|
|
|
179
180
|
this.deepUpdateState({
|
|
180
181
|
events: {
|
|
181
182
|
bankAccountType: {
|
|
182
|
-
onReady: true
|
|
183
|
-
}
|
|
184
|
-
}
|
|
183
|
+
onReady: true,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
185
186
|
})
|
|
186
187
|
}
|
|
187
|
-
onChange={data =>
|
|
188
|
+
onChange={(data) =>
|
|
188
189
|
this.deepUpdateState({
|
|
189
190
|
events: {
|
|
190
191
|
bankAccountType: {
|
|
191
|
-
onChange: data
|
|
192
|
-
}
|
|
193
|
-
}
|
|
192
|
+
onChange: data,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
194
195
|
})
|
|
195
196
|
}
|
|
196
197
|
onFocus={() =>
|
|
197
198
|
this.deepUpdateState({
|
|
198
199
|
events: {
|
|
199
200
|
bankAccountType: {
|
|
200
|
-
onFocus: true
|
|
201
|
-
}
|
|
202
|
-
}
|
|
201
|
+
onFocus: true,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
203
204
|
})
|
|
204
205
|
}
|
|
205
206
|
onBlur={() =>
|
|
206
207
|
this.deepUpdateState({
|
|
207
208
|
events: {
|
|
208
209
|
bankAccountType: {
|
|
209
|
-
onBlur: true
|
|
210
|
-
}
|
|
211
|
-
}
|
|
210
|
+
onBlur: true,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
212
213
|
})
|
|
213
214
|
}
|
|
214
215
|
/>
|
|
@@ -220,36 +221,36 @@ class CardElementComponent extends Component {
|
|
|
220
221
|
this.deepUpdateState({
|
|
221
222
|
events: {
|
|
222
223
|
bankAccountNumber: {
|
|
223
|
-
onReady: true
|
|
224
|
-
}
|
|
225
|
-
}
|
|
224
|
+
onReady: true,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
226
227
|
})
|
|
227
228
|
}
|
|
228
|
-
onChange={data =>
|
|
229
|
+
onChange={(data) =>
|
|
229
230
|
this.deepUpdateState({
|
|
230
231
|
events: {
|
|
231
232
|
bankAccountNumber: {
|
|
232
|
-
onChange: data
|
|
233
|
-
}
|
|
234
|
-
}
|
|
233
|
+
onChange: data,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
235
236
|
})
|
|
236
237
|
}
|
|
237
238
|
onFocus={() =>
|
|
238
239
|
this.deepUpdateState({
|
|
239
240
|
events: {
|
|
240
241
|
bankAccountNumber: {
|
|
241
|
-
onFocus: true
|
|
242
|
-
}
|
|
243
|
-
}
|
|
242
|
+
onFocus: true,
|
|
243
|
+
},
|
|
244
|
+
},
|
|
244
245
|
})
|
|
245
246
|
}
|
|
246
247
|
onBlur={() =>
|
|
247
248
|
this.deepUpdateState({
|
|
248
249
|
events: {
|
|
249
250
|
bankAccountNumber: {
|
|
250
|
-
onBlur: true
|
|
251
|
-
}
|
|
252
|
-
}
|
|
251
|
+
onBlur: true,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
253
254
|
})
|
|
254
255
|
}
|
|
255
256
|
/>
|
|
@@ -261,36 +262,36 @@ class CardElementComponent extends Component {
|
|
|
261
262
|
this.deepUpdateState({
|
|
262
263
|
events: {
|
|
263
264
|
bankRoutingNumber: {
|
|
264
|
-
onReady: true
|
|
265
|
-
}
|
|
266
|
-
}
|
|
265
|
+
onReady: true,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
267
268
|
})
|
|
268
269
|
}
|
|
269
|
-
onChange={data =>
|
|
270
|
+
onChange={(data) =>
|
|
270
271
|
this.deepUpdateState({
|
|
271
272
|
events: {
|
|
272
273
|
bankRoutingNumber: {
|
|
273
|
-
onChange: data
|
|
274
|
-
}
|
|
275
|
-
}
|
|
274
|
+
onChange: data,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
276
277
|
})
|
|
277
278
|
}
|
|
278
279
|
onFocus={() =>
|
|
279
280
|
this.deepUpdateState({
|
|
280
281
|
events: {
|
|
281
282
|
bankRoutingNumber: {
|
|
282
|
-
onFocus: true
|
|
283
|
-
}
|
|
284
|
-
}
|
|
283
|
+
onFocus: true,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
285
286
|
})
|
|
286
287
|
}
|
|
287
288
|
onBlur={() =>
|
|
288
289
|
this.deepUpdateState({
|
|
289
290
|
events: {
|
|
290
291
|
bankRoutingNumber: {
|
|
291
|
-
onBlur: true
|
|
292
|
-
}
|
|
293
|
-
}
|
|
292
|
+
onBlur: true,
|
|
293
|
+
},
|
|
294
|
+
},
|
|
294
295
|
})
|
|
295
296
|
}
|
|
296
297
|
/>
|