Merge pull request #22146 from overleaf/ls-consider-flexible-licensing-on-payment-page

support new group plans in checkout flow

GitOrigin-RevId: ec6aff363e0eeb5d82067cea44479b5045258490
This commit is contained in:
Liangjun Song
2024-12-06 09:05:43 +00:00
committed by Copybot
parent 932f395932
commit dfea9dacab
4 changed files with 53 additions and 1 deletions
@@ -286,6 +286,14 @@ const promises = {
{ userId: user._id },
'starting process of creating paypal subscription'
)
if (subscriptionDetails.subscription_add_ons) {
// TODO: support flexible licensing in paypal flow
const err = new Error('Add-on purchase not supported')
OError.tag(err, 'error in paypal subscription creation process', {
user_id: user._id,
})
throw err
}
// We use waterfall through each of these actions in sequence
// passing a `cache` object along the way. The cache is initialized
// with required data, and `async.apply` to pass the cache to the first function
@@ -343,6 +351,10 @@ const promises = {
data.account.billing_info.three_d_secure_action_result_token_id =
recurlyTokenIds.threeDSecureActionResult
}
if (subscriptionDetails.subscription_add_ons) {
data.subscription_add_ons = subscriptionDetails.subscription_add_ons
}
const customFields =
getCustomFieldsFromSubscriptionDetails(subscriptionDetails)
if (customFields) {