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:
M Fahru
2025-03-25 09:05:16 +00:00
committed by Copybot
parent 374acf8119
commit 9eb84d6ad5
4 changed files with 226 additions and 1 deletions
@@ -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,