|
|
@@ -295,22 +295,39 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
|
|
|
public ResultContent refund(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String refundOrderNo, String remark) {
|
|
|
|
|
|
- String accountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
- com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
- return ResultContent.buildFail(accountModelResultContent.getMsg());
|
|
|
+ String projectAccountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
+ //获取银联支付产品账户及需要签约的商户号
|
|
|
+ String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
+
|
|
|
+ com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
|
+ if (!orgAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
+ return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
|
}
|
|
|
- ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
|
- String mid = conf.getMchId();
|
|
|
+ ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
|
+
|
|
|
+ com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
|
+ if (!projectAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
+ return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
PayProductParameter<Object> payProductParameter = new PayProductParameter<>();
|
|
|
- payProductParameter.setAccountName(accountName);
|
|
|
+ payProductParameter.setAccountName(projectAccountName);
|
|
|
ChinaSenselessRefundRequest request = new ChinaSenselessRefundRequest();
|
|
|
request.setMchntOrderId(orderNo);
|
|
|
- request.setVaMchntNo(mid);
|
|
|
+
|
|
|
request.setRefundAmount(total.toString());
|
|
|
request.setTargetOrderId(refundOrderNo);
|
|
|
request.setSysSource(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid)));
|
|
|
+
|
|
|
+ VaFld vaFld = new VaFld();
|
|
|
+ SatInfo satInfo = new SatInfo();
|
|
|
+ satInfo.setMerId(orgConf.getMchId());
|
|
|
+// satInfo.setFeeBear("Y");
|
|
|
+ satInfo.setRefundAmt(total.toBigInteger().toString());
|
|
|
+ vaFld.setSatInfo(List.of(satInfo));
|
|
|
+ request.setVaFld(vaFld);
|
|
|
+
|
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> refundResultContent = senselessPayService.refund(payProductParameter);
|
|
|
return ResultContent.buildContent(refundResultContent.getContent());
|