Payment purchase date
This commit is contained in:
parent
3f8776af1e
commit
127bdd1c70
|
@ -134,7 +134,6 @@ module.exports.postRazorpay = async (req, res, next) => {
|
|||
course: courseId,
|
||||
user: userId,
|
||||
paymentSuccess: false,
|
||||
date_purchased: Date.now().toString(),
|
||||
});
|
||||
|
||||
order = await order.save();
|
||||
|
@ -167,6 +166,7 @@ module.exports.postRazorpay = async (req, res, next) => {
|
|||
name: user.firstName + " " + user.lastName,
|
||||
email: user.email,
|
||||
receipt: response.receipt,
|
||||
date_purchased: response.created_at,
|
||||
});
|
||||
if (coupon && coupon.numAllowed > 0) {
|
||||
coupon.numAllowed = coupon.numAllowed - 1;
|
||||
|
|
|
@ -23,7 +23,6 @@ const orderSchema = new Schema({
|
|||
orderId: {
|
||||
type: String,
|
||||
},
|
||||
date_purchased: { type: Date },
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Order", orderSchema);
|
||||
|
|
Loading…
Reference in New Issue