|
@@ -533,22 +533,41 @@ public class WeixinPayController extends Controller {
|
|
public void wap2() {
|
|
public void wap2() {
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
params.put("appid", appid);
|
|
params.put("appid", appid);
|
|
- params.put("mch_id", partner);
|
|
|
|
- params.put("body", "JFinal2.0极速开发");
|
|
|
|
- params.put("out_trade_no", "977773682111");
|
|
|
|
- params.put("total_fee", "1");
|
|
|
|
|
|
+ params.put("mch_id", partner_jx);
|
|
|
|
+ String body = this.getPara("body");
|
|
|
|
+ if (body == null) {
|
|
|
|
+ renderText("need body");
|
|
|
|
+ }
|
|
|
|
+ params.put("body", body);
|
|
|
|
+ String out_trade_no = this.getPara("out_trade_no");
|
|
|
|
+ if (out_trade_no == null) {
|
|
|
|
+ renderText("need out_trade_no");
|
|
|
|
+ }
|
|
|
|
+ params.put("out_trade_no", out_trade_no);
|
|
|
|
+ String total_fee = this.getPara("total_fee");
|
|
|
|
+ if (total_fee == null) {
|
|
|
|
+ renderText("need total_fee");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ params.put("total_fee", total_fee);
|
|
|
|
|
|
String ip = IpKit.getRealIp(getRequest());
|
|
String ip = IpKit.getRealIp(getRequest());
|
|
if (StrKit.isBlank(ip)) {
|
|
if (StrKit.isBlank(ip)) {
|
|
ip = "127.0.0.1";
|
|
ip = "127.0.0.1";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (ip.contains(",")) {
|
|
|
|
+ ip = ip.split(",")[0];
|
|
|
|
+ }
|
|
params.put("spbill_create_ip", ip);
|
|
params.put("spbill_create_ip", ip);
|
|
params.put("trade_type", TradeType.MWEB.name());
|
|
params.put("trade_type", TradeType.MWEB.name());
|
|
params.put("nonce_str", System.currentTimeMillis() / 1000 + "");
|
|
params.put("nonce_str", System.currentTimeMillis() / 1000 + "");
|
|
|
|
+ String notify_url = this.getPara("notify_url");
|
|
|
|
+ if (notify_url == null) {
|
|
|
|
+ renderText("need notify_url");
|
|
|
|
+ }
|
|
params.put("notify_url", notify_url);
|
|
params.put("notify_url", notify_url);
|
|
|
|
|
|
- String sign = PaymentKit.createSign(params, paternerKey);
|
|
|
|
|
|
+ String sign = PaymentKit.createSign(params, paternerKey_jx);
|
|
params.put("sign", sign);
|
|
params.put("sign", sign);
|
|
String xmlResult = PaymentApi.pushOrder(params);
|
|
String xmlResult = PaymentApi.pushOrder(params);
|
|
|
|
|
|
@@ -568,9 +587,10 @@ public class WeixinPayController extends Controller {
|
|
}
|
|
}
|
|
// 以下字段在return_code 和result_code都为SUCCESS的时候有返回
|
|
// 以下字段在return_code 和result_code都为SUCCESS的时候有返回
|
|
String url = result.get("mweb_url");
|
|
String url = result.get("mweb_url");
|
|
|
|
+ renderText(url);
|
|
|
|
|
|
// 微信那边的开发建议用a标签打开该链接
|
|
// 微信那边的开发建议用a标签打开该链接
|
|
- setAttr("url", url);
|
|
|
|
|
|
+// setAttr("url", url);
|
|
}
|
|
}
|
|
|
|
|
|
public String getParamByUrl(String url, String name) {
|
|
public String getParamByUrl(String url, String name) {
|