mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 优化请求汇付API
This commit is contained in:
@@ -69,6 +69,12 @@ public class AdapayMemberService {
|
||||
@Autowired
|
||||
private ClearingBillInfoService clearingBillInfoService;
|
||||
|
||||
/**
|
||||
* 创建结算账户
|
||||
* @param dto
|
||||
* @throws BaseAdaPayException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public void createSettleAccount(SettleAccountDTO dto) throws BaseAdaPayException, BusinessException {
|
||||
String bankAcctType = dto.getBankAcctType();
|
||||
if (StringUtils.equals(bankAcctType, Constants.ONE)) {
|
||||
@@ -628,4 +634,40 @@ public class AdapayMemberService {
|
||||
log.info("创建支付确认撤销param:{}, result:{}", JSON.toJSONString(confirmReverseParams), JSON.toJSONString(confirmReverseResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建退款请求
|
||||
*/
|
||||
public void createRefundRequest(String paymentId, String refundAmt) {
|
||||
// 延迟分账确认的调退款接口
|
||||
Map<String, Object> refundParams = Maps.newHashMap();
|
||||
refundParams.put("refund_amt", AdapayUtil.formatAmount(refundAmt));
|
||||
refundParams.put("refund_order_no", IdUtils.fastSimpleUUID());
|
||||
refundParams.put("notify_url", ADAPAY_CALLBACK_URL);
|
||||
try {
|
||||
Map<String, Object> response = Refund.create(paymentId, refundParams);
|
||||
log.info("汇付支付创建退款对象:{}", JSON.toJSONString(response));
|
||||
} catch (BaseAdaPayException e) {
|
||||
log.error("汇付支付创建退款对象error", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建交易撤销请求
|
||||
* 延迟分账未确认, 调交易撤销接口退款
|
||||
*/
|
||||
public void createPaymentReverseRequest(String paymentId, String reverseAmt) {
|
||||
// 延迟分账未确认调撤销调撤销接口退款
|
||||
Map<String, Object> reverseParams = Maps.newHashMap();
|
||||
reverseParams.put("app_id", ADAPAY_APP_ID);
|
||||
reverseParams.put("payment_id", paymentId);
|
||||
reverseParams.put("reverse_amt", AdapayUtil.formatAmount(reverseAmt));
|
||||
reverseParams.put("order_no", IdUtils.fastSimpleUUID());
|
||||
reverseParams.put("notify_url", ADAPAY_CALLBACK_URL);
|
||||
try {
|
||||
Map<String, Object> paymentReverse = PaymentReverse.create(reverseParams);
|
||||
log.info("汇付支付创建交易撤销对象:{}", JSON.toJSONString(paymentReverse));
|
||||
} catch (BaseAdaPayException e) {
|
||||
log.error("汇付支付创建交易撤销对象error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user