@paypal/checkout-components 5.0.226 → 5.0.229
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 +18 -0
- package/package.json +1 -1
- package/src/zoid/buttons/component.jsx +15 -11
- package/src/zoid/buttons/util.js +25 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## <small>5.0.229 (2022-06-23)</small>
|
|
2
|
+
|
|
3
|
+
* 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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## <small>5.0.228 (2022-06-22)</small>
|
|
8
|
+
|
|
9
|
+
* 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)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## <small>5.0.227 (2022-06-10)</small>
|
|
14
|
+
|
|
15
|
+
* 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)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## <small>5.0.226 (2022-06-06)</small>
|
|
2
20
|
|
|
3
21
|
* Inline XO: Fix production eligibility logic ([ad8b0d0](https://github.com/paypal/paypal-checkout-components/commit/ad8b0d0))
|
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';
|
|
@@ -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: {
|
|
@@ -711,7 +704,7 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
711
704
|
}
|
|
712
705
|
}
|
|
713
706
|
|
|
714
|
-
|
|
707
|
+
const eligible = inlineCheckoutEligibility && inlineCheckoutEligibility.eligible && alphaEligible && isInlineXOEligible({ props: {
|
|
715
708
|
commit,
|
|
716
709
|
createBillingAgreement,
|
|
717
710
|
currency,
|
|
@@ -720,7 +713,18 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
720
713
|
layout,
|
|
721
714
|
locale,
|
|
722
715
|
vault
|
|
723
|
-
} })
|
|
716
|
+
} });
|
|
717
|
+
|
|
718
|
+
const logger = getLogger();
|
|
719
|
+
|
|
720
|
+
logger
|
|
721
|
+
.info('isInlineXOEligible props', { props: JSON.stringify(props) })
|
|
722
|
+
.info('isInlineXOEligible eligible', { eligible: String(eligible) })
|
|
723
|
+
.track({
|
|
724
|
+
[ FPTI_KEY.TRANSITION ]: `inline_xo_eligibility_${ String(eligible) }`
|
|
725
|
+
}).flush();
|
|
726
|
+
|
|
727
|
+
return eligible ? EXPERIENCE.INLINE : '';
|
|
724
728
|
}
|
|
725
729
|
},
|
|
726
730
|
|
package/src/zoid/buttons/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @flow */
|
|
2
|
-
import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled } from '@krakenjs/belter/src';
|
|
3
|
-
import { COUNTRY, CURRENCY, ENV,
|
|
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
4
|
import { getEnableFunding, getDisableFunding, getLogger, createExperiment, getFundingEligibility, getPlatform, getComponents, getEnv, type FundingEligibilityType } from '@paypal/sdk-client/src';
|
|
5
5
|
import { getRefinedFundingEligibility } from '@paypal/funding-components/src';
|
|
6
6
|
|
|
@@ -15,6 +15,28 @@ type DetermineFlowOptions = {|
|
|
|
15
15
|
createSubscription : CreateSubscription
|
|
16
16
|
|};
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* log information about screen to debug. currently in use to test if sfvc logic triggers
|
|
20
|
+
*
|
|
21
|
+
* @param {string} key for logging
|
|
22
|
+
*/
|
|
23
|
+
const logNativeScreenInformation = once((key = 'screenInformation') => {
|
|
24
|
+
if (window) {
|
|
25
|
+
const height = window.innerHeight;
|
|
26
|
+
const outerHeight = window.outerHeight;
|
|
27
|
+
const scale = Math.round(window.screen.width / window.innerWidth * 100) / 100;
|
|
28
|
+
const computedHeight = Math.round(height * scale);
|
|
29
|
+
const ios14 = isIOS14();
|
|
30
|
+
const standAlone = isStandAlone();
|
|
31
|
+
|
|
32
|
+
const screenInformation = { computedHeight, height, ios14, outerHeight, scale, standAlone };
|
|
33
|
+
|
|
34
|
+
getLogger()
|
|
35
|
+
// $FlowFixMe - object is mixed values when this expects all of the same value types
|
|
36
|
+
.info(key, screenInformation)
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
18
40
|
export function determineFlow(props : DetermineFlowOptions) : $Values<typeof BUTTON_FLOW> {
|
|
19
41
|
|
|
20
42
|
if (props.createBillingAgreement) {
|
|
@@ -36,6 +58,7 @@ export function isSupportedNativeBrowser() : boolean {
|
|
|
36
58
|
}
|
|
37
59
|
|
|
38
60
|
if (isSFVC()) {
|
|
61
|
+
logNativeScreenInformation('sfvcScreenInformation');
|
|
39
62
|
return false;
|
|
40
63
|
}
|
|
41
64
|
|
|
@@ -324,12 +347,5 @@ export function isInlineXOEligible({ props } : {| props : InlineCheckoutEligibil
|
|
|
324
347
|
vault === false
|
|
325
348
|
);
|
|
326
349
|
|
|
327
|
-
getLogger()
|
|
328
|
-
.info('isInlineXOEligible props', { props: JSON.stringify(props) })
|
|
329
|
-
.info('isInlineXOEligible eligible', { eligible: String(isEligible) })
|
|
330
|
-
.track({
|
|
331
|
-
[ FPTI_KEY.TRANSITION ]: `inline_xo_eligibility_${ String(isEligible) }`
|
|
332
|
-
}).flush();
|
|
333
|
-
|
|
334
350
|
return isEligible;
|
|
335
351
|
}
|