mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
f5618e9d9c
added page and corisponding endpoint to migrate to annual plan
39 lines
2.3 KiB
CoffeeScript
39 lines
2.3 KiB
CoffeeScript
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
SubscriptionController = require('./SubscriptionController')
|
|
SubscriptionGroupController = require './SubscriptionGroupController'
|
|
Settings = require "settings-sharelatex"
|
|
|
|
module.exports =
|
|
apply: (app) ->
|
|
return unless Settings.enableSubscriptions
|
|
|
|
app.get '/user/subscription/plans', SubscriptionController.plansPage
|
|
|
|
app.get '/user/subscription', AuthenticationController.requireLogin(), SubscriptionController.userSubscriptionPage
|
|
|
|
app.get '/user/subscription/new', AuthenticationController.requireLogin(), SubscriptionController.paymentPage
|
|
app.get '/user/subscription/billing-details/edit', AuthenticationController.requireLogin(), SubscriptionController.editBillingDetailsPage
|
|
|
|
app.get '/user/subscription/thank-you', AuthenticationController.requireLogin(), SubscriptionController.successful_subscription
|
|
|
|
|
|
app.get '/subscription/group', AuthenticationController.requireLogin(), SubscriptionGroupController.renderSubscriptionGroupAdminPage
|
|
app.post '/subscription/group/user', AuthenticationController.requireLogin(), SubscriptionGroupController.addUserToGroup
|
|
app.del '/subscription/group/user/:user_id', AuthenticationController.requireLogin(), SubscriptionGroupController.removeUserFromGroup
|
|
|
|
|
|
#recurly callback
|
|
app.post '/user/subscription/callback', SubscriptionController.recurlyNotificationParser, SubscriptionController.recurlyCallback
|
|
app.ignoreCsrf("post", '/user/subscription/callback')
|
|
|
|
#user changes their account state
|
|
app.post '/user/subscription/create', AuthenticationController.requireLogin(), SubscriptionController.createSubscription
|
|
app.post '/user/subscription/update', AuthenticationController.requireLogin(), SubscriptionController.updateSubscription
|
|
app.post '/user/subscription/cancel', AuthenticationController.requireLogin(), SubscriptionController.cancelSubscription
|
|
app.post '/user/subscription/reactivate', AuthenticationController.requireLogin(), SubscriptionController.reactivateSubscription
|
|
|
|
|
|
app.get "/user/subscription/upgrade-annual", AuthenticationController.requireLogin(), SubscriptionController.renderUpgradeToAnnualPlanPage
|
|
app.post "/user/subscription/upgrade-annual", AuthenticationController.requireLogin(), SubscriptionController.processUpgradeToAnnualPlan
|
|
|
|
|