@paypal/checkout-components 5.0.280 → 5.0.282
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypal/checkout-components",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.282",
|
|
4
4
|
"description": "PayPal Checkout components, for integrating checkout products.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"start": "npm run webpack -- --progress --watch",
|
|
31
31
|
"test": "npm run format:check && npm run test:unit && npm run jest-ssr && npm run karma && npm run jest-screenshot",
|
|
32
32
|
"test:unit": "vitest run",
|
|
33
|
-
"percy-screenshot": "babel-node ./test/percy/server/createButtonConfigs.js && percy exec -- playwright test --config=./test/percy/playwright.config.js --reporter=dot --pass-with-no-tests",
|
|
33
|
+
"percy-screenshot": "npx playwright install && babel-node ./test/percy/server/createButtonConfigs.js && percy exec -- playwright test --config=./test/percy/playwright.config.js --reporter=dot --pass-with-no-tests",
|
|
34
34
|
"typecheck": "npm run flow-typed && npm run flow",
|
|
35
35
|
"version": "./scripts/version.sh",
|
|
36
36
|
"webpack": "babel-node $(npm bin)/webpack",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@bunchtogether/vite-plugin-flow": "^1.0.2",
|
|
71
71
|
"@krakenjs/grumbler-scripts": "^8.1.5",
|
|
72
72
|
"@krakenjs/sync-browser-mocks": "^3.0.0",
|
|
73
|
-
"@percy/cli": "1.
|
|
73
|
+
"@percy/cli": "1.27.2",
|
|
74
74
|
"@percy/playwright": "^1.0.4",
|
|
75
|
-
"@playwright/test": "^1.
|
|
75
|
+
"@playwright/test": "^1.38.1",
|
|
76
76
|
"babel-core": "^7.0.0-bridge.0",
|
|
77
77
|
"bundlemon": "^1.1.0",
|
|
78
78
|
"conventional-changelog-cli": "^2.0.34",
|
|
@@ -11,7 +11,7 @@ import { PLATFORM } from "@paypal/sdk-constants/src";
|
|
|
11
11
|
import { BUTTON_COLOR, BUTTON_LAYOUT } from "../../constants";
|
|
12
12
|
import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig } from "../common";
|
|
13
13
|
|
|
14
|
-
import { WalletLabel, Label
|
|
14
|
+
import { WalletLabel, Label } from "./template";
|
|
15
15
|
|
|
16
16
|
export function getVenmoConfig(): FundingSourceConfig {
|
|
17
17
|
return {
|
|
@@ -55,9 +55,6 @@ export function getVenmoConfig(): FundingSourceConfig {
|
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
Label: ({ ...props }) => {
|
|
58
|
-
if (props.experiment && props.experiment.enableVenmoAppLabel) {
|
|
59
|
-
return AppLabel(props);
|
|
60
|
-
}
|
|
61
58
|
return Label(props);
|
|
62
59
|
},
|
|
63
60
|
|
|
@@ -15,23 +15,6 @@ import { Text, Space } from "../../ui/text";
|
|
|
15
15
|
|
|
16
16
|
import css from "./style.scoped.scss";
|
|
17
17
|
|
|
18
|
-
export function AppLabel(opts: LabelOptions): ChildType {
|
|
19
|
-
const { logoColor } = opts;
|
|
20
|
-
|
|
21
|
-
const AppLogo: ChildType = (
|
|
22
|
-
<Style css={css}>
|
|
23
|
-
{__WEB__ ? (
|
|
24
|
-
<VenmoLogoExternalImage logoColor={logoColor} />
|
|
25
|
-
) : (
|
|
26
|
-
<VenmoLogoInlineSVG logoColor={logoColor} />
|
|
27
|
-
)}
|
|
28
|
-
<Text className={["app-label"]}>App</Text>
|
|
29
|
-
</Style>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
return <BasicLabel {...opts} logo={AppLogo} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
18
|
export function Label(opts: LabelOptions): ChildType {
|
|
36
19
|
return <BasicLabel {...opts} />;
|
|
37
20
|
}
|
package/src/types.js
CHANGED
package/src/zoid/buttons/util.js
CHANGED
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
isDevice,
|
|
12
12
|
isTablet,
|
|
13
13
|
getElement,
|
|
14
|
-
isLocalStorageEnabled,
|
|
15
14
|
isStandAlone,
|
|
16
15
|
once,
|
|
17
16
|
} from "@krakenjs/belter/src";
|
|
18
|
-
import {
|
|
17
|
+
import { FUNDING } from "@paypal/sdk-constants/src";
|
|
19
18
|
import {
|
|
20
19
|
getEnableFunding,
|
|
21
20
|
getLogger,
|
|
@@ -23,7 +22,6 @@ import {
|
|
|
23
22
|
getFundingEligibility,
|
|
24
23
|
getPlatform,
|
|
25
24
|
getComponents,
|
|
26
|
-
getEnv,
|
|
27
25
|
} from "@paypal/sdk-client/src";
|
|
28
26
|
import { getRefinedFundingEligibility } from "@paypal/funding-components/src";
|
|
29
27
|
|
|
@@ -175,21 +173,6 @@ export function getVenmoExperiment(): EligibilityExperiment {
|
|
|
175
173
|
}
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
export function getVenmoAppLabelExperiment(): EligibilityExperiment {
|
|
179
|
-
const isEnvForTest =
|
|
180
|
-
getEnv() === ENV.LOCAL || getEnv() === ENV.TEST || getEnv() === ENV.STAGE;
|
|
181
|
-
|
|
182
|
-
let isEnabledForTest = false;
|
|
183
|
-
|
|
184
|
-
if (isLocalStorageEnabled() && isEnvForTest) {
|
|
185
|
-
isEnabledForTest = window.localStorage.getItem("enable_venmo_app_label");
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
enableVenmoAppLabel: isEnabledForTest,
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
176
|
export function getRenderedButtons(
|
|
194
177
|
props: ButtonProps
|
|
195
178
|
): $ReadOnlyArray<$Values<typeof FUNDING>> {
|
|
@@ -322,7 +305,6 @@ export function applePaySession(): ?ApplePaySessionConfigRequest {
|
|
|
322
305
|
export function getButtonExperiments(): EligibilityExperiment {
|
|
323
306
|
return {
|
|
324
307
|
...getVenmoExperiment(),
|
|
325
|
-
...getVenmoAppLabelExperiment(),
|
|
326
308
|
};
|
|
327
309
|
}
|
|
328
310
|
|
|
@@ -475,7 +475,10 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
|
|
|
475
475
|
|
|
476
476
|
eligible: () => {
|
|
477
477
|
const fundingEligibility = getRefinedFundingEligibility();
|
|
478
|
-
if (
|
|
478
|
+
if (
|
|
479
|
+
fundingEligibility?.card?.eligible &&
|
|
480
|
+
!fundingEligibility.card.branded
|
|
481
|
+
) {
|
|
479
482
|
return {
|
|
480
483
|
eligible: true,
|
|
481
484
|
};
|