mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update
This commit is contained in:
@@ -13,7 +13,6 @@ import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||||
import com.jsowell.adapay.dto.*;
|
||||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||||
import com.jsowell.adapay.operation.PaymentConfirmOperation;
|
||||
import com.jsowell.adapay.operation.PaymentReverseOperation;
|
||||
import com.jsowell.adapay.response.*;
|
||||
import com.jsowell.adapay.vo.*;
|
||||
@@ -786,45 +785,6 @@ public class AdapayService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建交易确认请求/创建分账请求
|
||||
* 这个方法只适用于给一个用户分账
|
||||
*/
|
||||
public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmOperation operation) {
|
||||
// 调汇付的分账接口 确认交易
|
||||
Map<String, Object> confirmParams = Maps.newHashMap();
|
||||
// Adapay生成的支付对象id
|
||||
confirmParams.put("payment_id", operation.getPaymentId());
|
||||
// 请求订单号,只能为英文、数字或者下划线的一种或多种组合,保证在app_id下唯一
|
||||
confirmParams.put("order_no", "PC" + System.currentTimeMillis());
|
||||
// 确认金额,必须大于0,保留两位小数点,如0.10、100.05等。必须小于等于原支付金额-已确认金额-已撤销金额。
|
||||
String amount = AdapayUtil.formatAmount(operation.getConfirmAmt());
|
||||
confirmParams.put("confirm_amt", amount);
|
||||
|
||||
// 附加说明
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("orderCode", operation.getOrderCode());
|
||||
jsonObject.put("adapayMemberId", operation.getAdapayMemberId());
|
||||
confirmParams.put("description", jsonObject.toJSONString());
|
||||
|
||||
// 分账对象信息 一次最多7个
|
||||
DivMember divMember = new DivMember();
|
||||
divMember.setMember_id(operation.getAdapayMemberId());
|
||||
divMember.setAmount(amount);
|
||||
divMember.setFee_flag(Constants.Y);
|
||||
confirmParams.put("div_members", Lists.newArrayList(divMember));
|
||||
|
||||
Map<String, Object> paymentConfirm = null;
|
||||
try {
|
||||
paymentConfirm = PaymentConfirm.create(confirmParams, operation.getMerchantKey());
|
||||
} catch (BaseAdaPayException e) {
|
||||
log.error("创建交易确认请求error", e);
|
||||
}
|
||||
String jsonString = JSON.toJSONString(paymentConfirm);
|
||||
log.info("调分账接口param:{}, result:{}", JSON.toJSONString(confirmParams), jsonString);
|
||||
return JSONObject.parseObject(jsonString, PaymentConfirmResponse.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建交易确认请求/创建分账请求
|
||||
* 这个方法只适用于给一个用户分账
|
||||
@@ -904,13 +864,13 @@ public class AdapayService {
|
||||
/**
|
||||
* 创建支付确认撤销
|
||||
*/
|
||||
public void createConfirmReverse(String paymentConfirmId) throws BaseAdaPayException {
|
||||
public void createConfirmReverse(String paymentConfirmId, String wechatAppId) throws BaseAdaPayException {
|
||||
Map<String, Object> confirmReverseParams = Maps.newHashMap();
|
||||
confirmReverseParams.put("adapay_func_code", "payments.confirm.reverse");
|
||||
confirmReverseParams.put("payment_confirm_id", paymentConfirmId);
|
||||
confirmReverseParams.put("reason", "支付确认撤销");
|
||||
confirmReverseParams.put("order_no", IdUtils.fastSimpleUUID());
|
||||
Map<String, Object> confirmReverseResult = AdapayCommon.requestAdapay(confirmReverseParams);
|
||||
Map<String, Object> confirmReverseResult = AdapayCommon.requestAdapay(confirmReverseParams, wechatAppId);
|
||||
log.info("创建支付确认撤销param:{}, result:{}", JSON.toJSONString(confirmReverseParams), JSON.toJSONString(confirmReverseResult));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user