|
@@ -241,6 +241,9 @@ const promises = {
|
|
|
account_code: user._id,
|
|
account_code: user._id,
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
|
|
+ if (subscriptionDetails.subscription_add_ons) {
|
|
|
|
|
+ data.subscription_add_ons = subscriptionDetails.subscription_add_ons
|
|
|
|
|
+ }
|
|
|
const customFields =
|
|
const customFields =
|
|
|
getCustomFieldsFromSubscriptionDetails(subscriptionDetails)
|
|
getCustomFieldsFromSubscriptionDetails(subscriptionDetails)
|
|
|
if (customFields) {
|
|
if (customFields) {
|
|
@@ -286,14 +289,6 @@ const promises = {
|
|
|
{ userId: user._id },
|
|
{ userId: user._id },
|
|
|
'starting process of creating paypal subscription'
|
|
'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
|
|
// We use waterfall through each of these actions in sequence
|
|
|
// passing a `cache` object along the way. The cache is initialized
|
|
// 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
|
|
// with required data, and `async.apply` to pass the cache to the first function
|