Compare commits
2 Commits
ae3af80e9c
...
bd00a6125e
Author | SHA1 | Date |
---|---|---|
|
bd00a6125e | |
|
c8672c15ea |
|
@ -23,6 +23,7 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -35,7 +36,7 @@ import java.math.BigDecimal;
|
||||||
* 微信支付小程序 接口
|
* 微信支付小程序 接口
|
||||||
*/
|
*/
|
||||||
@Api(tags = "小程序支付")
|
@Api(tags = "小程序支付")
|
||||||
@Controller
|
@RestController
|
||||||
@RequestMapping("/applet/pay")
|
@RequestMapping("/applet/pay")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AppletPayController {
|
public class AppletPayController {
|
||||||
|
@ -51,6 +52,7 @@ public class AppletPayController {
|
||||||
@PostMapping("/prepay")
|
@PostMapping("/prepay")
|
||||||
public BaseResponse createPrepay(@RequestBody AppletPayVo payDto){
|
public BaseResponse createPrepay(@RequestBody AppletPayVo payDto){
|
||||||
// 构建service
|
// 构建service
|
||||||
|
log.info("payDto===================>{}",payDto);
|
||||||
JsapiServiceExtension service = createService();
|
JsapiServiceExtension service = createService();
|
||||||
OrderPayInfo orderPayInfo = orderPayInfoService.createOrderPayInfo(payDto.getMoney(),payDto.getUserId(), payDto.getDescription(), payDto.getOutTradeNo(), "applet");
|
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);
|
PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request);
|
||||||
// 使用微信扫描 code_url 对应的二维码,即可体验Native支付
|
// 使用微信扫描 code_url 对应的二维码,即可体验Native支付
|
||||||
// log.info(response);
|
log.info("response=================>{}",response);
|
||||||
|
// return BaseResponse.success();
|
||||||
return BaseResponse.success(response);
|
return BaseResponse.success(response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -34,7 +35,7 @@ import java.util.Objects;
|
||||||
* 微信支付小程序 接口
|
* 微信支付小程序 接口
|
||||||
*/
|
*/
|
||||||
@Api(tags = "H5支付")
|
@Api(tags = "H5支付")
|
||||||
@Controller
|
@RestController
|
||||||
@RequestMapping("/H5/pay")
|
@RequestMapping("/H5/pay")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class H5PayController {
|
public class H5PayController {
|
||||||
|
|
|
@ -70,8 +70,8 @@ wechatpay:
|
||||||
mchId: 1650477646
|
mchId: 1650477646
|
||||||
apiV3Key: JingWuLianJiaKao20120813ZhouHong
|
apiV3Key: JingWuLianJiaKao20120813ZhouHong
|
||||||
mchSerialNo: 52974C99DFCC518EA2E5AD20C3753E38B924868D
|
mchSerialNo: 52974C99DFCC518EA2E5AD20C3753E38B924868D
|
||||||
# privateKeyPath: classpath*:/wechatPay/apiclient_key.pem
|
# 路径设置没生效 不知道原因
|
||||||
privateKeyPath: apiclient_key.pem
|
privateKeyPath: classpath*:/wechatPay/apiclient_key.pem
|
||||||
payNoticeUrl: https://jwl.ahduima.com/driver-api/payNoticeLog
|
payNoticeUrl: https://jwl.ahduima.com/driver-api/payNoticeLog
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue