Created
July 1, 2016 23:18
-
-
Save farhan-syed/54e56a3db3c1e234254ae3538c734ebd 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
stripe.tokens.create( | |
{ customer: req.params.stripe_customer_cccount }, | |
{ stripe_account: req.params.seller_stripe_account }, // id of the connected account | |
function(error, token) { | |
if (error) { | |
console.log(error.message); | |
res.error(error.message); | |
} | |
else{ | |
stripe.charges.create({ | |
amount:req.params.price, | |
currency: "usd", | |
source: token, | |
description: 'Charge for ' + req.params.charge_description, | |
application_fee: application_fee | |
}, function(error, charge){ | |
if (error) { | |
console.log(error.message); | |
res.error(error.message); | |
} | |
else{ | |
console.log(charge.status); | |
res.success(charge); | |
} | |
}); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment