微信支付bug调整

dev
caolin 2023-08-24 12:51:27 +08:00
parent ae3af80e9c
commit c8672c15ea
2 changed files with 7 additions and 3 deletions

View File

@ -23,6 +23,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.FileInputStream;
@ -35,7 +36,7 @@ import java.math.BigDecimal;
*
*/
@Api(tags = "小程序支付")
@Controller
@RestController
@RequestMapping("/applet/pay")
@Slf4j
public class AppletPayController {
@ -51,6 +52,7 @@ public class AppletPayController {
@PostMapping("/prepay")
public BaseResponse createPrepay(@RequestBody AppletPayVo payDto){
// 构建service
log.info("payDto===================>{}",payDto);
JsapiServiceExtension service = createService();
OrderPayInfo orderPayInfo = orderPayInfoService.createOrderPayInfo(payDto.getMoney(),payDto.getUserId(), payDto.getDescription(), payDto.getOutTradeNo(), "applet");
@ -71,7 +73,8 @@ public class AppletPayController {
// 调用下单方法,得到应答
PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request);
// 使用微信扫描 code_url 对应的二维码即可体验Native支付
// log.info(response);
log.info("response=================>{}",response);
// return BaseResponse.success();
return BaseResponse.success(response);
}

View File

@ -22,6 +22,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
@ -34,7 +35,7 @@ import java.util.Objects;
*
*/
@Api(tags = "H5支付")
@Controller
@RestController
@RequestMapping("/H5/pay")
@Slf4j
public class H5PayController {