@paypal/checkout-components 5.0.390 → 5.0.392
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/dist/test/button.js +1 -1
- package/package.json +1 -1
- package/src/funding/credit/config.jsx +1 -0
- package/src/funding/funding.js +9 -0
- package/src/three-domain-secure/component.jsx +1 -2
- package/src/types.js +1 -0
- package/src/zoid/buttons/component.jsx +11 -10
- package/src/zoid/card-fields/component.jsx +25 -30
package/package.json
CHANGED
package/src/funding/funding.js
CHANGED
|
@@ -89,6 +89,15 @@ export function isFundingEligible(
|
|
|
89
89
|
userAgent,
|
|
90
90
|
}: IsFundingEligibleOptions
|
|
91
91
|
): boolean {
|
|
92
|
+
// Temporary: Force credit to be eligible if the experiment is enabled
|
|
93
|
+
if (
|
|
94
|
+
source === FUNDING.CREDIT &&
|
|
95
|
+
experiment?.paypalCreditButtonCreateVaultSetupTokenExists &&
|
|
96
|
+
flow === BUTTON_FLOW.VAULT_WITHOUT_PURCHASE
|
|
97
|
+
) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
if (!fundingEligibility[source] || !fundingEligibility[source].eligible) {
|
|
93
102
|
return false;
|
|
94
103
|
}
|
|
@@ -142,8 +142,7 @@ export class ThreeDomainSecureComponent {
|
|
|
142
142
|
}
|
|
143
143
|
// eslint-disable-next-line compat/compat
|
|
144
144
|
return new Promise((resolve, reject) => {
|
|
145
|
-
let authenticationState,
|
|
146
|
-
liabilityShift;
|
|
145
|
+
let authenticationState, liabilityShift;
|
|
147
146
|
const cancelThreeDS = () => {
|
|
148
147
|
return ZalgoPromise.try(() => {
|
|
149
148
|
this.logger.warn("3DS Cancelled");
|
package/src/types.js
CHANGED
|
@@ -47,7 +47,6 @@ import {
|
|
|
47
47
|
getSDKInitTime,
|
|
48
48
|
getSDKToken,
|
|
49
49
|
getShopperSessionId,
|
|
50
|
-
getGlobalSessionID,
|
|
51
50
|
} from "@paypal/sdk-client/src";
|
|
52
51
|
import {
|
|
53
52
|
rememberFunding,
|
|
@@ -250,14 +249,22 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
250
249
|
style = {},
|
|
251
250
|
enableFunding = getEnableFunding(),
|
|
252
251
|
fundingEligibility = getRefinedFundingEligibility(),
|
|
253
|
-
supportsPopups =
|
|
254
|
-
|
|
252
|
+
supportsPopups = props.fundingSource === FUNDING.VENMO
|
|
253
|
+
? supportsVenmoPopups(
|
|
254
|
+
props.experiment,
|
|
255
|
+
userAgentSupportsPopups(),
|
|
256
|
+
getUserAgent()
|
|
257
|
+
)
|
|
258
|
+
: userAgentSupportsPopups(),
|
|
259
|
+
supportedNativeBrowser = props.fundingSource === FUNDING.VENMO
|
|
260
|
+
? isSupportedNativeVenmoBrowser(props.experiment, getUserAgent())
|
|
261
|
+
: isSupportedNativeBrowser(),
|
|
255
262
|
experiment = getButtonExperiments(),
|
|
256
263
|
createBillingAgreement,
|
|
257
264
|
createSubscription,
|
|
258
265
|
createVaultSetupToken,
|
|
259
266
|
displayOnly,
|
|
260
|
-
userAgent,
|
|
267
|
+
userAgent = getUserAgent(),
|
|
261
268
|
} = props;
|
|
262
269
|
|
|
263
270
|
const flow = determineFlow({
|
|
@@ -814,12 +821,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
814
821
|
},
|
|
815
822
|
},
|
|
816
823
|
|
|
817
|
-
globalSessionID: {
|
|
818
|
-
type: "string",
|
|
819
|
-
required: false,
|
|
820
|
-
value: getGlobalSessionID,
|
|
821
|
-
},
|
|
822
|
-
|
|
823
824
|
hostedButtonId: {
|
|
824
825
|
type: "string",
|
|
825
826
|
required: false,
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
getUserIDToken,
|
|
26
26
|
getSDKToken,
|
|
27
27
|
getClientMetadataID,
|
|
28
|
-
isPayPalDomain,
|
|
29
28
|
} from "@paypal/sdk-client/src";
|
|
30
29
|
import { getRefinedFundingEligibility } from "@paypal/funding-components/src";
|
|
31
30
|
import {
|
|
@@ -249,23 +248,21 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
249
248
|
value: ({ props }) => props.parent.props.createOrder,
|
|
250
249
|
},
|
|
251
250
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return props.parent.props.createSubscription;
|
|
266
|
-
},
|
|
251
|
+
createSubscription: {
|
|
252
|
+
type: "function",
|
|
253
|
+
required: false,
|
|
254
|
+
value: ({ props }) => {
|
|
255
|
+
if (
|
|
256
|
+
props.parent.props.createSubscription &&
|
|
257
|
+
!props.parent.props.sdkToken
|
|
258
|
+
) {
|
|
259
|
+
throw new ValidationError(
|
|
260
|
+
`SDK Token must be passed in for createSubscription`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
return props.parent.props.createSubscription;
|
|
267
264
|
},
|
|
268
|
-
}
|
|
265
|
+
},
|
|
269
266
|
|
|
270
267
|
createVaultSetupToken: {
|
|
271
268
|
type: "function",
|
|
@@ -601,20 +598,18 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
601
598
|
required: false,
|
|
602
599
|
},
|
|
603
600
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
return props.createSubscription;
|
|
615
|
-
},
|
|
601
|
+
createSubscription: {
|
|
602
|
+
type: "function",
|
|
603
|
+
required: false,
|
|
604
|
+
value: ({ props }) => {
|
|
605
|
+
if (props.createSubscription && !props.sdkToken) {
|
|
606
|
+
throw new ValidationError(
|
|
607
|
+
`SDK Token must be passed in for createSubscription`
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
return props.createSubscription;
|
|
616
611
|
},
|
|
617
|
-
}
|
|
612
|
+
},
|
|
618
613
|
|
|
619
614
|
createVaultSetupToken: {
|
|
620
615
|
type: "function",
|