var fs = require('fs');
var https = require('https');
var inquirer = require('inquirer');
var paypal = require('paypal-rest-sdk');
var pkg = require('../../package.json');
var ua = pkg.name + '#' + pkg.version;
var questions = [{
  type: "input",
  name: "client_id",
  message: "Your client_id in PayPal:"
}, {
  type: "password",
  name: "client_secret",
  message: "Your client_secret in PayPal:"
}];

var get_token = function (client_id, client_secret) {
  var sender_batch_id = Math.random().toString(36).substring(9);
  paypal.configure({
    'mode': 'sandbox', //sandbox or live
    'client_id': client_id,
    'client_secret': client_secret
  });
  paypal.generateToken(function (err, token) {
    if (err) throw err;
    fs.writeFileSync(__dirname + '/../../.token', token);
    fs.writeFileSync(__dirname + '/../../.client_id', client_id);
    console.log("Success!");
  });
};

module.exports = function () {
  console.log('Obtaining access_token from PayPal.');
  inquirer.prompt(questions, function(credentials) {
    get_token(
      credentials.client_id,
      credentials.client_secret
    );
  });
};

@@ -727,59 +727,51 @@
     
-fs.writeFileSync(__dirname + '/../../.token', token
+var token_persist = paypal.getTokenPersist(
 );%0A 
@@ -815,29 +815,37 @@
 ../.
-client_id', client_id
+token_persist', token_persist
 );%0A 

Save token_persist in login