diff --git a/services/web/app/src/Features/Subscription/RecurlyWrapper.js b/services/web/app/src/Features/Subscription/RecurlyWrapper.js index 77a9893fa5..053c983502 100644 --- a/services/web/app/src/Features/Subscription/RecurlyWrapper.js +++ b/services/web/app/src/Features/Subscription/RecurlyWrapper.js @@ -241,6 +241,9 @@ const promises = { account_code: user._id, }, } + if (subscriptionDetails.subscription_add_ons) { + data.subscription_add_ons = subscriptionDetails.subscription_add_ons + } const customFields = getCustomFieldsFromSubscriptionDetails(subscriptionDetails) if (customFields) { @@ -286,14 +289,6 @@ 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 diff --git a/services/web/frontend/js/features/group-management/components/upgrade-subscription/upgrade-subscription-plan-details.tsx b/services/web/frontend/js/features/group-management/components/upgrade-subscription/upgrade-subscription-plan-details.tsx index c61e46ac49..1236e0414b 100644 --- a/services/web/frontend/js/features/group-management/components/upgrade-subscription/upgrade-subscription-plan-details.tsx +++ b/services/web/frontend/js/features/group-management/components/upgrade-subscription/upgrade-subscription-plan-details.tsx @@ -5,7 +5,7 @@ import { Card, Row, Col } from 'react-bootstrap-5' import MaterialIcon from '@/shared/components/material-icon' import { formatCurrency } from '@/shared/utils/currency' -const LICENSE_ADD_ON = 'additional-license' +export const LICENSE_ADD_ON = 'additional-license' function UpgradeSubscriptionPlanDetails() { const { t } = useTranslation() diff --git a/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js b/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js index b2144b039b..ac353cddd7 100644 --- a/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js +++ b/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js @@ -893,31 +893,6 @@ describe('RecurlyWrapper', function () { this.createSubscription.callCount.should.equal(0) }) }) - - it('throw error if purchase with addon', async function () { - this.subscriptionDetails = { - currencyCode: 'EUR', - plan_code: 'some_plan_code', - coupon_code: '', - isPaypal: true, - address: { - address1: 'addr_one', - address2: 'addr_two', - country: 'some_country', - state: 'some_state', - zip: 'some_zip', - }, - subscription_add_ons: [ - { subscription_add_on: { add_on_code: 'test_add_on', quantity: 2 } }, - ], - } - await expect(this.call()).to.be.rejected - this.checkAccountExists.callCount.should.equal(0) - this.createAccount.callCount.should.equal(0) - this.createBillingInfo.callCount.should.equal(0) - this.setAddressAndCompanyBillingInfo.callCount.should.equal(0) - this.createSubscription.callCount.should.equal(0) - }) }) describe('paypal actions', function () {