@paypal/checkout-components 5.0.258 → 5.0.259
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/dist/button.js +1 -1
- package/package.json +1 -1
- package/src/zoid/card-fields/component.jsx +17 -24
package/package.json
CHANGED
|
@@ -75,8 +75,9 @@ type CardFieldsProps = {|
|
|
|
75
75
|
onInputSubmitRequest?: () => ZalgoPromise<Object> | Object,
|
|
76
76
|
|},
|
|
77
77
|
createOrder: () => ZalgoPromise<string> | string,
|
|
78
|
+
createVaultSetupToken: () => ZalgoPromise<string>,
|
|
78
79
|
onApprove: (
|
|
79
|
-
{| returnUrl
|
|
80
|
+
{| returnUrl?: string, vaultSetupToken?: string |},
|
|
80
81
|
{| redirect: (?CrossDomainWindowType, ?string) => ZalgoPromise<void> |}
|
|
81
82
|
) => ?ZalgoPromise<void>,
|
|
82
83
|
onComplete: (
|
|
@@ -92,10 +93,6 @@ type CardFieldsProps = {|
|
|
|
92
93
|
hcfSessionID: string,
|
|
93
94
|
partnerAttributionID: string,
|
|
94
95
|
merchantID: $ReadOnlyArray<string>,
|
|
95
|
-
save: {|
|
|
96
|
-
createVaultSetupToken: () => ZalgoPromise<string>,
|
|
97
|
-
onApprove: ({| vaultSetupToken: string |}) => ?ZalgoPromise<void>,
|
|
98
|
-
|},
|
|
99
96
|
|};
|
|
100
97
|
|
|
101
98
|
type CardFieldProps = {|
|
|
@@ -122,7 +119,6 @@ type CardFieldsChildren = {|
|
|
|
122
119
|
CVVField: CardFieldComponent,
|
|
123
120
|
ExpiryField: CardFieldComponent,
|
|
124
121
|
NameField: CardFieldComponent,
|
|
125
|
-
PostalCodeField: CardFieldComponent,
|
|
126
122
|
|};
|
|
127
123
|
|
|
128
124
|
const url = () =>
|
|
@@ -190,18 +186,6 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
190
186
|
},
|
|
191
187
|
|
|
192
188
|
props: {
|
|
193
|
-
save: {
|
|
194
|
-
type: "object",
|
|
195
|
-
required: false,
|
|
196
|
-
value: ({ props }) => {
|
|
197
|
-
if (props.save) {
|
|
198
|
-
return props.save;
|
|
199
|
-
} else if (props.parent.props) {
|
|
200
|
-
return props.parent.props.save;
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
|
|
205
189
|
type: {
|
|
206
190
|
type: "string",
|
|
207
191
|
value: () => type,
|
|
@@ -226,6 +210,12 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
226
210
|
value: ({ props }) => props.parent.props.createOrder,
|
|
227
211
|
},
|
|
228
212
|
|
|
213
|
+
createVaultSetupToken: {
|
|
214
|
+
type: "function",
|
|
215
|
+
required: false,
|
|
216
|
+
value: ({ props }) => props.parent.props.createVaultSetupToken,
|
|
217
|
+
},
|
|
218
|
+
|
|
229
219
|
cardFieldsSessionID: {
|
|
230
220
|
type: "string",
|
|
231
221
|
queryParam: true,
|
|
@@ -403,6 +393,10 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
403
393
|
const CVVField = genericCardField(CARD_FIELD_TYPE.CVV);
|
|
404
394
|
const ExpiryField = genericCardField(CARD_FIELD_TYPE.EXPIRY);
|
|
405
395
|
const NameField = genericCardField(CARD_FIELD_TYPE.NAME);
|
|
396
|
+
// TODO: Once the Billing address Fields have been built out
|
|
397
|
+
// add the postal code field as a child to the CardFields
|
|
398
|
+
// component along with the other billing address fields
|
|
399
|
+
// eslint-disable-next-line no-unused-vars
|
|
406
400
|
const PostalCodeField = genericCardField(CARD_FIELD_TYPE.POSTAL);
|
|
407
401
|
|
|
408
402
|
const CardFields = create({
|
|
@@ -433,7 +427,6 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
433
427
|
CVVField,
|
|
434
428
|
ExpiryField,
|
|
435
429
|
NameField,
|
|
436
|
-
PostalCodeField,
|
|
437
430
|
};
|
|
438
431
|
},
|
|
439
432
|
|
|
@@ -478,11 +471,6 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
478
471
|
},
|
|
479
472
|
|
|
480
473
|
props: {
|
|
481
|
-
save: {
|
|
482
|
-
type: "object",
|
|
483
|
-
required: false,
|
|
484
|
-
},
|
|
485
|
-
|
|
486
474
|
type: {
|
|
487
475
|
type: "string",
|
|
488
476
|
value: () => CARD_FIELD_TYPE.SINGLE,
|
|
@@ -507,6 +495,11 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
507
495
|
required: false,
|
|
508
496
|
},
|
|
509
497
|
|
|
498
|
+
createVaultSetupToken: {
|
|
499
|
+
type: "function",
|
|
500
|
+
required: false,
|
|
501
|
+
},
|
|
502
|
+
|
|
510
503
|
cardFieldsSessionID: {
|
|
511
504
|
type: "string",
|
|
512
505
|
queryParam: true,
|