Merge pull request #27391 from overleaf/rh-stripe-pause-anchor

Reset billing cycle when resuming paused Stripe subscription

GitOrigin-RevId: 44f7aa4d3eeaab7622e97b0178fe7d6c7cccae50
This commit is contained in:
roo hutton
2025-08-11 13:24:44 +01:00
committed by Copybot
parent 39a024359a
commit ece71f0426
2 changed files with 9 additions and 6 deletions
@@ -335,9 +335,7 @@ async function resumeSubscription(user) {
) {
throw new Error('No active subscription to resume')
}
await RecurlyClient.promises.resumeSubscriptionByUuid(
subscription.recurlySubscription_id
)
await Modules.promises.hooks.fire('resumePaidSubscription', subscription)
}
/**
@@ -436,11 +436,16 @@ describe('SubscriptionHandler', function () {
},
})
})
it('should make a resume call to recurly', async function () {
it('should call resume hook', async function () {
await this.SubscriptionHandler.promises.resumeSubscription(this.user)
this.RecurlyClient.promises.resumeSubscriptionByUuid.called.should.equal(
true
expect(this.Modules.promises.hooks.fire).to.have.been.calledWith(
'resumePaidSubscription',
{
recurlySubscription_id: this.activeRecurlySubscription.uuid,
recurlyStatus: { state: 'non-trial' },
planCode: 'collaborator',
}
)
})
})