|
@@ -15,6 +15,7 @@ import org.jdom.JDOMException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import weixin.popular.api.SnsAPI;
|
|
@@ -38,10 +39,10 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
|
|
|
|
|
|
private WxPayUtil wxPayUtil;
|
|
|
|
|
|
- @Value("server.domain")
|
|
|
+ @Value("${server.domain}")
|
|
|
private String serverUrl;
|
|
|
|
|
|
- @Value("payConfig.wx.notifyUrl")
|
|
|
+ @Value("${payConfig.wx.notifyUrl}")
|
|
|
private String notifyUrl;
|
|
|
|
|
|
private String filePath = "/tmp/wxpay/";
|
|
@@ -70,12 +71,10 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
|
|
|
|
|
|
switch (product.getPayDevice()) {
|
|
|
case 1:
|
|
|
-// return this.pc(product);
|
|
|
return this.mobile(product, "NATIVE");
|
|
|
case 2:
|
|
|
case 3:
|
|
|
return this.mobile(product, "MWEB");
|
|
|
-// return this.pc(product);
|
|
|
case 4:
|
|
|
return this.mp(product);
|
|
|
default:
|
|
@@ -238,7 +237,7 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
|
|
|
totalFee = wxPayUtil.subZeroAndDot(this.totalFee);
|
|
|
packageParams.put("total_fee", totalFee);// 总金额
|
|
|
packageParams.put("spbill_create_ip", product.getSpbillCreateIp());// 发起人IP地址
|
|
|
- packageParams.put("notify_url", "https://localhost");// 回调地址 notifyUrl
|
|
|
+ packageParams.put("notify_url", notifyUrl);// 回调地址 notifyUrl
|
|
|
packageParams.put("trade_type", trade_type);// 交易类型
|
|
|
packageParams.put("attach", JSONObject.toJSONString(this.attach));
|
|
|
|