2014-02-12 05:23:40 -05:00
|
|
|
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
|
2014-10-10 10:44:53 -04:00
|
|
|
|
|
|
|
app.get '/user/subscription/custom_account', AuthenticationController.requireLogin(), SubscriptionController.userCustomSubscriptionPage
|
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-05-22 08:57:15 -04:00
|
|
|
app.get '/user/subscription/:subscription_id/group/invited', AuthenticationController.requireLogin(), SubscriptionGroupController.renderGroupInvitePage
|
2015-05-26 10:25:46 -04:00
|
|
|
app.post '/user/subscription/:subscription_id/group/begin-join', AuthenticationController.requireLogin(), SubscriptionGroupController.beginJoinGroup
|
|
|
|
app.get '/user/subscription/:subscription_id/group/complete-join', AuthenticationController.requireLogin(), SubscriptionGroupController.completeJoin
|
|
|
|
app.get '/user/subscription/:subscription_id/group/successful-join', AuthenticationController.requireLogin(), SubscriptionGroupController.renderSuccessfulJoinPage
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
#recurly callback
|
|
|
|
app.post '/user/subscription/callback', SubscriptionController.recurlyNotificationParser, SubscriptionController.recurlyCallback
|
|
|
|
app.ignoreCsrf("post", '/user/subscription/callback')
|
|
|
|
|
2014-08-27 12:51:10 -04:00
|
|
|
#user changes their account state
|
2014-02-12 05:23:40 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2014-08-27 12:51:10 -04:00
|
|
|
app.get "/user/subscription/upgrade-annual", AuthenticationController.requireLogin(), SubscriptionController.renderUpgradeToAnnualPlanPage
|
|
|
|
app.post "/user/subscription/upgrade-annual", AuthenticationController.requireLogin(), SubscriptionController.processUpgradeToAnnualPlan
|
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
|