已解决 7-6 报错:无法在浏览器打开页面 http://localhost:8080/pay/create
来源:7-6 支付-避免重复支付的正确姿势

zhaoyubao
2021-03-03
There was an unexpected error (type=Internal Server Error, status=500).
???, returnCode != SUCCESS, returnMsg = ???
java.lang.RuntimeException: ???, returnCode != SUCCESS, returnMsg = ???
at com.lly835.bestpay.service.impl.WxPayServiceImpl.pay(WxPayServiceImpl.java:100)
at com.lly835.bestpay.service.impl.BestPayServiceImpl.pay(BestPayServiceImpl.java:39)
at com.emilie.pay.service.impl.PayService.create(PayService.java:44)
at com.emilie.pay.controller.PayController.create(PayController.java:26)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
5回答
-
zhaoyubao
提问者
2021-03-03
request.setOrderId("5433456789123453");
问题解决了, 之前用了视频中的那段数字, 加空的order name, 刚才做了更新, 可以了, 谢谢!
00 -
zhaoyubao
提问者
2021-03-03
ERROR 238228 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: 【微信统一支付】发起支付, returnCode != SUCCESS, returnMsg = 缺少参数] with root cause java.lang.RuntimeException: 【微信统一支付】发起支付, returnCode != SUCCESS, returnMsg = 缺少参数 at com.lly835.bestpay.service.impl.WxPayServiceImpl.pay(WxPayServiceImpl.java:100) ~[best-pay-sdk-1.3.0.jar:na] at com.lly835.bestpay.service.impl.BestPayServiceImpl.pay(BestPayServiceImpl.java:39) ~[best-pay-sdk-1.3.0.jar:na] at com.emilie.pay.service.impl.PayService.create(PayService.java:44) ~[classes/:na] at com.emilie.pay.controller.PayController.create(PayController.java:26) ~[classes/:na]
00 -
zhaoyubao
提问者
2021-03-03
第一次使用那个域名的时候可以显示一个二维码, 换成weixin那个字符串以后, 可以将字符串传过去, 但是看不到二维码。 然后到这一步的时候, 报错。
00 -
zhaoyubao
提问者
2021-03-03
@Slf4j
@Service
public class PayService implements IPayService{
@Override
public PayResponse create(String orderId, BigDecimal amount) {
WxPayConfig wxPayConfig = new WxPayConfig();
wxPayConfig.setAppId("wxd898fcb01713c658");
wxPayConfig.setMchId("1483469312");
wxPayConfig.setMchKey("7mdApPMfXddfWWbbP4DUaVYm2wjyh3v3");
wxPayConfig.setNotifyUrl("http://127.0.0.1");
BestPayServiceImpl bestPayService = new BestPayServiceImpl();
bestPayService.setWxPayConfig(wxPayConfig);
PayRequest request = new PayRequest();
request.setOrderName("");
request.setOrderId("123456789123456");
request.setOrderAmount(0.01);
request.setPayTypeEnum(BestPayTypeEnum.WXPAY_NATIVE);
PayResponse response = bestPayService.pay(request);
return response;
}
}
00 -
zhaoyubao
提问者
2021-03-03
@Controller
@RequestMapping("/pay")
public class PayController {
@Autowired
private PayService payService;
@GetMapping("/create")
public ModelAndView create() {
PayResponse response = payService.create("123456789123456", BigDecimal.valueOf(0.01));
Map map = new HashMap<>();
map.put("codeUrl", response.getCodeUrl());
return new ModelAndView("create", map);
}
}
00
相似问题