mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 08:09:01 +02:00
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:
@@ -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',
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user