adding charges table and starting the endpoint for charging for a grant

This commit is contained in:
Arjun Patel
2019-01-29 10:32:21 -08:00
parent 6ca8807a9b
commit e3b7a1699e
13 changed files with 148 additions and 9 deletions
+22
View File
@@ -0,0 +1,22 @@
const db = require('../config/db.config.js'),
errorMaker = require('../helpers/error.maker');
const stripe = require('stripe')('sk_test_n8NCvCFjD1xFhGiEq6SI8CXj');
const { Donor, Organization } = db;
// Subscribe user to plan or one time charge
exports.grantCharge = async (req, res, next) => {
const { stripeToken, amount, monthly } = req.body;
console.log(req.body);
// if (!monthly) {
// const charge = stripe.charges.create({
// amount,
// currency: 'usd',
// description: 'One time payment for grant',
// source: stripeToken,
// statement_descriptor: 'One time payment for grant'
// });
// }
};