Пример #1
0
 /// <summary>
 /// 失败时触发
 /// </summary>
 /// <param name="e"></param>
 protected void OnFail(PayEventArgs e)
 {
     if (Fail != null)
     {
         Fail(e);
     }
 }
Пример #2
0
 /// <summary>
 /// 成功时触发
 /// </summary>
 /// <param name="e"></param>
 protected void OnSuccess(PayEventArgs e)
 {
     if (Success != null)
     {
         Success(e);
     }
 }
Пример #3
0
        /// <summary>
        /// 回调处理
        /// </summary>
        /// <param name="httpMethod"></param>
        public override PayEventModel Notify_Return(EnumHelper.HttpMethod httpMethod)
        {
            var Request  = CGTHttpContext.Current.Request;
            var Response = CGTHttpContext.Current.Response;
            //var get_post = httpMethod == EnumHelper.HttpMethod.Get ? Request.QueryString : Request.Form;

            string datas        = Request.Form["data"];
            string encryptkeys  = Request.Form["encryptkey"];
            string merchant_ids = Request.Form["merchant_id"];

            //解密
            string encryptkey = com.nodeServices.RSAencrypt(encryptkeys, JsonConfig.JsonRead("ReapalPrivateKeyPfxUrl", "Reapal")).Result;
            var    data       = com.nodeServices.AESencrypt(datas, encryptkey).Result;

            LoggerFactory.Instance.Logger_Info(string.Format("ReapalRefundService----data:{0},encryptkey:{1},merchant_id:{2},解密后的参数data:{3}", datas, encryptkeys, merchant_ids, data));
            var samePortal = JsonConvert.DeserializeObject <SamePortalView>(data);

            var model = new PayEventArgs()
            {
                order_no    = samePortal.order_no,
                trade_no    = samePortal.trade_no,
                total_fee   = samePortal.total_fee,
                status      = samePortal.status,
                merchant_id = samePortal.merchant_id,
                result_code = samePortal.result_code,
                result_msg  = samePortal.result_msg
            };

            var returnModel = new PayEventModel();

            //成功
            if (samePortal.status.ToUpper() == "TRADE_FINISHED")
            {
                OnSuccess(model);

                returnModel.Code      = "0000";
                returnModel.IsSuccess = true;
                returnModel.Msg       = "成功";
                returnModel.OrderId   = model.order_no;
            }
            else
            {
                OnFail(model);

                returnModel.Code      = "0001";
                returnModel.IsSuccess = false;
                returnModel.Msg       = "失败";
            }

            return(returnModel);
        }