changes to flow of payments for different fees shown

This commit is contained in:
Arjun Patel
2019-04-30 03:29:03 -07:00
parent 98d165eab1
commit db960ee554
6 changed files with 79 additions and 74 deletions
+13 -13
View File
@@ -48,19 +48,6 @@ exports.createGrant = async (req, res, next) => {
}
);
const grantsOrgs = organizations.map(org => {
return {
grant_id: grant.id,
organization_id: org.id,
amount: org.amount
};
});
// mapping between bundle and orgs
await GrantOrganization.bulkCreate(grantsOrgs, {
transaction
});
// one time charge
const charge = await stripe.grantCharge({
grant,
@@ -72,6 +59,19 @@ exports.createGrant = async (req, res, next) => {
user
});
const grantsOrgs = organizations.map(org => {
return {
grant_id: grant.id,
organization_id: org.id,
amount: org.finalAmountToOrg
};
});
// mapping between bundle and orgs
await GrantOrganization.bulkCreate(grantsOrgs, {
transaction
});
await Charge.create(
{
id: charge.id,