mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #5122 from overleaf/ta-trial-extended-event
Add Subscriptions Trial Extended Event GitOrigin-RevId: 3fe64f58fbab27e35c417fa2fe9880f883385ad2
This commit is contained in:
@@ -66,6 +66,7 @@ async function _sendSubscriptionUpdatedEvent(eventData) {
|
|||||||
AnalyticsManager.recordEventForUser(userId, 'subscription-updated', {
|
AnalyticsManager.recordEventForUser(userId, 'subscription-updated', {
|
||||||
plan_code: planCode,
|
plan_code: planCode,
|
||||||
quantity,
|
quantity,
|
||||||
|
is_trial: isTrial,
|
||||||
})
|
})
|
||||||
AnalyticsManager.setUserPropertyForUser(
|
AnalyticsManager.setUserPropertyForUser(
|
||||||
userId,
|
userId,
|
||||||
|
|||||||
@@ -421,6 +421,10 @@ async function extendTrial(req, res) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await SubscriptionHandler.promises.extendTrial(subscription, 14)
|
await SubscriptionHandler.promises.extendTrial(subscription, 14)
|
||||||
|
AnalyticsManager.recordEventForSession(
|
||||||
|
req.session,
|
||||||
|
'subscription-trial-extended'
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return res.sendStatus(500)
|
return res.sendStatus(500)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ describe('RecurlyEventHandler', function () {
|
|||||||
{
|
{
|
||||||
plan_code: this.planCode,
|
plan_code: this.planCode,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
|
is_trial: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
sinon.assert.calledWith(
|
sinon.assert.calledWith(
|
||||||
|
|||||||
Reference in New Issue
Block a user