Merge pull request #24417 from overleaf/mf-implement-stripe-hosted-checkout-split-test
[web] Implement stripe hosted checkout with split test GitOrigin-RevId: 25e5ff2a46135f402cdf479623ab38c858c5640c
This commit is contained in:
@@ -629,7 +629,7 @@ async function getRecommendedCurrency(req, res) {
|
||||
ip = req.query.ip
|
||||
}
|
||||
const currencyLookup = await GeoIpLookup.promises.getCurrencyCode(ip)
|
||||
const countryCode = currencyLookup.countryCode
|
||||
let countryCode = currencyLookup.countryCode
|
||||
const recommendedCurrency = currencyLookup.currencyCode
|
||||
|
||||
let currency = null
|
||||
@@ -640,6 +640,13 @@ async function getRecommendedCurrency(req, res) {
|
||||
currency = recommendedCurrency
|
||||
}
|
||||
|
||||
const queryCountryCode = req.query.countryCode?.toUpperCase()
|
||||
|
||||
// only enable countryCode testing flag on staging or dev environments
|
||||
if (queryCountryCode && process.env.NODE_ENV !== 'production') {
|
||||
countryCode = queryCountryCode
|
||||
}
|
||||
|
||||
return {
|
||||
currency,
|
||||
recommendedCurrency,
|
||||
|
||||
Reference in New Issue
Block a user