mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-07 11:29:58 +08:00
update
This commit is contained in:
@@ -231,4 +231,7 @@ public class Constants {
|
|||||||
|
|
||||||
// 汇付企业用户前缀
|
// 汇付企业用户前缀
|
||||||
public static final String ADAPAY_CORP_MEMBER_PREFIX = "ACM";
|
public static final String ADAPAY_CORP_MEMBER_PREFIX = "ACM";
|
||||||
|
|
||||||
|
// 汇付延时分账支付模式
|
||||||
|
public static final String ADAPAY_PAY_MODE_DELAY = "delay";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2296,6 +2296,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
|
|
||||||
// 封装对象
|
// 封装对象
|
||||||
String amount = AdapayUtil.formatAmount(dto.getPayAmount()); // 用户支付金额
|
String amount = AdapayUtil.formatAmount(dto.getPayAmount()); // 用户支付金额
|
||||||
|
String payMode = Constants.ADAPAY_PAY_MODE_DELAY; // 汇付延时分账
|
||||||
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
|
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
|
||||||
createAdaPaymentParam.setOrder_no(orderInfo.getOrderCode());
|
createAdaPaymentParam.setOrder_no(orderInfo.getOrderCode());
|
||||||
createAdaPaymentParam.setPay_amt(amount);
|
createAdaPaymentParam.setPay_amt(amount);
|
||||||
@@ -2306,38 +2307,26 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
Map<String, String> map = Maps.newHashMap();
|
Map<String, String> map = Maps.newHashMap();
|
||||||
map.put("type", ScenarioEnum.ORDER.getValue());
|
map.put("type", ScenarioEnum.ORDER.getValue());
|
||||||
map.put("orderCode", dto.getOrderCode());
|
map.put("orderCode", dto.getOrderCode());
|
||||||
|
map.put("payMode", payMode);
|
||||||
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
|
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
|
||||||
// 异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
// 异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||||
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
||||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString(ImmutableMap.of("open_id", openId)));
|
createAdaPaymentParam.setExpend(JSONObject.toJSONString(ImmutableMap.of("open_id", openId)));
|
||||||
|
|
||||||
// 分账对象信息
|
|
||||||
// String adapayMemberId = adapayMemberAccountService.selectAdapayMemberIdByStationId(orderInfo.getStationId());
|
|
||||||
// if (StringUtils.isNotBlank(adapayMemberId)) {
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
|
||||||
// jsonObject.put("member_id", adapayMemberId);
|
|
||||||
// jsonObject.put("amount", amount);
|
|
||||||
// jsonObject.put("fee_flag", Constants.Y);
|
|
||||||
//
|
|
||||||
// // 分账对象信息列表,最多仅支持7个分账方,json 数组形式
|
|
||||||
// JSONArray jsonArray = new JSONArray();
|
|
||||||
// jsonArray.add(jsonObject);
|
|
||||||
// createAdaPaymentParam.setDiv_members(jsonArray.toString());
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 延时分账
|
// 延时分账
|
||||||
createAdaPaymentParam.setPay_mode("delay");
|
createAdaPaymentParam.setPay_mode(payMode);
|
||||||
try {
|
try {
|
||||||
logger.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
|
logger.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
|
||||||
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam));
|
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam));
|
||||||
if (response != null && !response.isEmpty()) {
|
if (response != null && !response.isEmpty()) {
|
||||||
JSONObject expend = JSONObject.parseObject(response.get("expend").toString());
|
JSONObject expend = JSONObject.parseObject(response.get("expend").toString());
|
||||||
JSONObject pay_info = expend.getJSONObject("pay_info");
|
JSONObject pay_info = expend.getJSONObject("pay_info");
|
||||||
Map<String, Object> resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference<Map<String, Object>>() {
|
Map<String, Object> resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference<Map<String, Object>>() {});
|
||||||
});
|
|
||||||
if (resultMap != null) {
|
if (resultMap != null) {
|
||||||
// 表示已经获取到支付参数了,后续再有支付请求就拒绝
|
// 表示已经获取到支付参数了,后续再有支付请求就拒绝
|
||||||
redisCache.setCacheObject(redisKey, resultMap, 15, TimeUnit.MINUTES);
|
redisCache.setCacheObject(redisKey, resultMap, 15, TimeUnit.MINUTES);
|
||||||
|
|
||||||
|
// 设置订单号的
|
||||||
}
|
}
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user