mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
汇付退款逻辑
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@@ -145,6 +146,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISettleOrderReportService settleOrderReportService;
|
private ISettleOrderReportService settleOrderReportService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AdapayMemberInfoService adapayMemberInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 条件查询订单基本信息
|
* 条件查询订单基本信息
|
||||||
*
|
*
|
||||||
@@ -1838,9 +1842,28 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
// 创建汇付退款对象 在完成初始化设置情况下,调用方法,获取 Refund对象
|
// 创建汇付退款对象 在完成初始化设置情况下,调用方法,获取 Refund对象
|
||||||
String id = record.getPaymentId();
|
String id = record.getPaymentId();
|
||||||
Map<String, Object> refundParams = Maps.newHashMap();
|
Map<String, Object> refundParams = Maps.newHashMap();
|
||||||
refundParams.put("refund_amt", AdapayUtil.formatAmount(dto.getRefundAmount()));
|
String amount = AdapayUtil.formatAmount(dto.getRefundAmount());
|
||||||
|
refundParams.put("refund_amt", amount);
|
||||||
refundParams.put("refund_order_no", SnowflakeIdWorker.getSnowflakeId());
|
refundParams.put("refund_order_no", SnowflakeIdWorker.getSnowflakeId());
|
||||||
refundParams.put("notify_url", ADAPAY_REFUND_CALLBACK_URL);
|
refundParams.put("notify_url", ADAPAY_REFUND_CALLBACK_URL);
|
||||||
|
|
||||||
|
// 分账对象信息
|
||||||
|
OrderBasicInfo orderBasicInfo = getOrderInfoByOrderCode(dto.getOrderCode());
|
||||||
|
if (orderBasicInfo != null) {
|
||||||
|
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByStationId(orderBasicInfo.getStationId());
|
||||||
|
if (adapayMemberInfo != null) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("member_id", adapayMemberInfo.getMemberId());
|
||||||
|
jsonObject.put("amount", amount);
|
||||||
|
jsonObject.put("fee_flag", Constants.Y);
|
||||||
|
|
||||||
|
// 分账对象信息列表,最多仅支持7个分账方,json 数组形式
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(jsonObject);
|
||||||
|
// 分账对象信息
|
||||||
|
refundParams.put("div_members", jsonArray.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Map<String, Object> response = Refund.create(id, refundParams);
|
Map<String, Object> response = Refund.create(id, refundParams);
|
||||||
logger.info("汇付支付创建退款对象:{}", JSON.toJSONString(response));
|
logger.info("汇付支付创建退款对象:{}", JSON.toJSONString(response));
|
||||||
|
|||||||
Reference in New Issue
Block a user