/**
 * Require stripe module instance with platform account's secret API key
 */
var stripe = require("stripe")("sk_test_OBXX3FRuomYskOfEP62qbgMz"); 


/**
 * Takes token created from a debit card (client side) to create a 'customer' object associated with the Stripe platform account.
 * Returns a Stripe customer ID that should be saved to the associated user so it can later be retreived and charged to a different user's Stripe Connect account.
 */
exports.createPlatformCustomer = function(stripeToken, callback) {
  stripe.customers.create({
    source: stripeToken 
  }, function(err, customer) {
    // callback(err, customer)
    if (err) {
      console.log('Error:', err)
    } else {
      console.log('New customer!')
      callback(customer);  
    }
  });
};


@@ -768,8 +768,653 @@
 %7D);%0A%7D;%0A%0A
+/**%0A * Takes customer ID associated with a user profile (the paying account) and the Stripe Connect account access token of the receiving account.%0A * Returns a one-time use token for creating the actual charge.%0A */%0Avar createTokenFromCustomerId = function(customerId, stripeConnectAccessToken, callback) %7B%0A  stripe.tokens.create(%7B %0A    customer: customerId, %0A  %7D, stripeConnectAccessToken, // user's access token from the Stripe Connect flow%0A    function(err, token) %7B%0A      if (err)%7B%0A        console.log('Error:', err)%0A      %7D else %7B%0A        console.log('Token created!');%0A        console.log(token);%0A        callback(token);%0A      %7D%0A  %7D);%0A%7D;%0A%0A

Add stripe helper function for creating one-time use token for actual charges