mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
update 汇付支付 支付回调
This commit is contained in:
@@ -2,8 +2,6 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.huifu.adapay.model.Refund;
|
import com.huifu.adapay.model.Refund;
|
||||||
@@ -38,7 +36,6 @@ import com.jsowell.service.MemberService;
|
|||||||
import com.jsowell.service.OrderService;
|
import com.jsowell.service.OrderService;
|
||||||
import com.jsowell.service.PileRemoteService;
|
import com.jsowell.service.PileRemoteService;
|
||||||
import com.jsowell.service.PileService;
|
import com.jsowell.service.PileService;
|
||||||
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
|
||||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||||
@@ -141,6 +138,9 @@ public class SpringBootTestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LianLianService lianLianService;
|
private LianLianService lianLianService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMemberTransactionRecordService memberTransactionRecordService;
|
||||||
|
|
||||||
static final String MAC_KEY = "53TtFpc4gdVZbF3x";
|
static final String MAC_KEY = "53TtFpc4gdVZbF3x";
|
||||||
|
|
||||||
static final String ALGORITHM_MAC = "HmacMD5";
|
static final String ALGORITHM_MAC = "HmacMD5";
|
||||||
@@ -172,14 +172,18 @@ public class SpringBootTestController {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSaveCallback() throws JsonProcessingException {
|
public void testSaveCallback() throws JsonProcessingException {
|
||||||
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\":\"\"}";
|
// 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);
|
// JSONObject jsonObject = JSON.parseObject(data);
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
// ObjectMapper mapper = new ObjectMapper();
|
||||||
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
// mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||||||
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
|
// AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
|
||||||
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
|
// adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
|
||||||
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
|
// adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
|
||||||
adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
|
// adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
|
||||||
|
|
||||||
|
|
||||||
|
MemberTransactionRecord transactionRecord = memberTransactionRecordService.selectByOrderCode("C21905989509");
|
||||||
|
System.out.println(JSON.toJSONString(transactionRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
where member_id = #{memberId,jdbcType=VARCHAR}
|
where member_id = #{memberId,jdbcType=VARCHAR}
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByOrderCode" resultType="com.jsowell.pile.domain.MemberTransactionRecord">
|
<select id="selectByOrderCode" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="Base_Column_List"/>
|
<include refid="Base_Column_List"/>
|
||||||
FROM `member_transaction_record`
|
FROM `member_transaction_record`
|
||||||
|
|||||||
Reference in New Issue
Block a user