Fix: 微信统一下单接口请求参数格式错误

This commit is contained in:
wangshirui
2020-10-28 18:52:33 +08:00
parent a1be9c0dfd
commit dea01ea020

View File

@@ -256,8 +256,10 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
LOG.debug("requestXML" + requestXML);
}
HttpStringEntity entity = new HttpStringEntity(requestXML, ClientHttpRequest.APPLICATION_XML_UTF_8);
//调起支付的参数列表
JSONObject result = requestTemplate.postForObject(getReqUrl(order.getTransactionType()), requestXML, JSONObject.class);
JSONObject result = requestTemplate.postForObject(getReqUrl(order.getTransactionType()), entity, JSONObject.class);
if (!SUCCESS.equals(result.get(RETURN_CODE)) || !SUCCESS.equals(result.get(RESULT_CODE))) {
throw new PayErrorException(new WxPayError(result.getString(RESULT_CODE), result.getString(RETURN_MSG_CODE), result.toJSONString()));