@paypal/checkout-components 5.0.224 → 5.0.227

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.227 (2022-06-10)</small>
2
+
3
+ * 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)
4
+
5
+
6
+
7
+ ## <small>5.0.226 (2022-06-06)</small>
8
+
9
+ * Inline XO: Fix production eligibility logic ([ad8b0d0](https://github.com/paypal/paypal-checkout-components/commit/ad8b0d0))
10
+
11
+
12
+
13
+ ## <small>5.0.225 (2022-06-02)</small>
14
+
15
+ * Inline XO: Force Eligibility ([3f56a06](https://github.com/paypal/paypal-checkout-components/commit/3f56a06))
16
+
17
+
18
+
1
19
  ## <small>5.0.224 (2022-06-01)</small>
2
20
 
3
21
  * Inline XO: Production Alpha eligibility ([7bcf14c](https://github.com/paypal/paypal-checkout-components/commit/7bcf14c))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.224",
3
+ "version": "5.0.227",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -671,7 +671,11 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
671
671
  required: false,
672
672
  type: 'string',
673
673
  value: ({ props }) => {
674
- const { env, clientID, merchantID, commit, createBillingAgreement, currency, disableFunding = [], fundingEligibility, locale, style: { layout }, vault } = props || {};
674
+ const { env, clientID, merchantID, commit, createBillingAgreement, currency, disableFunding = [], experience, fundingEligibility, locale, style: { layout }, vault } = props || {};
675
+
676
+ if (experience === 'inline') {
677
+ return EXPERIENCE.INLINE;
678
+ }
675
679
 
676
680
  const inlineCheckoutEligibility : InlineXOEligibilityType = __INLINE_CHECKOUT_ELIGIBILITY__ || {
677
681
  eligible: false
@@ -701,8 +705,10 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
701
705
  return acc && validMerchantIDs.indexOf(id) !== -1;
702
706
  }, true);
703
707
 
704
- alphaEligible = clientID === 'AT2hsh6PFa_pvqYVni64Ik2Ojaluh_l9DU3KwXuHb-sgj8q9zZrmob2TUsmvu4rjJ869oHUAlIAqJf9R'
705
- && eligibleMerchantID;
708
+ if (clientID === 'AT2hsh6PFa_pvqYVni64Ik2Ojaluh_l9DU3KwXuHb-sgj8q9zZrmob2TUsmvu4rjJ869oHUAlIAqJf9R') {
709
+ alphaEligible = eligibleMerchantID;
710
+
711
+ }
706
712
  }
707
713
 
708
714
  return inlineCheckoutEligibility && inlineCheckoutEligibility.eligible && alphaEligible && isInlineXOEligible({ props: {
@@ -1,5 +1,5 @@
1
1
  /* @flow */
2
- import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled } from '@krakenjs/belter/src';
2
+ import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isIOS14, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled, isStandAlone } from '@krakenjs/belter/src';
3
3
  import { COUNTRY, CURRENCY, ENV, FPTI_KEY, 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';
@@ -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
+ function logNativeScreenInformation(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