Skip to content

Instantly share code, notes, and snippets.

@sansmischevia
Created July 30, 2015 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sansmischevia/9a7b4965bf3d86a55625 to your computer and use it in GitHub Desktop.
Save sansmischevia/9a7b4965bf3d86a55625 to your computer and use it in GitHub Desktop.
var self = <My Model>;
var stripeOpts = {
description: self.getStripeDescription(subject),
email: self.email,
metadata: self.generateStripeMetadata(subject),
// acct_ ...
stripe_account: subject.managedAccountId
};
// Only attaching source if the token is present
if (opts.source) {
stripeOpts.source = opts.token;
}
lib.stripe.customers.create(stripeOpts, function(err, response) {
// response does not contain 'email', 'metadata', 'description' fields. Only cus_*** is set on the response
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment