【代码修复】PAY:微信扫码支付 v2 版本,缺少 product_id 的报错

This commit is contained in:
YunaiV 2024-07-24 21:36:04 +08:00
parent 55e1bca3c0
commit e02b95f277

View File

@ -34,8 +34,8 @@ public class WxNativePayClient extends AbstractWxPayClient {
@Override
protected PayOrderRespDTO doUnifiedOrderV2(PayOrderUnifiedReqDTO reqDTO) throws WxPayException {
// 构建 WxPayUnifiedOrderRequest 对象
WxPayUnifiedOrderRequest request = buildPayUnifiedOrderRequestV2(reqDTO);
// .setProductId(reqDTO.getOutTradeNo()); // V2 必须传递 productId无需在微信配置该参数在 V3 简化无需传递
WxPayUnifiedOrderRequest request = buildPayUnifiedOrderRequestV2(reqDTO)
.setProductId(reqDTO.getOutTradeNo()); // V2 必须传递 productId无需在微信配置该参数在 V3 简化无需传递
// 执行请求
WxPayNativeOrderResult response = client.createOrder(request);