示例#1
0
        /// <summary>
        /// 提交差旅支付返现
        /// </summary>
        /// <param name="List">订单信息</param>
        /// <param name="ServiceUrl">请求接口地址</param>
        /// <param name="Path"></param>
        /// <param name="Pwd"></param>
        /// <param name="MerchantId"></param>
        /// <param name="UserKey"></param>
        /// <param name="BaoLiAPIUrl"></param>
        /// <param name="Message"></param>
        /// <param name="OrderMessage"></param>
        public ResponsePayAPIMessage SubmitTravelPayRemoney(PayRemoneyImportModel payRemony, UserAccount userAccount, string Path, string Pwd, string MerchantId, string UserKey, string BaoLiAPIUrl)
        {
            ResponsePayModel      payModel = new ResponsePayModel();
            ResponsePayAPIMessage orderPay = BaoLiOrderPayMoney(payRemony, userAccount, BaoLiAPIUrl, Path, Pwd, MerchantId, UserKey, ref payModel);

            return(orderPay);
        }
示例#2
0
        /// <summary>
        /// 调用保理订单支付返现
        /// </summary>
        /// <param name="payRemony">数据实体</param>
        /// <param name="BaoLiServiceUrl">保理接口地址</param>
        /// <param name="Path">证书路径</param>
        /// <param name="Pwd">密码</param>
        /// <param name="MerchantId">商户编号</param>
        /// <param name="UserKey">key值</param>
        /// <param name="respons">返回支付返现信息</param>
        /// <returns>接口返回信息</returns>
        public ResponsePayAPIMessage BaoLiOrderPayMoney(PayRemoneyImportModel payRemony, UserAccount userAccount, string BaoLiServiceUrl, string Path, string Pwd, string MerchantId, string UserKey, ref ResponsePayModel respons)
        {
            respons = new ResponsePayModel();
            ResponsePayAPIMessage result = new ResponsePayAPIMessage();

            try {
                #region 乘机人信息
                TravelPassenger pmodel = new TravelPassenger();
                pmodel.PassengerName     = payRemony.person.PersonName;
                pmodel.PassengerType     = payRemony.person.PersonType;
                pmodel.CertificateNumber = payRemony.person.IdNumber;
                pmodel.CertificateType   = payRemony.person.CardType;
                pmodel.Birthday          = payRemony.person.BrithDay.ToString("yyyy-MM-dd");
                pmodel.AirTicketNo       = payRemony.person.TicketId;
                #endregion

                #region 航段
                Voyage vmodel = new Voyage();

                vmodel.Departure     = payRemony.DepartCode;
                vmodel.Arrival       = payRemony.ArriveCode;
                vmodel.DepartureTime = payRemony.DepartureTime.ToString();
                vmodel.ArrivalTime   = payRemony.ArriveTime.ToString();
                vmodel.Bunk          = payRemony.Cabin;
                vmodel.Airline       = payRemony.AirCompanyCode;
                vmodel.FlightNo      = payRemony.FlightNo;

                #endregion

                var item = new RequestBaoLiPayAPIModel {
                    PayUserName  = payRemony.PayAccount,
                    IsRemoney    = payRemony.IsRemoney.ToString(),
                    UserName     = payRemony.RemoneyAccount,
                    OrderId      = payRemony.PlateCode,
                    MerchantCode = payRemony.CompanyCode,
                    StartDate    = payRemony.StartDate.ToString("yyyy-MM-dd"),
                    TicketTime   = payRemony.TicketTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    NotifyUrl    = payRemony.CallBackUrl,
                    ReturnUrl    = payRemony.TimelyUrl,
                    Rebate       = Convert.ToInt32(payRemony.Rebate),
                    RetMoney     = Convert.ToInt32(payRemony.SomeRebate),
                    Pnr          = payRemony.PNR,
                    OrderPrice   = payRemony.OrderPrice.ToString("#0.00"),
                    TicketPrice  = payRemony.TicketPrice.ToString("#0.00"),
                    AirPortTax   = Convert.ToInt32(payRemony.AirFee),
                    FuelTax      = Convert.ToInt32(payRemony.FuelFee),
                    Passenger    = pmodel,
                    Voyage       = vmodel,
                    TimesTamp    = payRemony.TimesTamp,
                    Ip           = payRemony.Ip,
                    Mac          = payRemony.Mac,
                    UserKey      = payRemony.UserKey,
                    EnterpriseID = Convert.ToInt32(payRemony.EnterpriseID),
                    IsValid      = true
                };

                PayRequestBaseModel baseModel = apiResult <RequestBaoLiPayAPIModel>(item, Path, Pwd, MerchantId, UserKey);
                string url      = BaoLiServiceUrl + "api/Travel/Pay";
                var    jsonData = JsonConvert.SerializeObject(baseModel);
                //var post = HttpRequest.HttpRequestUtility.SendPostRequestCore(url, jsonData, "UTF-8", null);
                var post = apiPost(url, jsonData);
                result = JsonConvert.DeserializeObject <ResponsePayAPIMessage>(post);
                if (result.Status == 100)
                {
                    var _EnterpriseOrder = new EnterpriseOrder()
                    {
                        OrderId          = item.OrderId,
                        UserInterestRate = userAccount.FactoringInterestRate,
                        UserInterest     = decimal.Parse(item.TicketPrice) * userAccount.FactoringInterestRate
                    };
                    enterpriseOrderRep.UpdateEnterpriseOrderBackState(_EnterpriseOrder);
                }
                if (!string.IsNullOrEmpty(result.Result))
                {
                    respons = JsonConvert.DeserializeObject <ResponsePayModel>(result.Result);
                }
                return(result);
            }
            catch (Exception ex) {
                LoggerFactory.Instance.Logger_Error(ex, "ReviewTravelOrderError");
                return(result);
            }
        }