|
@@ -359,21 +359,22 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
|
|
|
|
@Override
|
|
|
public String paymentCallBack(String notifyData) {
|
|
|
- initData();
|
|
|
- String xmlBack = "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[报文为空]]></return_msg></xml> ";
|
|
|
- WxSmallConfig config = new WxSmallConfig(appid, mchid, key);
|
|
|
- try {
|
|
|
- WXPay wxpay = new WXPay(config);
|
|
|
|
|
|
- Map<String, String> notifyMap = WXPayUtil.xmlToMap(notifyData); // 转换成map
|
|
|
|
|
|
+ try {
|
|
|
+ Map<String, String> notifyMap = WXPayUtil.xmlToMap(notifyData); // 转换成map
|
|
|
+ String TenantId = notifyMap.get("attach");
|
|
|
+ ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", TenantId);
|
|
|
+ initData();
|
|
|
+ String xmlBack = "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[报文为空]]></return_msg></xml> ";
|
|
|
+ WxSmallConfig config = new WxSmallConfig(appid, mchid, key);
|
|
|
+ WXPay wxpay = new WXPay(config);
|
|
|
if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {
|
|
|
String result_code = notifyMap.get("result_code");
|
|
|
if ("SUCCESS".equals(result_code)) {
|
|
|
String out_trade_no = notifyMap.get("out_trade_no");
|
|
|
String transaction_id = notifyMap.get("transaction_id");
|
|
|
- String TenantId = notifyMap.get("attach");
|
|
|
- ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", TenantId);
|
|
|
+
|
|
|
|
|
|
OrderPay orderPay = iOrderPayService.getOne(new LambdaQueryWrapper<OrderPay>().eq(OrderPay::getPaySn, out_trade_no));
|
|
|
if (Validator.isNotEmpty(orderPay)) {
|