text: var User = require('../../../models/User');
  var braintree = require("braintree");
  //set the plugin controller directory
  var directory =  '../'
  ////////////////////////////////////////////
  ///////   BRAINTREE INTEGRATION    ////////
  //////////////////////////////////////////
  var gateway = braintree.connect({
    environment: braintree.Environment.Sandbox,
    merchantId: process.env.MERCHANTID,
    publicKey: process.env.PUBLICKEY,
    privateKey: process.env.PRIVATEKEY
  });
  
  ///////////////////////////////////////////////
  ////     SET YOUR APP.JSON DETAILS        //// 
  /////////////////////////////////////////////
  //Not working ? try double dots on the json url..
  var myModule = require('../../../app.json');
  var sitename = myModule.sitename
  var website = myModule.website
  var repo = myModule.repo
  
  /////////////////////////////////////////////
  //////////  UPGRADE PAYPAL PAGE ////////////
  ///////////////////////////////////////////
  exports.upgrade = function(req, res) {
      if (!req.user) {
      return res.redirect('/');
    }
    res.render(directory+'/views/settings/upgrade_paypal', {
      pagetitle: 'Upgrade your plan',
      siteName : sitename,
    });
  }; 
  
  //////////////////////////////////////////////////////////
  //////////  PAYMENT NOTIFICATION FROM PAYPAL ////////////
  ////////////////////////////////////////////////////////
  exports.success = function(req, res) {
      if (!req.user) {
      return res.redirect('/');
    }
      res.render(directory+'/views/settings/success', {
      pagetitle: 'Upgrade | '+sitename+'',
      siteName : sitename,
      layout :false
    });
  }; 
  
  
  //////////////////////////////////////////////////////////
  //////////  PAYMENT NOTIFICATION FROM PAYPAL ////////////
  ////////////////////////////////////////////////////////
  exports.paypalipn = function(req, res) {
    if (!req.user) {
      return res.redirect('/');
    }
      console.log(req)
  }; 
  