【微信统一支付】发起支付, returnCode != SUCCESS, returnMsg = 受理机构必须传入sub_mch_id

来源:8-2 发起微信支付-后端(下)

慕仔3052074

2018-08-28

2018-08-28 16:29:58,853 - HHH000412: Hibernate Core {5.2.17.Final}
2018-08-28 16:29:58,855 - HHH000206: hibernate.properties not found
2018-08-28 16:29:58,892 - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-08-28 16:29:59,022 - HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2018-08-28 16:29:59,712 - Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-08-28 16:30:01,051 - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-28 16:30:01,351 - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@4ddbbdf8: startup date [Tue Aug 28 16:29:57 CST 2018]; root of context hierarchy
2018-08-28 16:30:01,397 - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2018-08-28 16:30:01,436 - Mapped "{[/buyer/order/create],methods=[POST]}" onto public com.imooc.VO.ResultVO<java.util.Map<java.lang.String, java.lang.String>> com.imooc.controller.BuyerOrderController.create(com.imooc.from.OrderForm,org.springframework.validation.BindingResult)
2018-08-28 16:30:01,437 - Mapped "{[/buyer/order/list],methods=[GET]}" onto public com.imooc.VO.ResultVO<java.util.List<com.imooc.dto.OrderDTO>> com.imooc.controller.BuyerOrderController.list(java.lang.String,java.lang.Integer,java.lang.Integer)
2018-08-28 16:30:01,438 - Mapped "{[/buyer/product/list],methods=[GET]}" onto public com.imooc.VO.ResultVO com.imooc.controller.BuyerProductController.list()
2018-08-28 16:30:01,439 - Mapped "{[/pay/create],methods=[GET]}" onto public void com.imooc.controller.PagController.create(java.lang.String,java.lang.String)
2018-08-28 16:30:01,440 - Mapped "{[/wechat/userInfo],methods=[GET]}" onto public java.lang.String com.imooc.controller.WechatController.userInfo(java.lang.String,java.lang.String)
2018-08-28 16:30:01,441 - Mapped "{[/wechat/authorize],methods=[GET]}" onto public java.lang.String com.imooc.controller.WechatController.authorize(java.lang.String)
2018-08-28 16:30:01,442 - Mapped "{[/weixin/auth],methods=[GET]}" onto public void com.imooc.controller.WeixinController.auto(java.lang.String)
2018-08-28 16:30:01,445 - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-08-28 16:30:01,446 - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-08-28 16:30:01,478 - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-28 16:30:01,478 - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-28 16:30:01,842 - Started PayServiceImplTest in 5.539 seconds (JVM running for 6.637)
Hibernate: select ordermaste0_.order_id as order_id1_1_0_, ordermaste0_.buyer_address as buyer_ad2_1_0_, ordermaste0_.buyer_name as buyer_na3_1_0_, ordermaste0_.buyer_openid as buyer_op4_1_0_, ordermaste0_.buyer_phone as buyer_ph5_1_0_, ordermaste0_.create_time as create_t6_1_0_, ordermaste0_.order_amount as order_am7_1_0_, ordermaste0_.order_status as order_st8_1_0_, ordermaste0_.pay_status as pay_stat9_1_0_, ordermaste0_.update_time as update_10_1_0_ from order_master ordermaste0_ where ordermaste0_.order_id=?
2018-08-28 16:30:02,039 - HHH000397: Using ASTQueryTranslatorFactory
Hibernate: select orderdetai0_.detail_id as detail_i1_0_, orderdetai0_.order_id as order_id2_0_, orderdetai0_.product_icon as product_3_0_, orderdetai0_.product_id as product_4_0_, orderdetai0_.product_name as product_5_0_, orderdetai0_.product_price as product_6_0_, orderdetai0_.product_quantity as product_7_0_ from order_detail orderdetai0_ where orderdetai0_.order_id=?
2018-08-28 16:30:02,597 - 【微信支付】request=PayRequest(payTypeEnum=WXPAY_H5, orderId=1535076380132408649, orderAmount=40.0, orderName=微信点餐订单, openid= ew3euwhd7sjw9diwkq)

java.lang.RuntimeException: 【微信统一支付】发起支付, returnCode != SUCCESS, returnMsg = 受理机构必须传入sub_mch_id

	at com.lly835.bestpay.service.impl.WxPayServiceImpl.pay(WxPayServiceImpl.java:83)
	at com.lly835.bestpay.service.impl.BestPayServiceImpl.pay(BestPayServiceImpl.java:31)
	at com.imooc.service.Impl.PayServiceImpl.create(PayServiceImpl.java:30)
	at com.imooc.service.Impl.PayServiceImplTest.create(PayServiceImplTest.java:26)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

2018-08-28 16:30:03,162 - Closing org.springframework.web.context.support.GenericWebApplicationContext@4ddbbdf8: startup date [Tue Aug 28 16:29:57 CST 2018]; root of context hierarchy
2018-08-28 16:30:03,168 - Closing JPA EntityManagerFactory for persistence unit 'default'
2018-08-28 16:30:03,169 - HikariPool-1 - Shutdown initiated...
2018-08-28 16:30:03,174 - HikariPool-1 - Shutdown completed.

Process finished with exit code -1


写回答

1回答

廖师兄

2018-08-28

你用的是服务商模式,请去参考微信支付文档里的服务商模式,如果best-pay-sdk不支持,那就得你自己修改下sdk的代码了。

0
2
廖师兄
回复
慕仔3052074
没有哦,建议去微信官方支付的文档,看接口参数变化
2018-08-29
共2条回复

Spring Boot双版本(1.5/2.1) 打造企业级微信点餐系统

从0到1开发中小型企业级Java应用,并学会迭代重构技巧

6410 学习 · 5247 问题

查看课程