@paypal/checkout-components 5.0.265 → 5.0.267
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 +2 -2
- package/src/constants/button.js +0 -4
- package/src/constants/class.js +0 -2
- package/src/declarations.js +0 -5
- package/src/funding/card/config.jsx +28 -36
- package/src/funding/card/config.test.jsx +132 -0
- package/src/funding/common.jsx +2 -4
- package/src/types.js +0 -12
- package/src/ui/buttons/button.jsx +2 -11
- package/src/ui/buttons/buttons.jsx +7 -33
- package/src/ui/buttons/props.js +1 -34
- package/src/ui/buttons/style.jsx +2 -2
- package/src/ui/buttons/styles/base.js +0 -6
- package/src/zoid/buttons/component.jsx +0 -50
- package/src/zoid/buttons/prerender.jsx +1 -6
- package/src/zoid/buttons/util.js +1 -51
- package/src/zoid/checkout/component.jsx +0 -9
- package/src/zoid/checkout/props.js +0 -1
- package/src/ui/buttons/styles/custom.js +0 -37
|
@@ -17,7 +17,6 @@ import { getLogger } from "@paypal/sdk-client/src";
|
|
|
17
17
|
import type { ZoidProps } from "@krakenjs/zoid/src";
|
|
18
18
|
|
|
19
19
|
import { DEFAULT_POPUP_SIZE } from "../checkout";
|
|
20
|
-
import { EXPERIENCE } from "../../constants";
|
|
21
20
|
import { Buttons } from "../../ui";
|
|
22
21
|
import { type ButtonProps } from "../../ui/buttons/props";
|
|
23
22
|
|
|
@@ -59,11 +58,7 @@ export function PrerenderedButtons({
|
|
|
59
58
|
})
|
|
60
59
|
.flush();
|
|
61
60
|
|
|
62
|
-
if (
|
|
63
|
-
fundingSource === FUNDING.VENMO ||
|
|
64
|
-
fundingSource === FUNDING.APPLEPAY ||
|
|
65
|
-
(fundingSource === FUNDING.CARD && props.experience === EXPERIENCE.INLINE)
|
|
66
|
-
) {
|
|
61
|
+
if (fundingSource === FUNDING.VENMO || fundingSource === FUNDING.APPLEPAY) {
|
|
67
62
|
// wait for button to load
|
|
68
63
|
} else if (supportsPopups() && !props.merchantRequestedPopupsDisabled) {
|
|
69
64
|
// remember the popup window to prevent showing a new popup window on every click in the prerender state
|
package/src/zoid/buttons/util.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isStandAlone,
|
|
16
16
|
once,
|
|
17
17
|
} from "@krakenjs/belter/src";
|
|
18
|
-
import {
|
|
18
|
+
import { ENV, FUNDING } from "@paypal/sdk-constants/src";
|
|
19
19
|
import {
|
|
20
20
|
getEnableFunding,
|
|
21
21
|
getLogger,
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
getPlatform,
|
|
25
25
|
getComponents,
|
|
26
26
|
getEnv,
|
|
27
|
-
type FundingEligibilityType,
|
|
28
27
|
} from "@paypal/sdk-client/src";
|
|
29
28
|
import { getRefinedFundingEligibility } from "@paypal/funding-components/src";
|
|
30
29
|
|
|
@@ -374,52 +373,3 @@ export function getButtonSize(
|
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
375
|
}
|
|
377
|
-
|
|
378
|
-
type InlineCheckoutEligibilityProps = {|
|
|
379
|
-
commit: boolean,
|
|
380
|
-
createBillingAgreement?: Function,
|
|
381
|
-
currency: string,
|
|
382
|
-
disableFunding: $ReadOnlyArray<$Values<typeof FUNDING>>,
|
|
383
|
-
fundingEligibility: FundingEligibilityType,
|
|
384
|
-
layout: $Values<typeof BUTTON_LAYOUT>,
|
|
385
|
-
merchantID?: $ReadOnlyArray<string>,
|
|
386
|
-
onComplete: Function,
|
|
387
|
-
custom?: ?{|
|
|
388
|
-
css?: {|
|
|
389
|
-
[string]: string,
|
|
390
|
-
|},
|
|
391
|
-
label?: string,
|
|
392
|
-
|},
|
|
393
|
-
vault: boolean,
|
|
394
|
-
|};
|
|
395
|
-
|
|
396
|
-
export function isInlineXOEligible({
|
|
397
|
-
props,
|
|
398
|
-
}: {|
|
|
399
|
-
props: InlineCheckoutEligibilityProps,
|
|
400
|
-
|}): boolean {
|
|
401
|
-
const {
|
|
402
|
-
commit,
|
|
403
|
-
currency,
|
|
404
|
-
custom,
|
|
405
|
-
createBillingAgreement,
|
|
406
|
-
disableFunding,
|
|
407
|
-
fundingEligibility,
|
|
408
|
-
layout,
|
|
409
|
-
onComplete,
|
|
410
|
-
vault,
|
|
411
|
-
} = props;
|
|
412
|
-
|
|
413
|
-
const isEligible =
|
|
414
|
-
(custom?.label && custom.label.length > 0,
|
|
415
|
-
onComplete &&
|
|
416
|
-
commit === true &&
|
|
417
|
-
!createBillingAgreement &&
|
|
418
|
-
currency === CURRENCY.USD &&
|
|
419
|
-
disableFunding?.indexOf(FUNDING.CARD) === -1 &&
|
|
420
|
-
(fundingEligibility?.card?.eligible || false) &&
|
|
421
|
-
layout === BUTTON_LAYOUT.VERTICAL &&
|
|
422
|
-
vault === false);
|
|
423
|
-
|
|
424
|
-
return isEligible;
|
|
425
|
-
}
|
|
@@ -75,7 +75,6 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
75
75
|
const {
|
|
76
76
|
nonce,
|
|
77
77
|
locale: { lang },
|
|
78
|
-
inlinexo,
|
|
79
78
|
} = props;
|
|
80
79
|
const content = containerContent[lang];
|
|
81
80
|
return (
|
|
@@ -88,7 +87,6 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
88
87
|
prerenderFrame={prerenderFrame}
|
|
89
88
|
content={content}
|
|
90
89
|
nonce={nonce}
|
|
91
|
-
fullScreen={inlinexo === true}
|
|
92
90
|
/>
|
|
93
91
|
).render(dom({ doc }));
|
|
94
92
|
},
|
|
@@ -279,13 +277,6 @@ export function getCheckoutComponent(): CheckoutComponent {
|
|
|
279
277
|
default: () => window.__test__ || { action: "checkout" },
|
|
280
278
|
},
|
|
281
279
|
|
|
282
|
-
inlinexo: {
|
|
283
|
-
type: "boolean",
|
|
284
|
-
required: false,
|
|
285
|
-
queryParam: true,
|
|
286
|
-
allowDelegate: true,
|
|
287
|
-
},
|
|
288
|
-
|
|
289
280
|
smokeHash: {
|
|
290
281
|
type: "string",
|
|
291
282
|
required: false,
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import type { CustomStyle } from "../../../types";
|
|
4
|
-
import { CLASS } from "../../../constants";
|
|
5
|
-
|
|
6
|
-
export const customStyle = ({
|
|
7
|
-
custom,
|
|
8
|
-
}: {|
|
|
9
|
-
custom?: ?CustomStyle,
|
|
10
|
-
|}): string => {
|
|
11
|
-
const { css } = custom || {};
|
|
12
|
-
|
|
13
|
-
if (!css) {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let heightStyle = "";
|
|
18
|
-
let marginStyle = "";
|
|
19
|
-
let style = Object.keys(css).reduce((acc, key) => {
|
|
20
|
-
if (key === "height") {
|
|
21
|
-
heightStyle = `
|
|
22
|
-
height: ${css[key]};
|
|
23
|
-
max-height: ${css[key]};
|
|
24
|
-
`;
|
|
25
|
-
} else if (key.indexOf("margin") !== -1) {
|
|
26
|
-
marginStyle = `${key}: ${css[key]};`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
acc += `${key}: ${css[key]};`;
|
|
30
|
-
return acc;
|
|
31
|
-
}, "");
|
|
32
|
-
style = `.${CLASS.BUTTON}.${CLASS.CUSTOM} { ${style} } .${CLASS.BUTTON_ROW}.${
|
|
33
|
-
CLASS.CUSTOM
|
|
34
|
-
} { ${heightStyle + marginStyle}}`;
|
|
35
|
-
|
|
36
|
-
return style;
|
|
37
|
-
};
|