point of sale order contoller with razorpay completed and cash with mail completed
This commit is contained in:
parent
105da2bccb
commit
00e6d2227a
@ -68,7 +68,8 @@ export const getRazerpayKey = async (req, res) => {
|
||||
export const checkout = async (req, res) => {
|
||||
try {
|
||||
const { userr,address, cart, subtotal,orderType } = req.body;
|
||||
// console.log(req.body);
|
||||
// console.log(req.body.cart[0].product);
|
||||
// console.log(req.body.cart[0].variant);
|
||||
if (cart.length < 1)
|
||||
return res.status(400).json({ message: "cart is empty!" });
|
||||
if (!address)
|
||||
@ -145,7 +146,7 @@ export const checkout = async (req, res) => {
|
||||
).toFixed(3),
|
||||
}));
|
||||
|
||||
// console.log("line", lineItems[0]);
|
||||
// console.log("Order", orderItems[0]);
|
||||
const Id = await generateUniqueOrderId();
|
||||
const orders = await Order.create({
|
||||
orderID: Id,
|
||||
|
Loading…
Reference in New Issue
Block a user