支付相关

This commit is contained in:
13405411873 2024-09-25 20:22:11 +08:00
parent 5c73d31551
commit 763c6ce174
4 changed files with 13 additions and 13 deletions

View File

@ -61,7 +61,7 @@ public class WechatPayConfig {
/** /**
* 汽修通知回调地址 * 汽修通知回调地址
*/ */
private String repairNotifyUrl="https://www.nuoyunr.com/admin-api/repairPayApi/payNotify"; private String repairNotifyUrl="https://www.nuoyunr.com/userClient/pay/payNotify";
/** /**
* API 证书中的 key.pem * API 证书中的 key.pem
*/ */

View File

@ -41,7 +41,9 @@ public class RepairPayApi {
} }
private final ReentrantLock lock = new ReentrantLock(); private final ReentrantLock lock = new ReentrantLock();
@PostMapping("/payNotify") @PostMapping("/payNotify")
@TenantIgnore
public Map<String, String> payNotify(@RequestBody JSONObject jsonObject) { public Map<String, String> payNotify(@RequestBody JSONObject jsonObject) {
System.out.println("进入支付回调"+jsonObject.toString());
try { try {
String key = wechatPayConfig.getApiV3Key(); String key = wechatPayConfig.getApiV3Key();
String json = jsonObject.toString(); String json = jsonObject.toString();
@ -51,6 +53,7 @@ public class RepairPayApi {
String decryptData = new AesUtil(key.getBytes(StandardCharsets.UTF_8)).decryptToString(associated_data.getBytes(StandardCharsets.UTF_8), nonce.getBytes(StandardCharsets.UTF_8), ciphertext); String decryptData = new AesUtil(key.getBytes(StandardCharsets.UTF_8)).decryptToString(associated_data.getBytes(StandardCharsets.UTF_8), nonce.getBytes(StandardCharsets.UTF_8), ciphertext);
//验签成功 //验签成功
JSONObject decryptDataObj = JSONObject.parseObject(decryptData, JSONObject.class); JSONObject decryptDataObj = JSONObject.parseObject(decryptData, JSONObject.class);
System.out.println("进入支付回调"+decryptDataObj.toString());
if(lock.tryLock()) { if(lock.tryLock()) {
try { try {
String orderNo = decryptDataObj.get("out_trade_no").toString(); String orderNo = decryptDataObj.get("out_trade_no").toString();
@ -62,8 +65,8 @@ public class RepairPayApi {
lock.unlock(); lock.unlock();
} }
} }
}catch (Exception ignored){ }catch (Exception e){
System.out.println("支付回调失败"+e.getMessage());
} }
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();

View File

@ -185,10 +185,10 @@ debug: false
--- #################### 微信公众号、小程序相关配置 #################### --- #################### 微信公众号、小程序相关配置 ####################
wx: wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b # 测试号(牛希尧提供的) # app-id: wx8653afe16dffec37 # 蓝安
# secret: 5abee519483bc9f8cb37ce280e814bd0 # secret: ab94673dd0cca78abd0a453d0aac9f98
app-id: wx5b23ba7a5589ecbb # 测试号(自己的) app-id: wxb1f71e5e0c5f9ee7 # 点亮
secret: 2a7b3b20c537e52e74afd395eb85f61f secret: 2e9864a6b224feb6fba4ab73b70212cd
# app-id: wxa69ab825b163be19 # 测试号Kongdy 提供的) # app-id: wxa69ab825b163be19 # 测试号Kongdy 提供的)
# secret: bd4f9fab889591b62aeac0d7b8d8b4a0 # secret: bd4f9fab889591b62aeac0d7b8d8b4a0
# 存储配置,解决 AccessToken 的跨节点的共享 # 存储配置,解决 AccessToken 的跨节点的共享
@ -197,12 +197,8 @@ wx:
key-prefix: wx # Redis Key 的前缀 key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
# appid: wx62056c0d5e8db250 # 测试号(牛希尧提供的) appid: wxb1f71e5e0c5f9ee7 # wenhualian的接口测试号
# secret: 333ae72f41552af1e998fe1f54e1584a secret: 2e9864a6b224feb6fba4ab73b70212cd
appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
secret: 6f270509224a7ae1296bbf1c8cb97aed
# appid: wxc4598c446f8a9cb3 # 测试号Kongdy 提供的)
# secret: 4a1a04e07f6a4a0751b39c3064a92c8b
config-storage: config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取 type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀 key-prefix: wa # Redis Key 的前缀

View File

@ -284,6 +284,7 @@ yudao:
- /admin-api/system/dict-data/type - /admin-api/system/dict-data/type
- /userClient/pay/** - /userClient/pay/**
- /userClient/weChat/** - /userClient/weChat/**
- /userClient/**
ignore-tables: ignore-tables:
- system_tenant - system_tenant
- system_tenant_package - system_tenant_package