Ejemplo n.º 1
0
        /// <summary>
        /// 查询退款状态
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetWeixinRefundInfo(HttpContext context)
        {
            string orderDetailId = context.Request["order_detail_id"];

            if (string.IsNullOrEmpty(orderDetailId))
            {
                resp.errcode = 1;
                resp.errmsg  = "order_detail_id 参数不能为空";
                return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            }
            WXMallRefund model = bllMall.GetRefundInfoByOrderDetailId(int.Parse(orderDetailId));

            ZentCloud.BLLJIMP.Model.PayConfig payConfig = bllPay.GetPayConfig();
            string msg       = "";
            bool   isSuccess = bllPay.QueryWeixinRefund(model.OrderDetailId.ToString(), model.WeiXinRefundId, payConfig.WXAppId, payConfig.WXMCH_ID, payConfig.WXPartnerKey, out msg);

            if (isSuccess)
            {
                return(ZentCloud.Common.JSONHelper.ObjectToJson(new
                {
                    errcode = 0,
                    refund_status = msg,
                }));
            }
            else
            {
                return(ZentCloud.Common.JSONHelper.ObjectToJson(new
                {
                    errcode = 1,
                    refund_status = msg,
                }));
            }
        }