Created
July 30, 2015 01:20
-
-
Save sansmischevia/9a7b4965bf3d86a55625 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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