/// <summary> /// 2.3订单反交易接口 /// /paycashier/refund/BFrefund.do /// </summary> public void OrderRefund() { StringBuilder sbData = new StringBuilder(); sbData.Clear(); sbData.Append("{'oldBigOrderNo':'").Append("2016062900000001").Append("'"); //原总订单号 sbData.Append(",'oldBigReqNo':'").Append("2016062900000001").Append("'"); //原总订单请求流水号 sbData.Append(",'serviceCode':'").Append("031001002107061").Append("'"); //一级商户代码 sbData.Append(",'refundDate':'").Append("20160629").Append("'"); //反交易日期 YYYYMMDD sbData.Append(",'refundAmt':'").Append("12000").Append("'"); //反交易金额 单位:分 sbData.Append(",'mchntCode':'").Append("").Append("'"); //二级商户代码 sbData.Append(",'transCode':'").Append("2002").Append("'"); //反交易类型 2001:冲正 2002:退款 2003:消费撤销 2004:预授权撤销 sbData.Append(",'refundNo':'").Append("2016062900000001").Append("'"); //反交易请求流水号 sbData.Append("}"); //获取验证签名 string sSign = Cmn.GetSign(sbData.ToString()); //拼接Form并Post数据 //返回数据 string returnPost = ""; if (!string.IsNullOrEmpty(returnPost)) { JsonData jdP = JsonMapper.ToObject(returnPost.Trim()); if (jdP.Count > 0) { JsonData jdData = jdP[0]; JsonData jdSign = jdP[1]; string rRespCode = Convert.ToString(jdData["respCode"]); //响应结果 string rRespMsg = Convert.ToString(jdData["respMsg"]); //响应描述 if (rRespCode == "0000") //成功 { bool isCheck = Cmn.ValitedSign(jdSign.ToString(), jdData.ToJson()); if (isCheck == true) { string RoldBigOrderNo = Convert.ToString(jdData["oldBigOrderNo"]); //原总订单号 string RoldBigReqNo = Convert.ToString(jdData["oldBigReqNo"]); //原总订单请求流水号 string RrefundNo = Convert.ToString(jdData["refundNo"]); //反交易请求流水号 string RrefundAmt = Convert.ToString(jdData["refundAmt"]); //反交易金额 单位:分 string RinnerTranSeq = Convert.ToString(jdData["innerTranSeq"]); //平台流水号 } } } } }
/// <summary> /// 2.4订单状态查询接口 /// paycashier/account/queryOrderStatus.do /// </summary> public void OrderStatus() { StringBuilder sbData = new StringBuilder(); sbData.Clear(); sbData.Append("{'serviceCode':'").Append("031001002107061").Append("'"); //一级商户代码 sbData.Append(",'bigOrderNo':'").Append("2016062900000001").Append("'"); //总订单号 sbData.Append(",'bigReqNo':'").Append("2016062900000001").Append("'"); //总订单请求流水号 sbData.Append("}"); //获取验证签名 string sSign = Cmn.GetSign(sbData.ToString()); //拼接Form并Post数据 //返回数据 string returnPost = ""; if (!string.IsNullOrEmpty(returnPost)) { JsonData jdP = JsonMapper.ToObject(returnPost.Trim()); if (jdP.Count > 0) { JsonData jdData = jdP[0]; JsonData jdSign = jdP[1]; string rRespCode = Convert.ToString(jdData["respCode"]); //响应结果 string rRespMsg = Convert.ToString(jdData["respMsg"]); //响应描述 if (rRespCode == "0000") //成功 { bool isCheck = Cmn.ValitedSign(jdSign.ToString(), jdData.ToJson()); if (isCheck == true) { string RbigOrderDate = Convert.ToString(jdData["bigOrderDate"]); //总订单日期 YYYYMMDD string RbigOrderNo = Convert.ToString(jdData["bigOrderNo"]); //总订单号 string RbigReqNo = Convert.ToString(jdData["bigReqNo"]); //总订单请求流水号 string RorderStatus = Convert.ToString(jdData["orderStatus"]); //订单状态 A:请求 B:成功 C:失败 D:待支付 string RbigOrderAmt = Convert.ToString(jdData["bigOrderAmt"]); //总订单金额 单位:分 string RbigPayAmt = Convert.ToString(jdData["bigPayAmt"]); //总支付金额 单位:分 string RinnerTranSeq = Convert.ToString(jdData["innerTranSeq"]); //平台流水号 } } } } }