Merge pull request #26087 from overleaf/mf-change-to-stripe-uk

[web] Configure to use Stripe UK account

GitOrigin-RevId: 0856f6da2caae8caf9887ec2acea8e7f0972e598
This commit is contained in:
Kristina
2025-06-09 08:05:09 +00:00
committed by Copybot
parent 9e9ad3c005
commit a8df91e91b
9 changed files with 60 additions and 49 deletions
@@ -27,21 +27,26 @@ function ensurePlansAreSetupCorrectly() {
}
const recurlyPlanCodeToStripeLookupKey = {
'professional-annual': 'professional_annual',
professional: 'professional_monthly',
professional_free_trial_7_days: 'professional_monthly',
'collaborator-annual': 'standard_annual',
collaborator: 'standard_monthly',
collaborator_free_trial_7_days: 'standard_monthly',
'student-annual': 'student_annual',
student: 'student_monthly',
student_free_trial_7_days: 'student_monthly',
group_professional: 'group_professional_enterprise',
group_professional_educational: 'group_professional_educational',
collaborator: 'collaborator_may2025',
'collaborator-annual': 'collaborator_annual_may2025',
collaborator_free_trial_7_days: 'collaborator_may2025',
professional: 'professional_may2025',
'professional-annual': 'professional_annual_may2025',
professional_free_trial_7_days: 'professional_may2025',
student: 'student_may2025',
'student-annual': 'student_annual_may2025',
student_free_trial_7_days: 'student_may2025',
// TODO: change all group plans' lookup_keys to match the UK account after they have been added
group_collaborator: 'group_standard_enterprise',
group_collaborator_educational: 'group_standard_educational',
'assistant-annual': 'error_assist_annual',
assistant: 'error_assist_monthly',
group_professional: 'group_professional_enterprise',
group_professional_educational: 'group_professional_educational',
assistant: 'assistant_may2025',
'assistant-annual': 'assistant_annual_may2025',
}
/**
@@ -66,10 +71,10 @@ function mapRecurlyAddOnCodeToStripeLookupKey(
// Recurly always uses 'assistant' as the code regardless of the subscription duration
if (recurlyAddOnCode === 'assistant') {
if (billingCycleInterval === 'month') {
return 'error_assist_monthly'
return 'assistant_may2025'
}
if (billingCycleInterval === 'year') {
return 'error_assist_annual'
return 'assistant_annual_may2025'
}
}
return null
@@ -77,21 +82,25 @@ function mapRecurlyAddOnCodeToStripeLookupKey(
const recurlyPlanCodeToPlanTypeAndPeriod = {
collaborator: { planType: 'individual', period: 'monthly' },
collaborator_free_trial_7_days: { planType: 'individual', period: 'monthly' },
'collaborator-annual': { planType: 'individual', period: 'annual' },
collaborator_free_trial_7_days: { planType: 'individual', period: 'monthly' },
professional: { planType: 'individual', period: 'monthly' },
'professional-annual': { planType: 'individual', period: 'annual' },
professional_free_trial_7_days: {
planType: 'individual',
period: 'monthly',
},
'professional-annual': { planType: 'individual', period: 'annual' },
student: { planType: 'student', period: 'monthly' },
student_free_trial_7_days: { planType: 'student', period: 'monthly' },
'student-annual': { planType: 'student', period: 'annual' },
group_professional: { planType: 'group', period: 'annual' },
group_professional_educational: { planType: 'group', period: 'annual' },
student_free_trial_7_days: { planType: 'student', period: 'monthly' },
group_collaborator: { planType: 'group', period: 'annual' },
group_collaborator_educational: { planType: 'group', period: 'annual' },
group_professional: { planType: 'group', period: 'annual' },
group_professional_educational: { planType: 'group', period: 'annual' },
assistant: { planType: null, period: 'monthly' },
'assistant-annual': { planType: null, period: 'annual' },
}
@@ -27,7 +27,7 @@ block append meta
meta(name="ol-user" data-type="json" content=user)
if (personalSubscription && personalSubscription.payment)
meta(name="ol-recurlyApiKey" content=settings.apis.recurly.publicKey)
meta(name="ol-stripeApiKey" content=settings.apis.stripe.publishableKey)
meta(name="ol-stripeUKApiKey" content=settings.apis.stripeUK.publishableKey)
meta(name="ol-recommendedCurrency" content=personalSubscription.payment.currency)
meta(name="ol-groupPlans" data-type="json" content=groupPlans)