Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="req"></param>
 /// <param name="merchStore"></param>
 public SxfPayQueryRequest(PayQueryRequest req, MerchantStoreChannelModel merchStore)
 {
     this.CharSet    = PayConst.SXF_DEF_CHARSET;
     this.MerchantId = merchStore.MerchId3;
     this.ShopId     = merchStore.StoreId3;
     this.TerminalId = req.Device_Id.ToString();
     this.SignType   = PayConst.SXF_DEF_SIGNTYPE;
     this.Type       = PayConst.SXF_TYPE_PAYORDERQUERY;
     this.PayOrderNo = req.Out_Trade_No;
     this.Version    = PayConst.SXF_DEF_VERSION;
 }
Пример #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="req"></param>
 /// <param name="merchStore"></param>
 public SxfPayBatchQueryRequest(PayBatchQueryRequest req, MerchantStoreChannelModel merchStore)
 {
     this.CharSet     = PayConst.SXF_DEF_CHARSET;
     this.MerchantId  = merchStore.MerchId3;
     this.ShopId      = merchStore.StoreId3;
     this.TerminalId  = req.Device_Id;
     this.SignType    = PayConst.SXF_DEF_SIGNTYPE;
     this.Version     = PayConst.SXF_DEF_VERSION;
     this.Type        = PayConst.SXF_TYPE_PAYORDERPAGEQUERY;
     this.PAG_NO      = req.Page_Num;
     this.PER_PAG_CNT = req.Page_Size;
     this.StartDate   = req.Start_Date;
     this.EndDate     = req.End_Date;
     this.OrderType   = req.Order_Type;
 }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="merchStore"></param>
        /// <returns></returns>
        public RefundQueryResponse ToRefundQueryResponse(MerchantStoreChannelModel merchStore)
        {
            var obj = new RefundQueryResponse()
            {
                Mch_Id          = merchStore.MchId,
                Device_Id       = this.TerminalId,
                Refund_Trade_No = this.RfdOrderNo,
                Refund_Date     = PayTradeHelper.Convert2DateFormat(this.RfdDate, this.RfdTime, "yyyy-MM-dd HH:mm:ss"),
                Refund_Status   = (PayTradeHelper.Convert2EnumString <RefundState>(PayTradeHelper.Convert2EnumValue <SxfRefundState>(this.RfdStatus))).ToUpper(),
                Return_Code     = PayTradeHelper.TransCodeBySxf(this.RspCod),
                Return_Msg      = this.RspMsg,
                Store_Id        = merchStore.SID,
                Sign_Type       = this.SignType,
                Refund_Amount   = this.RfdAmt,
                Version         = PayConst.DEF_VERSION
            };

            return(obj);
        }
Пример #4
0
        /// <summary>
        /// 转换为BasePayQueryOrderList
        /// </summary>
        /// <param name="merchStore"></param>
        /// <returns></returns>
        public List <BasePayQueryResponse> ToBasePayQueryRspOrderList(MerchantStoreChannelModel merchStore)
        {
            var orderList = new List <BasePayQueryResponse>();

            if (this.OrderList != null)
            {
                foreach (var item in this.OrderList)
                {
                    orderList.Add(new BasePayQueryResponse()
                    {
                        Buyer_Mobile = item.UserMobile,
                        Order_Type   = item.OrderType,
                        Out_Trade_No = item.PayOrderNo,
                        Pay_Channel  = item.PayChannel,
                        Pay_Date     = PayTradeHelper.Convert2DateFormat(item.PayDate, item.PayTime, "yyyy-MM-dd HH:mm:ss"),
                        Pay_Status   = (PayTradeHelper.Convert2EnumString <PayState>(PayTradeHelper.Convert2EnumValue <SxfPayState>(item.PayStatus))).ToUpper(),
                        Total_Amount = item.TxAmt
                    });
                }
            }
            return(orderList);
        }
Пример #5
0
        /// <summary>
        /// 转换为PayBatchQueryResponse
        /// </summary>
        /// <param name="merchStore"></param>
        /// <returns></returns>
        public PayBatchQueryResponse ToPayBatchQueryRsp(MerchantStoreChannelModel merchStore)
        {
            var obj = new PayBatchQueryResponse()
            {
                Buyer_Mobile = this.UserMobile,
                Mch_Id       = merchStore.MchId,
                Device_Id    = this.TerminalId,
                Order_Type   = this.OrderType,
                Return_Code  = PayTradeHelper.TransCodeBySxf(this.RspCod),
                Return_Msg   = this.RspMsg,
                Store_Id     = merchStore.SID,
                Sign_Type    = this.SignType,
                Version      = PayConst.DEF_VERSION,
                Start_Date   = this.StartDate,
                End_Date     = this.EndDate,
                Page_Num     = this.PAG_NO,
                Page_Size    = this.PER_PAG_CNT,
                Order_List   = this.ToBasePayQueryRspOrderList(merchStore)
            };

            return(obj);
        }
Пример #6
0
        /// <summary>
        /// 转换为单笔支付订单查询响应Model
        /// </summary>
        /// <param name="merchStore"></param>
        /// <returns></returns>
        public PayQueryResponse ToPayQueryResponse(MerchantStoreChannelModel merchStore)
        {
            var obj = new PayQueryResponse()
            {
                Buyer_Mobile = this.UserMobile,
                Mch_Id       = merchStore.MchId,
                Device_Id    = this.TerminalId,
                Order_Type   = this.OrderType,
                Out_Trade_No = this.PayOrderNo,
                Pay_Channel  = this.PayChannel,
                Pay_Date     = PayTradeHelper.Convert2DateFormat(this.PayDate, this.PayTime, "yyyy-MM-dd HH:mm:ss"),
                Pay_Status   = (PayTradeHelper.Convert2EnumString <PayState>(PayTradeHelper.Convert2EnumValue <SxfPayState>(this.PayStatus))).ToUpper(),
                Return_Code  = this.RspCod,
                Return_Msg   = this.RspMsg,
                Store_Id     = merchStore.SID,
                Sign_Type    = this.SignType,
                Total_Amount = this.TxAmt,
                Version      = PayConst.DEF_VERSION
            };

            return(obj);
        }