mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 12:35:07 +08:00
汇付API 新增merchantKey
This commit is contained in:
@@ -16,7 +16,6 @@ import com.jsowell.adapay.common.CreateAdaPaymentParam;
|
||||
import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||||
import com.jsowell.adapay.response.BalancePaymentResponse;
|
||||
import com.jsowell.adapay.response.PaymentConfirmResponse;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
import com.jsowell.adapay.service.AdapayMemberService;
|
||||
@@ -1025,8 +1024,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
OrderSettleResult orderSettleResult;
|
||||
if (OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue().equals(orderBasicInfo.getPayMode())) {
|
||||
// 余额支付的订单
|
||||
// orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||
orderSettleResult = doBalancePaymentV2(orderBasicInfo, adapayMemberAccount);
|
||||
orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||
} else {
|
||||
// 在线支付,进行支付确认分账
|
||||
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount);
|
||||
@@ -1129,7 +1127,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
if (OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue().equals(orderBasicInfo.getPayMode())) {
|
||||
logger.info("手动接口执行订单分账逻辑-order:{}, result:{}", JSON.toJSONString(orderBasicInfo), JSON.toJSONString(orderSettleResult));
|
||||
// 余额支付的订单 只用余额支付转账
|
||||
orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||
// orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||
} else {
|
||||
// 在线支付,进行支付确认分账
|
||||
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount);
|
||||
@@ -1147,46 +1145,13 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 余额支付订单,使用余额支付转账
|
||||
* 余额支付订单,使用余额分账
|
||||
*
|
||||
* @param orderBasicInfo
|
||||
* @param adapayMemberAccount
|
||||
* @return
|
||||
*/
|
||||
public OrderSettleResult doBalancePayment(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount) throws BaseAdaPayException {
|
||||
// 计算应该支付金额,和手续费
|
||||
SplitSettleAmountVO splitSettleAmountVO = splitSettleAmount(orderBasicInfo.getSettleAmount());
|
||||
BigDecimal feeAmount = splitSettleAmountVO.getFeeAmount();
|
||||
BigDecimal tradeAmount = splitSettleAmountVO.getTradeAmount();
|
||||
logger.info("余额支付订单使用余额支付转账, orderCode:{}, inMemberId:{}, transAmt:{}", orderBasicInfo.getOrderCode(), orderBasicInfo, tradeAmount);
|
||||
|
||||
String orderCode = orderBasicInfo.getOrderCode();
|
||||
// 使用汇付余额支付功能
|
||||
String outMemberId = Constants.ZERO; // 若为商户本身时,请传入0
|
||||
String inMemberId = adapayMemberAccount.getAdapayMemberId();
|
||||
String transAmt = AdapayUtil.formatAmount(tradeAmount);
|
||||
String title = "订单结算入账";
|
||||
String desc = "订单号:" + orderCode + ", 结算金额";
|
||||
BalancePaymentResponse balancePaymentRequest = adapayMemberService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc);
|
||||
|
||||
OrderSettleResult result = new OrderSettleResult();
|
||||
result.setConfirm_amt(balancePaymentRequest.getTrans_amt());
|
||||
result.setStatus(balancePaymentRequest.getStatus());
|
||||
result.setFee_amt(feeAmount.toString());
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("orderCode", orderCode);
|
||||
// result.setDescription(jsonObject.toJSONString());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 余额支付订单,使用余额支付转账
|
||||
*
|
||||
* @param orderBasicInfo
|
||||
* @param adapayMemberAccount
|
||||
* @return
|
||||
*/
|
||||
public OrderSettleResult doBalancePaymentV2(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount) throws BaseAdaPayException {
|
||||
BigDecimal settleAmount = orderBasicInfo.getSettleAmount();
|
||||
String orderCode = orderBasicInfo.getOrderCode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user