@paypal/checkout-components 5.0.367 → 5.0.368
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/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export function getVenmoConfig(): FundingSourceConfig {
|
|
|
30
30
|
experiment &&
|
|
31
31
|
experiment.enableVenmo === false &&
|
|
32
32
|
experiment.venmoWebEnabled !== true &&
|
|
33
|
+
experiment.isWebViewEnabled !== true &&
|
|
33
34
|
experiment.venmoEnableWebOnNonNativeBrowser !== true
|
|
34
35
|
) {
|
|
35
36
|
return false;
|
|
@@ -67,7 +68,7 @@ export function getVenmoConfig(): FundingSourceConfig {
|
|
|
67
68
|
experiment.venmoEnableWebOnNonNativeBrowser !== true
|
|
68
69
|
) {
|
|
69
70
|
return {
|
|
70
|
-
native: true,
|
|
71
|
+
native: experiment.isWebViewEnabled ? false : true,
|
|
71
72
|
popup: experiment.isWebViewEnabled ? false : true,
|
|
72
73
|
};
|
|
73
74
|
}
|
|
@@ -97,7 +97,6 @@ import {
|
|
|
97
97
|
applePaySession,
|
|
98
98
|
determineFlow,
|
|
99
99
|
isSupportedNativeBrowser,
|
|
100
|
-
createVenmoExperiment,
|
|
101
100
|
getRenderedButtons,
|
|
102
101
|
getButtonSize,
|
|
103
102
|
getButtonExperiments,
|
|
@@ -882,14 +881,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
882
881
|
});
|
|
883
882
|
|
|
884
883
|
return (...args) => {
|
|
885
|
-
const venmoExperiment = createVenmoExperiment();
|
|
886
|
-
|
|
887
|
-
if (venmoExperiment) {
|
|
888
|
-
venmoExperiment.logStart({
|
|
889
|
-
[FPTI_KEY.BUTTON_SESSION_UID]: props.buttonSessionID,
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
|
|
893
884
|
return value(...args);
|
|
894
885
|
};
|
|
895
886
|
},
|
package/src/zoid/buttons/util.js
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
isIos,
|
|
7
7
|
isIOS14,
|
|
8
8
|
isSafari,
|
|
9
|
-
type Experiment,
|
|
10
9
|
isDevice,
|
|
11
10
|
isWebView,
|
|
12
11
|
isTablet,
|
|
@@ -19,14 +18,13 @@ import { send as postRobotSend } from "@krakenjs/post-robot/src";
|
|
|
19
18
|
import {
|
|
20
19
|
getEnableFunding,
|
|
21
20
|
getLogger,
|
|
22
|
-
createExperiment,
|
|
23
|
-
getFundingEligibility,
|
|
24
21
|
getPlatform,
|
|
25
22
|
getComponents,
|
|
26
23
|
getEnv,
|
|
27
24
|
getNamespace,
|
|
28
25
|
getPayPalDomain,
|
|
29
26
|
getFirstRenderExperiments,
|
|
27
|
+
getFundingEligibility,
|
|
30
28
|
getSDKToken,
|
|
31
29
|
getIntent,
|
|
32
30
|
} from "@paypal/sdk-client/src";
|
|
@@ -122,59 +120,20 @@ export function isSupportedNativeBrowser(): boolean {
|
|
|
122
120
|
return false;
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
export function createVenmoExperiment(): ?Experiment {
|
|
126
|
-
const enableFunding = getEnableFunding();
|
|
127
|
-
const isEnableFundingVenmo =
|
|
128
|
-
enableFunding && enableFunding.indexOf(FUNDING.VENMO) !== -1;
|
|
129
|
-
|
|
130
|
-
const fundingEligibility = getFundingEligibility();
|
|
131
|
-
const hasBasicVenmoEligibility =
|
|
132
|
-
fundingEligibility &&
|
|
133
|
-
fundingEligibility[FUNDING.VENMO] &&
|
|
134
|
-
fundingEligibility[FUNDING.VENMO].eligible;
|
|
135
|
-
const isEligibleForVenmoNative =
|
|
136
|
-
isSupportedNativeBrowser() && !isEnableFundingVenmo;
|
|
137
|
-
|
|
138
|
-
// basic eligibility must be true for venmo to be eligible for the experiments
|
|
139
|
-
if (!hasBasicVenmoEligibility) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (isDevice()) {
|
|
144
|
-
if (!isEligibleForVenmoNative) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (isIos() && isSafari()) {
|
|
149
|
-
return createExperiment("enable_venmo_ios", 100);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (isAndroid() && isChrome()) {
|
|
153
|
-
return createExperiment("enable_venmo_android", 100);
|
|
154
|
-
}
|
|
155
|
-
} else {
|
|
156
|
-
return createExperiment("enable_venmo_desktop", 100);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
123
|
export function getVenmoExperiment(): EligibilityExperiment {
|
|
161
|
-
const
|
|
162
|
-
|
|
124
|
+
const fundingEligibility = getFundingEligibility();
|
|
163
125
|
const enableFunding = getEnableFunding();
|
|
126
|
+
|
|
164
127
|
const isVenmoFundingEnabled =
|
|
165
128
|
enableFunding && enableFunding.indexOf(FUNDING.VENMO) !== -1;
|
|
166
129
|
const isNativeSupported = isSupportedNativeBrowser();
|
|
167
|
-
const isExperimentEnabled = experiment && experiment.isEnabled();
|
|
168
|
-
|
|
169
130
|
if (isDevice()) {
|
|
170
131
|
return {
|
|
171
|
-
enableVenmo:
|
|
172
|
-
(isExperimentEnabled || isVenmoFundingEnabled) && isNativeSupported
|
|
173
|
-
),
|
|
132
|
+
enableVenmo: isVenmoFundingEnabled && isNativeSupported,
|
|
174
133
|
};
|
|
175
134
|
} else {
|
|
176
135
|
return {
|
|
177
|
-
enableVenmo:
|
|
136
|
+
enableVenmo: fundingEligibility?.venmo?.eligible || false,
|
|
178
137
|
};
|
|
179
138
|
}
|
|
180
139
|
}
|
|
@@ -284,6 +284,12 @@ export function getVenmoCheckoutComponent(): VenmoCheckoutComponent {
|
|
|
284
284
|
},
|
|
285
285
|
},
|
|
286
286
|
|
|
287
|
+
incognito: {
|
|
288
|
+
type: "boolean",
|
|
289
|
+
queryParam: true,
|
|
290
|
+
required: false,
|
|
291
|
+
},
|
|
292
|
+
|
|
287
293
|
isWebViewEnabled: {
|
|
288
294
|
type: "boolean",
|
|
289
295
|
queryParam: true,
|