Metatron_Admin_Backend/models/payment.model.js
2025-10-09 10:10:50 +05:30

13 lines
547 B
JavaScript

import mongoose from "mongoose";
const paymentSchema = new mongoose.Schema({
email: { type: String, required: true },
amount: { type: Number, required: true }, // store in cents
currency: { type: String, default: "usd" },
stripePaymentIntentId: { type: String }, // ❌ remove required: true
stripeSessionId: { type: String }, // ✅ store Checkout Session ID
status: { type: String, default: "pending" }, // pending, succeeded, failed
}, { timestamps: true });
export const Payment = mongoose.model("Payment", paymentSchema);