private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 // 商家的交易定单号 string p2_Order = Request.Form["p2_Order"]; try { // 查询订单 BuyQueryOrdDetailResult result = Buy.QueryOrdDetail(p2_Order); if (result.R1_Code == "1") { Response.Write("查询成功!"); Response.Write("<br>商户订单号:" + result.R6_Order); Response.Write("<br>商品名称:" + result.R5_Pid); Response.Write("<br>支付金额:" + result.R3_Amt); Response.Write("<br>订单状态:" + result.Rb_PayStatus); } else { Response.Write("<br>查询失败!" + result.R1_Code); } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { p1_MerId = "10000432521"; // 商家ID keyValue = "8UPp0KE8sq73zVP370vko7C39403rtK1YwX40Td6irH216036H27Eb12792t"; // 商家密钥 //Buy.NodeAuthorizationURL = @"https://www.yeepay.com/app-merchant-proxy/node"; // 设置请求地址 Buy.NodeAuthorizationURL = @"http://tech.yeepay.com:8080/robot/debug.action"; //test p2_Order = Request.Form["p2_Order"]; // 商家的交易定单号 try { BuyQueryOrdDetailResult result = Buy.QueryOrdDetail(p1_MerId, keyValue, p2_Order); // 查询订单 if (result.R1_Code == "1") { Response.Write("查询成功!"); Response.Write("<br>商户订单号:" + result.R6_Order); Response.Write("<br>商品名称:" + result.R5_Pid); Response.Write("<br>支付金额:" + result.R3_Amt); Response.Write("<br>订单状态:" + result.Rb_PayStatus); } else { Response.Write("<br>查询失败!" + result.R1_Code); } } catch (Exception ex) { Response.Write(ex.Message); } }
/// <summary> /// 查询订单明细 /// </summary> /// <param name="p1_MerId">商户编号</param> /// <param name="keyValue">商户密钥</param> /// <param name="p2_Order">商户订单号</param> /// <returns>BuyQueryOrdDetailResult</returns> public static BuyQueryOrdDetailResult QueryOrdDetail(string p2_Order) { string sbOld = ""; sbOld += "QueryOrdDetail"; sbOld += merchantId; sbOld += p2_Order; string hmac = Digest.HmacSign(sbOld, keyValue); logstr(p2_Order, sbOld, hmac); string para = ""; para += "?p0_Cmd=QueryOrdDetail"; para += "&p1_MerId=" + merchantId; //加入商家ID para += "&p2_Order=" + p2_Order; //加入购买订单号码 para += "&hmac=" + hmac; //加入校验码 string reqResult = HttpUtils.SendRequest(queryRefundReqURL, para); string r0_Cmd = FormatQueryString.GetQueryString("r0_Cmd", reqResult, '\n'); string r1_Code = FormatQueryString.GetQueryString("r1_Code", reqResult, '\n'); string r2_TrxId = FormatQueryString.GetQueryString("r2_TrxId", reqResult, '\n'); string r3_Amt = FormatQueryString.GetQueryString("r3_Amt", reqResult, '\n'); string r4_Cur = FormatQueryString.GetQueryString("r4_Cur", reqResult, '\n'); string r5_Pid = FormatQueryString.GetQueryString("r5_Pid", reqResult, '\n'); string r6_Order = FormatQueryString.GetQueryString("r6_Order", reqResult, '\n'); string r8_MP = FormatQueryString.GetQueryString("r8_MP", reqResult, '\n'); string rb_PayStatus = FormatQueryString.GetQueryString("rb_PayStatus", reqResult, '\n'); string rc_RefundCount = FormatQueryString.GetQueryString("rc_RefundCount", reqResult, '\n'); string rd_RefundAmt = FormatQueryString.GetQueryString("rd_RefundAmt", reqResult, '\n'); hmac = FormatQueryString.GetQueryString("hmac", reqResult, '\n'); //string hmac = FormatQueryString.GetQueryString("hmac", reqResult, '\n'); BuyQueryOrdDetailResult result = new BuyQueryOrdDetailResult(r0_Cmd, r1_Code, r2_TrxId, r3_Amt, r4_Cur, r5_Pid, r6_Order, r8_MP, rb_PayStatus, rc_RefundCount, rd_RefundAmt, hmac); return(result); }
/// <summary> /// ��ѯ������ϸ /// </summary> /// <param name="p1_MerId">�̻����</param> /// <param name="keyValue">�̻���Կ</param> /// <param name="p2_Order">�̻�������</param> /// <returns>BuyQueryOrdDetailResult</returns> public static BuyQueryOrdDetailResult QueryOrdDetail(string p2_Order) { string sbOld = ""; sbOld += "QueryOrdDetail"; sbOld += merchantId; sbOld += p2_Order; string hmac = Digest.HmacSign(sbOld, keyValue); logstr(p2_Order, sbOld, hmac); string para = ""; para += "?p0_Cmd=QueryOrdDetail"; para += "&p1_MerId=" + merchantId; //�����̼�ID para += "&p2_Order=" + p2_Order; //���빺������ para += "&hmac=" + hmac; //����У���� string reqResult = HttpUtils.SendRequest(queryRefundReqURL, para); string r0_Cmd = FormatQueryString.GetQueryString("r0_Cmd", reqResult, '\n'); string r1_Code = FormatQueryString.GetQueryString("r1_Code", reqResult, '\n'); string r2_TrxId = FormatQueryString.GetQueryString("r2_TrxId", reqResult, '\n'); string r3_Amt = FormatQueryString.GetQueryString("r3_Amt", reqResult, '\n'); string r4_Cur = FormatQueryString.GetQueryString("r4_Cur", reqResult, '\n'); string r5_Pid = FormatQueryString.GetQueryString("r5_Pid", reqResult, '\n'); string r6_Order = FormatQueryString.GetQueryString("r6_Order", reqResult, '\n'); string r8_MP = FormatQueryString.GetQueryString("r8_MP", reqResult, '\n'); string rb_PayStatus = FormatQueryString.GetQueryString("rb_PayStatus", reqResult, '\n'); string rc_RefundCount= FormatQueryString.GetQueryString("rc_RefundCount", reqResult, '\n'); string rd_RefundAmt = FormatQueryString.GetQueryString("rd_RefundAmt", reqResult, '\n'); hmac = FormatQueryString.GetQueryString("hmac", reqResult, '\n'); //string hmac = FormatQueryString.GetQueryString("hmac", reqResult, '\n'); BuyQueryOrdDetailResult result = new BuyQueryOrdDetailResult(r0_Cmd, r1_Code, r2_TrxId, r3_Amt, r4_Cur, r5_Pid, r6_Order, r8_MP, rb_PayStatus, rc_RefundCount, rd_RefundAmt, hmac); return result; }
protected void Page_Load(object sender, EventArgs e) { // 商家的交易定单号 string p2_Order = Request.Form["p2_Order"]; try { // 查询订单 BuyQueryOrdDetailResult result = Buy.QueryOrdDetail(p2_Order); if (result.ErrorMsg == "") { if (result.R1_Code == "1") { Response.Write("查询成功!"); Response.Write("<br>接口类型:" + result.R0_Cmd); Response.Write("<br>返回码:" + result.R1_Code); Response.Write("<br>交易流水号:" + result.R2_TrdId); Response.Write("<br>交易金额:" + result.R3_Amt); Response.Write("<br>交易币种:" + result.R4_Cur); Response.Write("<br>商品名称:" + result.R5_Pid); Response.Write("<br>商户订单号:" + result.R6_Order); Response.Write("<br>商户扩展信息:" + result.R8_MP); Response.Write("<br>支付状态:" + result.Rb_PayStatus); Response.Write("<br>已退款次数:" + result.Rc_RefundCount); Response.Write("<br>已退款金额:" + result.Rd_RefundAmt); Response.Write("<br>返回信息:" + result.ErrorMsg); } else { Response.Write("查询失败!"); Response.Write("<br>接口类型:" + result.R0_Cmd); Response.Write("<br>返回码:" + result.R1_Code); Response.Write("<br>交易流水号:" + result.R2_TrdId); Response.Write("<br>交易金额:" + result.R3_Amt); Response.Write("<br>交易币种:" + result.R4_Cur); Response.Write("<br>商品名称:" + result.R5_Pid); Response.Write("<br>商户订单号:" + result.R6_Order); Response.Write("<br>商户扩展信息:" + result.R8_MP); Response.Write("<br>支付状态:" + result.Rb_PayStatus); Response.Write("<br>已退款次数:" + result.Rc_RefundCount); Response.Write("<br>已退款金额:" + result.Rd_RefundAmt); Response.Write("<br>返回信息:" + result.ErrorMsg); Response.Write("<br>返回信息:" + result.ErrorMsg); } } else { Response.Write("查询返回" + result.ErrorMsg); } } catch (Exception ex) { Response.Write(ex.Message); } }