This commit is contained in:
2023-07-10 15:14:58 +08:00
parent 82de8f7cde
commit b9cc771184

View File

@@ -3,6 +3,7 @@ package com.jsowell.service;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.github.pagehelper.PageHelper;
@@ -1311,6 +1312,9 @@ public class OrderService {
String data = request.getParameter("data");
//验签请参sign
String sign = request.getParameter("sign");
// type
String type = request.getParameter("type");
//验签请参publicKey
String publicKey = AdapayCore.PUBLIC_KEY;
log.info("汇付支付回调验签请参data={}, sign={}", data, sign);
@@ -1320,6 +1324,14 @@ public class OrderService {
log.info("汇付支付回调验签失败:{}", data);
return;
}
if (StringUtils.equals("payment.succeeded", type)) {
paymentSucceeded(data);
}
}
private void paymentSucceeded(String data) throws JsonProcessingException {
//验签成功 保存到回调记录表中
JSONObject jsonObject = JSON.parseObject(data);
ObjectMapper mapper = new ObjectMapper();