@paypal/checkout-components 5.0.227 → 5.0.230
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## <small>5.0.230 (2022-07-06)</small>
|
|
2
|
+
|
|
3
|
+
* chore: update minimum height for single name field (#1962) ([92d81aa](https://github.com/paypal/paypal-checkout-components/commit/92d81aa)), closes [#1962](https://github.com/paypal/paypal-checkout-components/issues/1962)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## <small>5.0.229 (2022-06-23)</small>
|
|
8
|
+
|
|
9
|
+
* chore: remove Inline XO experiment (#1956) ([edc220d](https://github.com/paypal/paypal-checkout-components/commit/edc220d)), closes [#1956](https://github.com/paypal/paypal-checkout-components/issues/1956)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## <small>5.0.228 (2022-06-22)</small>
|
|
14
|
+
|
|
15
|
+
* Inline XO: Experiment (#1955) ([86f0b47](https://github.com/paypal/paypal-checkout-components/commit/86f0b47)), closes [#1955](https://github.com/paypal/paypal-checkout-components/issues/1955)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## <small>5.0.227 (2022-06-10)</small>
|
|
2
20
|
|
|
3
21
|
* chore: log screen information for SFVC path (#1951) ([6eb2270](https://github.com/paypal/paypal-checkout-components/commit/6eb2270)), closes [#1951](https://github.com/paypal/paypal-checkout-components/issues/1951)
|
package/package.json
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { getLogger, getLocale, getClientID, getEnv, getIntent, getCommit, getVault, getDisableFunding, getDisableCard,
|
|
6
6
|
getMerchantID, getPayPalDomainRegex, getCurrency, getSDKMeta, getCSPNonce, getBuyerCountry, getClientAccessToken, getPlatform,
|
|
7
7
|
getPartnerAttributionID, getCorrelationID, getEnableThreeDomainSecure, getDebug, getComponents, getStageHost, getAPIStageHost, getPayPalDomain,
|
|
8
|
-
getUserIDToken, getClientMetadataID, getAmount, getEnableFunding, getStorageID, getUserExperienceFlow, getMerchantRequestedPopupsDisabled,
|
|
8
|
+
getUserIDToken, getClientMetadataID, getAmount, getEnableFunding, getStorageID, getUserExperienceFlow, getMerchantRequestedPopupsDisabled,
|
|
9
|
+
getVersion } from '@paypal/sdk-client/src';
|
|
9
10
|
import { rememberFunding, getRememberedFunding, getRefinedFundingEligibility } from '@paypal/funding-components/src';
|
|
10
11
|
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
|
|
11
12
|
import { create, EVENT, type ZoidComponent } from '@krakenjs/zoid/src';
|
|
@@ -28,8 +29,8 @@ import { type InlineXOEligibilityType } from '../../types';
|
|
|
28
29
|
import { containerTemplate } from './container';
|
|
29
30
|
import { PrerenderedButtons } from './prerender';
|
|
30
31
|
import { applePaySession, determineFlow, isSupportedNativeBrowser, createVenmoExperiment,
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
getRenderedButtons, getButtonSize, getButtonExperiments, isInlineXOEligible } from './util';
|
|
33
|
+
|
|
33
34
|
|
|
34
35
|
export type ButtonsComponent = ZoidComponent<ButtonProps>;
|
|
35
36
|
|
|
@@ -52,7 +53,7 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
52
53
|
|
|
53
54
|
prerenderTemplate: ({ state, props, doc, event }) => {
|
|
54
55
|
const { buttonSessionID } = props;
|
|
55
|
-
|
|
56
|
+
|
|
56
57
|
if (!isLocalStorageEnabled()) {
|
|
57
58
|
getLogger().info('localstorage_inaccessible_possible_private_browsing').track({
|
|
58
59
|
[ FPTI_KEY.BUTTON_SESSION_UID ]: buttonSessionID,
|
|
@@ -113,7 +114,7 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
113
114
|
fundingEligibility = getRefinedFundingEligibility(),
|
|
114
115
|
supportsPopups = userAgentSupportsPopups(),
|
|
115
116
|
supportedNativeBrowser = isSupportedNativeBrowser(),
|
|
116
|
-
experiment = getButtonExperiments(
|
|
117
|
+
experiment = getButtonExperiments(),
|
|
117
118
|
createBillingAgreement, createSubscription
|
|
118
119
|
} = props;
|
|
119
120
|
|
|
@@ -263,19 +264,11 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
263
264
|
onShippingAddressChange: {
|
|
264
265
|
type: 'function',
|
|
265
266
|
required: false,
|
|
266
|
-
queryParam: true,
|
|
267
|
-
queryValue: ({ value }) => {
|
|
268
|
-
return value ? QUERY_BOOL.TRUE : QUERY_BOOL.FALSE;
|
|
269
|
-
}
|
|
270
267
|
},
|
|
271
268
|
|
|
272
269
|
onShippingOptionsChange: {
|
|
273
270
|
type: 'function',
|
|
274
271
|
required: false,
|
|
275
|
-
queryParam: true,
|
|
276
|
-
queryValue: ({ value }) => {
|
|
277
|
-
return value ? QUERY_BOOL.TRUE : QUERY_BOOL.FALSE;
|
|
278
|
-
}
|
|
279
272
|
},
|
|
280
273
|
|
|
281
274
|
onCancel: {
|
|
@@ -326,23 +319,12 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
326
319
|
logLatencyInstrumentationPhase({ buttonSessionID: props.buttonSessionID, phase: 'buttons-first-render' });
|
|
327
320
|
|
|
328
321
|
return (...args) => {
|
|
329
|
-
const { fundingSource } = props;
|
|
330
322
|
const venmoExperiment = createVenmoExperiment();
|
|
331
323
|
|
|
332
324
|
if (venmoExperiment) {
|
|
333
325
|
venmoExperiment.logStart({ [ FPTI_KEY.BUTTON_SESSION_UID ]: props.buttonSessionID });
|
|
334
326
|
}
|
|
335
327
|
|
|
336
|
-
const enableNoPaylaterExperiment = createNoPaylaterExperiment(fundingSource);
|
|
337
|
-
|
|
338
|
-
if (enableNoPaylaterExperiment) {
|
|
339
|
-
enableNoPaylaterExperiment.logStart({
|
|
340
|
-
[ FPTI_KEY.BUTTON_SESSION_UID ]: props.buttonSessionID,
|
|
341
|
-
[ FPTI_KEY.CONTEXT_ID ]: props.buttonSessionID,
|
|
342
|
-
[ FPTI_KEY.CONTEXT_TYPE ]: 'button_session_id'
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
|
|
346
328
|
return value(...args);
|
|
347
329
|
};
|
|
348
330
|
}
|
|
@@ -473,9 +455,8 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
473
455
|
experiment: {
|
|
474
456
|
type: 'object',
|
|
475
457
|
queryParam: true,
|
|
476
|
-
value: (
|
|
477
|
-
const
|
|
478
|
-
const experiments = getButtonExperiments(fundingSource);
|
|
458
|
+
value: () => {
|
|
459
|
+
const experiments = getButtonExperiments();
|
|
479
460
|
return experiments;
|
|
480
461
|
}
|
|
481
462
|
},
|
|
@@ -711,7 +692,7 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
711
692
|
}
|
|
712
693
|
}
|
|
713
694
|
|
|
714
|
-
|
|
695
|
+
const eligible = inlineCheckoutEligibility && inlineCheckoutEligibility.eligible && alphaEligible && isInlineXOEligible({ props: {
|
|
715
696
|
commit,
|
|
716
697
|
createBillingAgreement,
|
|
717
698
|
currency,
|
|
@@ -720,7 +701,18 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
720
701
|
layout,
|
|
721
702
|
locale,
|
|
722
703
|
vault
|
|
723
|
-
} })
|
|
704
|
+
} });
|
|
705
|
+
|
|
706
|
+
const logger = getLogger();
|
|
707
|
+
|
|
708
|
+
logger
|
|
709
|
+
.info('isInlineXOEligible props', { props: JSON.stringify(props) })
|
|
710
|
+
.info('isInlineXOEligible eligible', { eligible: String(eligible) })
|
|
711
|
+
.track({
|
|
712
|
+
[ FPTI_KEY.TRANSITION ]: `inline_xo_eligibility_${ String(eligible) }`
|
|
713
|
+
}).flush();
|
|
714
|
+
|
|
715
|
+
return eligible ? EXPERIENCE.INLINE : '';
|
|
724
716
|
}
|
|
725
717
|
},
|
|
726
718
|
|
package/src/zoid/buttons/util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @flow */
|
|
2
|
-
import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isIOS14, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled, isStandAlone } from '@krakenjs/belter/src';
|
|
3
|
-
import { COUNTRY, CURRENCY, ENV,
|
|
4
|
-
import { getEnableFunding,
|
|
2
|
+
import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isIOS14, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled, isStandAlone, once } from '@krakenjs/belter/src';
|
|
3
|
+
import { COUNTRY, CURRENCY, ENV, FUNDING, type LocaleType } from '@paypal/sdk-constants/src';
|
|
4
|
+
import { getEnableFunding, getLogger, createExperiment, getFundingEligibility, getPlatform, getComponents, getEnv, type FundingEligibilityType } from '@paypal/sdk-client/src';
|
|
5
5
|
import { getRefinedFundingEligibility } from '@paypal/funding-components/src';
|
|
6
6
|
|
|
7
7
|
import type { Experiment as EligibilityExperiment } from '../../types';
|
|
@@ -20,7 +20,7 @@ type DetermineFlowOptions = {|
|
|
|
20
20
|
*
|
|
21
21
|
* @param {string} key for logging
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const logNativeScreenInformation = once((key = 'screenInformation') => {
|
|
24
24
|
if (window) {
|
|
25
25
|
const height = window.innerHeight;
|
|
26
26
|
const outerHeight = window.outerHeight;
|
|
@@ -35,7 +35,7 @@ function logNativeScreenInformation(key = 'screenInformation') {
|
|
|
35
35
|
// $FlowFixMe - object is mixed values when this expects all of the same value types
|
|
36
36
|
.info(key, screenInformation)
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
});
|
|
39
39
|
|
|
40
40
|
export function determineFlow(props : DetermineFlowOptions) : $Values<typeof BUTTON_FLOW> {
|
|
41
41
|
|
|
@@ -126,39 +126,6 @@ export function getVenmoExperiment() : EligibilityExperiment {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export function createNoPaylaterExperiment(fundingSource : ?$Values<typeof FUNDING>) : Experiment | void {
|
|
130
|
-
const disableFunding = getDisableFunding();
|
|
131
|
-
const isDisableFundingPaylater = disableFunding && disableFunding.indexOf(FUNDING.PAYLATER) !== -1;
|
|
132
|
-
const enableFunding = getEnableFunding();
|
|
133
|
-
const isEnableFundingPaylater = enableFunding && enableFunding.indexOf(FUNDING.PAYLATER) !== -1;
|
|
134
|
-
|
|
135
|
-
const { paylater } = getFundingEligibility();
|
|
136
|
-
const isEligibleForPaylater = paylater?.eligible;
|
|
137
|
-
const isExperimentable = paylater?.products?.paylater?.variant === 'experimentable' || paylater?.products?.payIn4?.variant === 'experimentable';
|
|
138
|
-
// No experiment because ineligible, already forced on or off
|
|
139
|
-
if (!isEligibleForPaylater
|
|
140
|
-
|| !isExperimentable
|
|
141
|
-
|| isDisableFundingPaylater
|
|
142
|
-
|| isEnableFundingPaylater
|
|
143
|
-
|| fundingSource
|
|
144
|
-
) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return createExperiment('disable_paylater', 0);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function getNoPaylaterExperiment(fundingSource : ?$Values<typeof FUNDING>) : EligibilityExperiment {
|
|
152
|
-
const experiment = createNoPaylaterExperiment(fundingSource);
|
|
153
|
-
|
|
154
|
-
const disableFunding = getDisableFunding();
|
|
155
|
-
const isDisableFundingPaylater = disableFunding && disableFunding.indexOf(FUNDING.PAYLATER) !== -1;
|
|
156
|
-
const isExperimentEnabled = experiment && experiment.isEnabled();
|
|
157
|
-
return {
|
|
158
|
-
disablePaylater: Boolean((isExperimentEnabled || isDisableFundingPaylater))
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
129
|
export function getVenmoAppLabelExperiment() : EligibilityExperiment {
|
|
163
130
|
const isEnvForTest = getEnv() === ENV.LOCAL || getEnv() === ENV.TEST || getEnv() === ENV.STAGE;
|
|
164
131
|
|
|
@@ -259,10 +226,9 @@ export function applePaySession() : ?ApplePaySessionConfigRequest {
|
|
|
259
226
|
}
|
|
260
227
|
}
|
|
261
228
|
|
|
262
|
-
export function getButtonExperiments (
|
|
229
|
+
export function getButtonExperiments () : EligibilityExperiment {
|
|
263
230
|
return {
|
|
264
231
|
...getVenmoExperiment(),
|
|
265
|
-
...getNoPaylaterExperiment(fundingSource),
|
|
266
232
|
...getVenmoAppLabelExperiment()
|
|
267
233
|
};
|
|
268
234
|
}
|
|
@@ -347,12 +313,5 @@ export function isInlineXOEligible({ props } : {| props : InlineCheckoutEligibil
|
|
|
347
313
|
vault === false
|
|
348
314
|
);
|
|
349
315
|
|
|
350
|
-
getLogger()
|
|
351
|
-
.info('isInlineXOEligible props', { props: JSON.stringify(props) })
|
|
352
|
-
.info('isInlineXOEligible eligible', { eligible: String(isEligible) })
|
|
353
|
-
.track({
|
|
354
|
-
[ FPTI_KEY.TRANSITION ]: `inline_xo_eligibility_${ String(isEligible) }`
|
|
355
|
-
}).flush();
|
|
356
|
-
|
|
357
316
|
return isEligible;
|
|
358
317
|
}
|
|
@@ -67,20 +67,20 @@ export function PaymentFieldsContainer({ uid, frame, prerenderFrame, event, nonc
|
|
|
67
67
|
min-width: 250px;
|
|
68
68
|
max-width: 100%;
|
|
69
69
|
font-size: 0;
|
|
70
|
-
height:
|
|
71
|
-
min-height:
|
|
70
|
+
height: 91px;
|
|
71
|
+
min-height: 91px;
|
|
72
72
|
transition: all 0.5s ease-in-out;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
@media only screen and (min-width: 0px) {
|
|
76
76
|
#${ uid } {
|
|
77
|
-
min-height:
|
|
77
|
+
min-height: 91px;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
@media only screen and (min-width: 600px) {
|
|
82
82
|
#${ uid } {
|
|
83
|
-
min-height:
|
|
83
|
+
min-height: 91px;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|