working hard coded one time payment to one org

This commit is contained in:
Arjun Patel
2019-03-06 03:42:50 -08:00
parent bc0e2bd0fd
commit 0a1ce8ee5f
2 changed files with 6 additions and 8 deletions
@@ -43,7 +43,6 @@ exports.create = (req, res, next) => {
// grant, // grant,
// message: 'Grant Created' // message: 'Grant Created'
// }); // });
console.log(grants);
next(grants.dataValues); next(grants.dataValues);
return null; return null;
+6 -7
View File
@@ -10,7 +10,7 @@ exports.grantCharge = async (grant, req, res, next) => {
const { stripeToken, monthly } = req.body; const { stripeToken, monthly } = req.body;
const grant_id = await grant.id; const grant_id = await grant.id;
const amount = req.body.amount * 100; //stripe standards const amount = 100 * 100; //stripe standards
const user = req.user; const user = req.user;
const product_id = 'prod_ER3jOog6QMX1GP', const product_id = 'prod_ER3jOog6QMX1GP',
@@ -42,15 +42,14 @@ exports.grantCharge = async (grant, req, res, next) => {
currency: 'usd', currency: 'usd',
source: 'tok_visa', source: 'tok_visa',
description: 'One time payment for grant', description: 'One time payment for grant',
statement_descriptor: 'one-time-grant', statement_descriptor: 'one-time-grant'
transfer_group: 'Grant ' + grant_id
}); });
let transfers = stripe.transfers.create({ await stripe.transfers.create({
amount: 7000, amount: amount - 1000,
currency: 'usd', currency: 'usd',
destination: '{CONNECTED_STRIPE_ACCOUNT_ID}', source_transaction: charge.id,
transfer_group: '{ORDER10}' destination: 'acct_1EAxzUIVW1uo07uH'
}); });
await Charge.create({ await Charge.create({