mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated subscription flow to only attach single tier to member
refs https://github.com/TryGhost/Team/issues/1728 - previously, we allowed a member to be mapped to multiple tiers simultaneously as an edge case, in case they managed to signup via another subscription - since this was always an edge case and not supported, to simplify the flows going forward now that complimentary members can also upgrade, in case of an active subscription we'll always just attach the associated tier to member and remove all other tiers mapped to it
This commit is contained in:
parent
6f2066517b
commit
c19d2d8712
1 changed files with 37 additions and 30 deletions
|
@ -941,6 +941,12 @@ module.exports = class MemberRepository {
|
|||
} else {
|
||||
status = 'paid';
|
||||
}
|
||||
if (this._labsService.isSet('compExpiring')) {
|
||||
// This is an active subscription! Update member to have only this product
|
||||
if (ghostProduct) {
|
||||
memberProducts = [ghostProduct.toJSON()];
|
||||
}
|
||||
} else {
|
||||
// This is an active subscription! Add the product
|
||||
if (ghostProduct) {
|
||||
memberProducts.push(ghostProduct.toJSON());
|
||||
|
@ -977,6 +983,7 @@ module.exports = class MemberRepository {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const subscriptions = await member.related('stripeSubscriptions').fetch(options);
|
||||
let activeSubscriptionForGhostProduct = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue