添加设备商城支付

This commit is contained in:
韩鹏辉
2023-09-12 15:17:50 +08:00
parent b7e17826ac
commit 9bed9bee68
5 changed files with 17 additions and 10 deletions

View File

@@ -190,7 +190,7 @@ public class AliPayController {
@PostMapping("/orderPay")
@ResponseBody
public Result<Object> orderPay(String authCode,String orderNumber) {
public Result<Object> orderPay(String authCode,String orderNumber,String appId) {
if(StringUtil.isEmpty(authCode)){
return ResultGenerator.genFailResult("授权码信息为空");
}
@@ -198,7 +198,7 @@ public class AliPayController {
return ResultGenerator.genFailResult("订单号为空");
}
AlipaySystemOauthTokenResponse tokenResponse = AliUtil.getAliUserIdV2(authCode, ParametersUtil.ZY_PRI, ParametersUtil.ZY_PUB, ParametersUtil.ZY_ALI_APP_ID);
return apiPayService.orderPay(tokenResponse.getUserId(),orderNumber);
return apiPayService.orderPay(tokenResponse.getUserId(),orderNumber,appId);
}
public static void main(String[] args) {

View File

@@ -199,7 +199,8 @@ public class ApiPayController {
public Result<Object> orderPay(@RequestBody JSONObject params) {
String userId = params.getString("userId");
String orderNumber = params.getString("orderNumber");
return apiPayService.orderPay(userId,orderNumber);
return apiPayService.orderPay(userId,orderNumber,null);
}
public static void main(String[] args) {

View File

@@ -485,7 +485,8 @@ public class WechantController {
System.out.println("openid"+openid);
String orderNumber = params.getString("orderNumber");
System.out.println("orderNumber"+orderNumber);
return apiPayService.orderPay(openid,orderNumber);
String appId=params.containsKey("appId")?params.getString("appId"):null;
return apiPayService.orderPay(openid,orderNumber,appId);
}
@PostMapping("/getAddress")