update 实时分账

This commit is contained in:
2023-08-25 16:07:15 +08:00
parent 18548fb83d
commit 033ddb40e7
8 changed files with 141 additions and 44 deletions

View File

@@ -608,8 +608,11 @@ public class MemberService {
}
log.info("使用汇付支付充值余额 支付配置参数:{}", JSON.toJSONString(config));
// 查询延时支付模式,由一级运营商配置决定
String payMode = pileMerchantInfoService.getDelayModeByWechatAppId(dto.getWechatAppId());
// 封装对象
String payMode = Constants.ADAPAY_PAY_MODE_DELAY; // 汇付延时分账
// String payMode = Constants.ADAPAY_PAY_MODE_DELAY; // 汇付延时分账
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
createAdaPaymentParam.setOrder_no(SnowflakeIdWorker.getSnowflakeId());
createAdaPaymentParam.setPay_amt(AdapayUtil.formatAmount(dto.getAmount()));
@@ -627,7 +630,9 @@ public class MemberService {
map.put("memberId", dto.getMemberId());
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
// 延时分账
createAdaPaymentParam.setPay_mode(payMode);
if (StringUtils.isNotBlank(payMode)) {
createAdaPaymentParam.setPay_mode(payMode);
}
try {
log.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam), config.getWechatAppId());

View File

@@ -11,6 +11,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.primitives.Bytes;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.Payment;
import com.huifu.adapay.model.Refund;
import com.jsowell.JsowellApplication;
import com.jsowell.adapay.config.AbstractAdapayConfig;
@@ -205,6 +206,15 @@ public class SpringBootTestController {
@Autowired
private LTYTService ltytService;
@Test
public void queryPaymentInfoTest() throws BaseAdaPayException {
String wechatAppId = "wxbb3e0d474569481d";
String paymentId = "002212023082514501110541039779091623936";
// 在完成初始化设置情况下,调用查询方法,获取 Payment 查询结果
Map<String, Object> response = Payment.query(paymentId, wechatAppId);
System.out.println(response);
}
/**
* 手动变更银行卡信息
*/