@paypal/checkout-components
Advanced tools
Comparing version 5.0.315 to 5.0.316
{ | ||
"name": "@paypal/checkout-components", | ||
"version": "5.0.315", | ||
"version": "5.0.316", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
/* @flow */ | ||
import { | ||
getUserIDToken, | ||
getPageType, | ||
getClientToken, | ||
getSDKToken, | ||
@@ -49,4 +47,2 @@ getLogger, | ||
pageType: getPageType(), | ||
userIDToken: getUserIDToken(), | ||
clientToken: getClientToken(), | ||
paypalApiDomain: getPayPalAPIDomain(), | ||
@@ -53,0 +49,0 @@ environment: getEnv(), |
@@ -63,4 +63,2 @@ /* @flow */ | ||
pageType: ?string, | ||
userIDToken: ?string, | ||
clientToken: ?string, | ||
paypalApiDomain: string, | ||
@@ -218,25 +216,2 @@ environment: ?string, | ||
if (sdkConfig.userIDToken) { | ||
logger.metricCounter({ | ||
namespace: shopperInsightsMetricNamespace, | ||
event: "error", | ||
dimensions: { | ||
errorType: "merchant_configuration_validation_error", | ||
validationDetails: "sdk_token_and_id_token_present", | ||
}, | ||
}); | ||
throw new ValidationError( | ||
`use script data attribute sdk-client-token instead of user-id-token` | ||
); | ||
} | ||
// Client token has widely adopted integrations in the SDK that we do not want | ||
// to support anymore. For now, we will be only enforcing a warning. We should | ||
// expand on this warning with upgrade guides when we have them. | ||
if (sdkConfig.clientToken) { | ||
// eslint-disable-next-line no-console | ||
console.warn(`script data attribute client-token is not recommended`); | ||
} | ||
return sdkConfig; | ||
@@ -243,0 +218,0 @@ }; |
@@ -35,4 +35,2 @@ /* @flow */ | ||
pageType: "checkout", | ||
clientToken: "", | ||
userIDToken: "", | ||
paypalApiDomain: "https://api.paypal.com", | ||
@@ -72,9 +70,10 @@ environment: "test", | ||
const shopperSession = createShopperSession(); | ||
const recommendedPaymentMethods = await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
const recommendedPaymentMethods = | ||
await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
@@ -100,9 +99,10 @@ expect.assertions(1); | ||
const recommendedPaymentMethods = await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
const recommendedPaymentMethods = | ||
await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
@@ -128,9 +128,10 @@ expect.assertions(1); | ||
const recommendedPaymentMethods = await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
const recommendedPaymentMethods = | ||
await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
@@ -149,9 +150,10 @@ expect.assertions(1); | ||
const recommendedPaymentMethods = await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
const recommendedPaymentMethods = | ||
await shopperSession.isEligibleInPaypalNetwork({ | ||
email: "email@test.com", | ||
phone: { | ||
countryCode: "1", | ||
nationalNumber: "2345678901", | ||
}, | ||
}); | ||
@@ -432,4 +434,2 @@ expect.assertions(1); | ||
pageType: "", | ||
userIDToken: "", | ||
clientToken: "", | ||
}, | ||
@@ -449,4 +449,2 @@ }) | ||
pageType: "", | ||
userIDToken: "", | ||
clientToken: "", | ||
}, | ||
@@ -458,18 +456,2 @@ }) | ||
}); | ||
test("should throw if ID token is passed", () => { | ||
expect(() => | ||
createShopperSession({ | ||
sdkConfig: { | ||
...defaultSdkConfig, | ||
sdkToken: "sdk-token", | ||
pageType: "product-listing", | ||
userIDToken: "id-token", | ||
clientToken: "", | ||
}, | ||
}) | ||
).toThrowError( | ||
"use script data attribute sdk-client-token instead of user-id-token" | ||
); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1179011
15793