Skip to content

Commit

Permalink
* bugfix: correct params order in RefundQuery
Browse files Browse the repository at this point in the history
* bugfix: correct params order in RefundQuery
+ demog-refund-query.jsp
* disabled debugging output for development
  • Loading branch information
cuter44 committed May 30, 2015
1 parent b9811b7 commit e3cff93
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/com/github/cuter44/wxmp/util/CertificateLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public CertificateLoader loadIdentification(String resourcePath, String passphra
}
catch (Exception ex)
{
ex.printStackTrace();
//ex.printStackTrace();
throw(new RuntimeException(ex));
}

Expand Down
6 changes: 3 additions & 3 deletions src/com/github/cuter44/wxpay/reqs/RefundQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public class RefundQuery extends WxpayRequestBase {
"device_info",
"mch_id",
"nonce_str",
"out_trade_no",
"out_refund_no",
"out_trade_no",
"refund_id",
"transaction_id",
"sign"
"sign",
"transaction_id"
);

// CONSTRUCT
Expand Down
61 changes: 61 additions & 0 deletions web/demo-refund-query.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<%@ page language="java" pageEncoding="UTF-8"
import="
java.util.Properties,
com.github.cuter44.wxpay.*,
com.github.cuter44.wxpay.reqs.*,
com.github.cuter44.wxpay.resps.*
"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
<h1>微信退款查询样例</h1>

↓ 输入单号可以查看退款记录, 单号可以在微信客户端的 我↘ > 钱包 > ┇↗ > 交易消息 > (其中的某一条) > 支付信息 > 商户单号 找到.
<br />
当然, 只能查到对应此公众号的交易信息.

<p />

<form id="form" enctype="application/x-www-form-urlencoded">
<table>
<tr><td>out_trade_no</td><td><input name="outTradeNo"/></td></tr>
<tr><td></td><td><input type="submit"></td></tr>
</table>
</form>

<p />

<dl>

<%
String outTradeNo = request.getParameter("outTradeNo");
if (outTradeNo != null)
{
WxpayFactory factory = WxpayFactory.getDefaultInstance();
RefundQuery wxreq = new RefundQuery(factory.getConf());
wxreq.setOutTradeNo(outTradeNo);
RefundQueryResponse wxresp = wxreq.build().sign().execute();
Properties prop = wxresp.getProperties();
System.out.println(prop);
for (Object k:prop.keySet())
{
%>
<dt><%=k%>
<dd><%=prop.get(k)%>
<%
}
}
%>

</dl>

</body>
</html>

0 comments on commit e3cff93

Please sign in to comment.