mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-05 22:47:59 +08:00
校验分账金额测试方法
This commit is contained in:
@@ -16,9 +16,11 @@ import com.jsowell.adapay.response.PaymentConfirmResponse;
|
|||||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||||
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
||||||
import com.jsowell.adapay.service.AdapayService;
|
import com.jsowell.adapay.service.AdapayService;
|
||||||
|
import com.jsowell.adapay.vo.OrderSplitResult;
|
||||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||||
|
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -53,6 +55,9 @@ public class PaymentTestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AdapayService adapayService;
|
private AdapayService adapayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
public List<String> getPaymentIdList() {
|
public List<String> getPaymentIdList() {
|
||||||
List<String> resultList = Lists.newArrayList();
|
List<String> resultList = Lists.newArrayList();
|
||||||
// List<String> paymentIdList1 = getPaymentIdList1();
|
// List<String> paymentIdList1 = getPaymentIdList1();
|
||||||
@@ -468,4 +473,17 @@ public class PaymentTestController {
|
|||||||
String wechatAppId = wechatAppId1; // 万车充id
|
String wechatAppId = wechatAppId1; // 万车充id
|
||||||
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验订单分账金额
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void verifyOrderConfirmAmountTest() throws BaseAdaPayException {
|
||||||
|
String orderCode = "C21960272918";
|
||||||
|
List<String> paymentIds = Lists.newArrayList("002212024121307453510713429549121368064");
|
||||||
|
BigDecimal settleAmount = new BigDecimal("19.37");
|
||||||
|
String wechatAppId = wechatAppId1;
|
||||||
|
OrderSplitResult orderSplitResult = orderBasicInfoService.verifyOrderConfirmAmount(paymentIds, orderCode, settleAmount, wechatAppId);
|
||||||
|
System.out.println(JSON.toJSONString(orderSplitResult));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ public interface OrderBasicInfoService{
|
|||||||
|
|
||||||
OrderSplitResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
OrderSplitResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||||||
|
|
||||||
|
OrderSplitResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询订单
|
* 批量查询订单
|
||||||
* @param orderCodeList
|
* @param orderCodeList
|
||||||
|
|||||||
@@ -1469,6 +1469,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
* @param orderBasicInfo 订单
|
* @param orderBasicInfo 订单
|
||||||
* @param adapayMemberAccount 结算账户
|
* @param adapayMemberAccount 结算账户
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public OrderSplitResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException {
|
public OrderSplitResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException {
|
||||||
// 订单编号
|
// 订单编号
|
||||||
String orderCode = orderBasicInfo.getOrderCode();
|
String orderCode = orderBasicInfo.getOrderCode();
|
||||||
@@ -1569,7 +1570,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
* @param orderCode 订单编号
|
* @param orderCode 订单编号
|
||||||
* @param settleAmount 结算金额
|
* @param settleAmount 结算金额
|
||||||
*/
|
*/
|
||||||
private OrderSplitResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException {
|
@Override
|
||||||
|
public OrderSplitResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException {
|
||||||
// 分账金额
|
// 分账金额
|
||||||
BigDecimal totalConfirmAmt = BigDecimal.ZERO;
|
BigDecimal totalConfirmAmt = BigDecimal.ZERO;
|
||||||
// 手续费
|
// 手续费
|
||||||
|
|||||||
Reference in New Issue
Block a user