const Paymenttransations = require("../models/paymenttransations");




exports.paymenttransationscreate = async function (req, res ,next) {
		  try {
			  
				let paymenttransationssave = new Paymenttransations(
        {
            userid: req.body.userid,
            planid: req.body.planid,
			transactionid: req.body.transactionid,
			status: req.body.status,
        }
    );
	paymenttransationssave.save(function (err) {
        if (err) {
            return next(err);
        }
		res.status(200).json({
              message:
                "Payment Transation Record successfully" ,
            });
      
    })
			
}
		  catch (err) {
			console.log(err)
		}
		  
		  
      
};	


exports.paymenttransationslist = (req, res, next) => {
 
Paymenttransations.find({userid:req.body.userid})
    .then((paymenttransation) => {
      res.status(200).json({paymenttransationslist:paymenttransation});
    })
    .catch((err) => {
      console.log(err);
    });
};


