payments v1
This commit is contained in:
+20
-20
@@ -2,7 +2,7 @@ var express = require('express')
|
||||
var router = express.Router()
|
||||
|
||||
const DB = require("../mongoDB.js");
|
||||
const Payments = require("../payments.js");
|
||||
//const Payments = require("../payments.js");
|
||||
const Stripe = require('stripe');
|
||||
const stripe = Stripe(process.env.STRIPE);
|
||||
|
||||
@@ -17,26 +17,26 @@ DB.getDB.then((DB) => {
|
||||
return DB.ObjectID(req.cookies.profile_id || req.query.profile_id || req.body.profile_id);
|
||||
}
|
||||
|
||||
router.get("/", async (req, res) => {
|
||||
//let profiles = await DB.getUserProfiles(userid);
|
||||
//Payments.getCustomerCard()
|
||||
return res.json({
|
||||
status: "ok",
|
||||
});
|
||||
});
|
||||
// router.get("/", async (req, res) => {
|
||||
// //let profiles = await DB.getUserProfiles(userid);
|
||||
// //Payments.getCustomerCard()
|
||||
// return res.json({
|
||||
// status: "ok",
|
||||
// });
|
||||
// });
|
||||
|
||||
router.post("/card", async (req, res) => {
|
||||
//get user stripe customer
|
||||
//Payments.getCustomerByID
|
||||
//if not customer register, make one
|
||||
//Payments.addNewCustomer()
|
||||
//add card to customer
|
||||
const cardInfo = req.body.cardInfo;
|
||||
//Payments.addNewCustomerCard()
|
||||
return res.json({
|
||||
status: "ok",
|
||||
});
|
||||
});
|
||||
// router.post("/card", async (req, res) => {
|
||||
// //get user stripe customer
|
||||
// //Payments.getCustomerByID
|
||||
// //if not customer register, make one
|
||||
// //Payments.addNewCustomer()
|
||||
// //add card to customer
|
||||
// const cardInfo = req.body.cardInfo;
|
||||
// //Payments.addNewCustomerCard()
|
||||
// return res.json({
|
||||
// status: "ok",
|
||||
// });
|
||||
// });
|
||||
|
||||
router.post("/create-payment-intent", async (req, res) => {
|
||||
const { items } = req.body;
|
||||
|
||||
Reference in New Issue
Block a user