update 汇付支付 支付回调

This commit is contained in:
2023-05-30 13:45:56 +08:00
parent 328dbb98a0
commit 4d7495d363
3 changed files with 23 additions and 6 deletions

View File

@@ -1286,9 +1286,12 @@ public class OrderService {
return;
}
//验签成功 保存到回调记录表中
JSONObject jsonObject = JSON.parseObject(data);
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(data, AdapayCallbackRecord.class);
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
JSONObject descJson = JSON.parseObject(adapayCallbackRecord.getDescription());

View File

@@ -10,6 +10,7 @@ import com.huifu.adapay.model.Refund;
import com.jsowell.JsowellApplication;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.entity.SysDictData;
import com.jsowell.common.core.domain.ykc.LoginRequestData;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
import com.jsowell.common.core.redis.RedisCache;
@@ -169,12 +170,13 @@ public class SpringBootTestController {
@Test
public void testSaveCallback() throws JsonProcessingException {
String data = "{\"app_id\":\"app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa\",\"created_time\":\"20230527100758\",\"description\":\"{\\\"type\\\":\\\"balance\\\",\\\"memberId\\\":\\\"29336349\\\"}\",\"end_time\":\"20230527100810\",\"expend\":{\"bank_type\":\"OTHERS\",\"open_id\":\"o8jhot6PJF93EPhNISsXi28dKdS8\",\"sub_open_id\":\"o4REX5MprZfTaLnVNxfdOY-wnwGI\"},\"fee_amt\":\"0.00\",\"id\":\"002212023052710075810508353847861903360\",\"order_no\":\"4c457bd474334d5eaf82f4795265b6ad\",\"out_trans_id\":\"4200001864202305270647556621\",\"party_order_id\":\"02212305273647819807712\",\"pay_amt\":\"0.01\",\"pay_channel\":\"wx_lite\",\"real_amt\":\"0.01\",\"share_eq\":\"Y\",\"status\":\"succeeded\",\"wx_user_id\":\"\"}";
String data = "{\"app_id\":\"app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa\",\"created_time\":\"20230530132956\",\"description\":\"{\\\"orderCode\\\":\\\"C29505932783\\\",\\\"type\\\":\\\"order\\\"}\",\"end_time\":\"20230530133027\",\"expend\":{\"bank_type\":\"OTHERS\",\"open_id\":\"o8jhot6PJF93EPhNISsXi28dKdS8\",\"sub_open_id\":\"o4REX5MprZfTaLnVNxfdOY-wnwGI\"},\"fee_amt\":\"0.11\",\"id\":\"002212023053013295610509491838664794112\",\"order_no\":\"C29505932783\",\"out_trans_id\":\"4200001855202305308670391485\",\"party_order_id\":\"02212305304859640306711\",\"pay_amt\":\"20.00\",\"pay_channel\":\"wx_lite\",\"real_amt\":\"20.00\",\"share_eq\":\"Y\",\"status\":\"succeeded\",\"wx_user_id\":\"\"}";
JSONObject jsonObject = JSON.parseObject(data);
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
}
@@ -678,11 +680,19 @@ public class SpringBootTestController {
@Test
public void testDict() {
String dictValue = DictUtils.getDictValue("query_pile_info", "url");
String station_type = DictUtils.getDictLabel("station_type", "1");
System.out.println(station_type);
System.out.println("123");
// String dictValue = DictUtils.getDictValue("query_pile_info", "url");
// String station_type = DictUtils.getDictLabel("station_type", "1");
// System.out.println(station_type);
// System.out.println("123");
List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
List<String> stationIdList = com.google.common.collect.Lists.newArrayList();
if (CollectionUtils.isNotEmpty(adapay_station)) {
for (SysDictData sysDictData : adapay_station) {
stationIdList.add(sysDictData.getDictValue());
}
}
System.out.println(stationIdList);
}
@Test

View File

@@ -22,6 +22,7 @@ public class AdapayCallbackRecord implements Serializable {
/**
* 主键id
*/
@JsonIgnore
private Integer id;
/**
@@ -39,6 +40,9 @@ public class AdapayCallbackRecord implements Serializable {
*/
private String payScenario;
/**
* 支付对象id
*/
private String paymentId;
/**