123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Fuel.Infrastructure.Payment.Models
- {
- public class ElectronicOrderModel
- {
- [Key]
- public int Id { get; set; }
- [Required]
- [MaxLength(192)]
- public string SiteId { get; set; }
- //public string CurrentBuId { get; set; }
- //public string ConfigurationServiceUrl { get; set; }
- public Object Config { get; set; }
- public Object Certification { get; set; }
- /// <summary>
- /// Gets or sets the time that client side create this order
- /// </summary>
- public DateTime? CreationTime { get; set; }
- /// <summary>
- /// 根据不同场景选择不同的支付方式, accepted values: WX_SCAN、ALI_SCAN、ALL_IN_SCAN
- /// </summary>
- [Required]
- public string Channel { get; set; }
- [Required]
- public bool IsRefund { get; set; }
- /// <summary>
- /// trade status, expected values: USERPAYING, SUCCESS, SUCCESS_CANCELLING, PAYERROR, PAYERROR_CANCELLING, CLOSED
- /// </summary>
- public TradeStatus TradeStatus { get; set; }
- /// <summary>
- /// Gets or sets the netamount for this transaction, this amount deducted all the discount, and should be the final amount would be charged from
- /// customer account.
- /// </summary>
- [Required]
- public decimal NetAmount { get; set; }
- /// <summary>
- /// Gets or sets the grossamount for this transaction, this is not the final amount to be charged from
- /// customer account, need substract the discount.
- /// </summary>
- public decimal GrossAmount { get; set; }
- public decimal TotalAmount { get; set; }
- /// <summary>
- /// Gets or sets the 商户订单号, 确保唯一
- /// </summary>
- [Required]
- [MaxLength(128)]
- public string BillNumber { get; set; }
- /// <summary>
- /// Gets or sets the 订单标题 UTF8编码格式,32个字节内,最长支持16个汉字
- /// </summary>
- [MaxLength(32)]
- public string Title { get; set; }
- /// <summary>
- /// Gets or sets 用户授权码, 当商户用扫码枪扫用户的条形码时得到的字符串
- /// </summary>
- [Required]
- public string AuthCode { get; set; }
- /// <summary>
- /// Gets or sets the operator id for who submit this order from site.
- /// </summary>
- [MaxLength(128)]
- public string OperatorId { get; set; }
- /// <summary>
- /// Gets or sets the terminal id for submit this order
- /// </summary>
- [MaxLength(128)]
- public string TerminalId { get; set; }
- /// <summary>
- /// Gets or sets the time that server received this order for processing.
- /// </summary>
- public DateTime? ReceivedTime { get; set; }
- /// <summary>
- /// Gets or set the Optional data.
- /// sample: {"key1":"value1","key2":"value2",...}
- /// 用户自定义的参数,将会在webhook通知中原样返回,该字段主要用于商户携带订单的自定义数据
- /// </summary>
- public Dictionary<string, object> Optional { get; set; } = new Dictionary<string, object>();
- [Required(ErrorMessage = "Need provide at least one FuelOrderDetail")]
- public List<FuelOrderDetailModel> FuelOrderDetails { get; set; }
- /// <summary>
- /// Gets or sets the process result which from the communication result with the 3rd party payment server
- /// </summary>
- public List<ElectronicOrderProcessResultModel> ProcessResults { get; set; }
- public string ToSimpleLogString()
- {
- return "SiteId: " + this.SiteId + ", BillNumber: " + this.BillNumber;
- }
- }
- }
|