Server IP : 162.213.251.212 / Your IP : 3.145.143.57 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/needapair.com/schema/ |
Upload File : |
const mongoose = require('mongoose'); const { Schema } = mongoose; const saleSchema = new Schema({ payment: new Schema({ id: { type: String, }, intent: { type: String, }, cart: { type: String, }, payer: new Schema({ payment_method: { type: String, }, status: { type: String, }, payer_info: new Schema({ email: { type: String, index: false }, first_name: { type: String, }, last_name: { type: String, }, payer_id: { type: String, }, shipping_address: new Schema({ recipient_name: { type: String, }, line1: { type: String, }, line2: { type: String, }, city: { type: String, }, state: { type: String, }, postal_code: { type: String, }, country_code: { type: String, }, }), country_code: { type: String, } }), }), transactions: [new Schema({ amount: new Schema({ total: { type: Number, }, currency: { type: String, }, details: new Schema({ subtotal: { type: Number, }, shipping: { type: Number, }, insurance: { type: Number, }, handling_fee: { type: Number, }, shipping_discount: { type: Number, }, discount: { type: Number, } }) }), payee: new Schema({ merchant_id: { type: String, }, email: { type: String, index: false }, }), description: { type: String, }, soft_descriptor: { type: String, }, item_list: new Schema({ items: [new Schema({ name: { type: String, }, sku: { type: String, }, price: { type: Number, }, currency: { type: String, }, tax: { type: Number, }, quantity: { type: Number, }, image_url: { type: String, }, })], shipping_address: new Schema({ recipient_name: { type: String, }, line1: { type: String, }, line2: { type: String, }, city: { type: String, }, state: { type: String, }, postal_code: { type: String, }, country_code: { type: String, }, }) }), related_resources: { sale: new Schema({ id: { type: String, }, state: { type: String, }, amount: new Schema({ total: { type: Number, }, currency: { type: String, }, details: new Schema({ subtotal: { type: Number, }, shipping: { type: Number, }, insurance: { type: Number, }, handling_fee: { type: Number, }, shipping_discount: { type: Number, }, discount: { type: Number, } }) }), payment_mode: { type: String, }, protection_eligibility: { type: String, }, protection_eligibility_type: { type: String, }, transaction_fee: new Schema({ value: { type: Number, }, currency: { type: String, }, }), parent_payment: { type: String, }, create_time: { type: Date }, update_time: { type: Date }, }) } })], failed_transactions: { type: Array }, create_time: { type: Date }, update_time: { type: Date }, httpStatusCode: { type: Number } }), query: new Schema({ paymentId: { type: String }, token: { type: String }, PayerID: { type: String }, }), user: { type: mongoose.Schema.Types.ObjectId, ref: 'sale' } }, { timestamps: true }); const Sale = mongoose.model('sale', saleSchema) module.exports = Sale;