|
|
@@ -44,12 +44,12 @@ public class WechatPayService extends SuperService {
|
|
|
@Autowired
|
|
|
TransactionLogService transactionLogService;
|
|
|
|
|
|
- public ResultContent<Object> prepay(WeChatPrepayParam param){
|
|
|
+ public ResultContent<Object> prepay(WeChatPrepayParam param) {
|
|
|
String projectOid = getCurrentProjectOid();
|
|
|
String userId = getCurrentUserId();
|
|
|
String appId = getCurrentAppId();
|
|
|
|
|
|
- if (StringUtils.isBlank(projectOid)){
|
|
|
+ if (StringUtils.isBlank(projectOid)) {
|
|
|
return com.github.microservice.net.ResultContent.buildFail("获取项目id失败");
|
|
|
}
|
|
|
|
|
|
@@ -57,7 +57,6 @@ public class WechatPayService extends SuperService {
|
|
|
param.setUserId(userId);
|
|
|
param.setAppid(appId);
|
|
|
|
|
|
-
|
|
|
//根据项目id和支付渠道获取支付账户名
|
|
|
String accountName = orgPayAccountService.queryOgPayAccount(param.getOid(), PaymentType.WeChatPay);
|
|
|
|
|
|
@@ -72,7 +71,7 @@ public class WechatPayService extends SuperService {
|
|
|
return com.github.microservice.net.ResultContent.buildContent(prepay.getContent());
|
|
|
}
|
|
|
|
|
|
- public com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> handleTransactions(String projectOid, String oid, String userId, String orderNo, BigDecimal total){
|
|
|
+ public com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> handleTransactions(String projectOid, String oid, String userId, String orderNo, BigDecimal total) {
|
|
|
|
|
|
//获取机构待结算账户
|
|
|
PayAccount orgWaitSettle = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.WaitSettle);
|
|
|
@@ -89,7 +88,7 @@ public class WechatPayService extends SuperService {
|
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
sourceTransaction.setAmount(total.negate().longValue());
|
|
|
sourceTransaction.setRemark("微信小程序支付");
|
|
|
- sourceTransaction.setMeta(Map.of("paymentType",PaymentType.WeChat, "description","微信小程序支付", "summary", "微信小程序支付"));
|
|
|
+ sourceTransaction.setMeta(Map.of("paymentType", PaymentType.WeChat, "description", "微信小程序支付", "summary", "微信小程序支付"));
|
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
|
|
|
|
//构建入账账户
|
|
|
@@ -98,7 +97,7 @@ public class WechatPayService extends SuperService {
|
|
|
destinationTransaction.setOrderNumber(orderNo);
|
|
|
destinationTransaction.setAmount(total.longValue());
|
|
|
destinationTransaction.setRemark("微信小程序支付");
|
|
|
- destinationTransaction.setMeta(Map.of("paymentType",PaymentType.WeChat, "description","微信小程序支付", "summary", "微信小程序支付"));
|
|
|
+ destinationTransaction.setMeta(Map.of("paymentType", PaymentType.WeChat, "description", "微信小程序支付", "summary", "微信小程序支付"));
|
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
|
return transactionLogService.transfer(transferModel);
|
|
|
}
|
|
|
@@ -121,7 +120,7 @@ public class WechatPayService extends SuperService {
|
|
|
return ResultContent.buildFail(refundResult.getMsg());
|
|
|
}
|
|
|
|
|
|
- public com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> handleRefundTransactions(String projectOid, String oid, String userId, String refundOrderNo, BigDecimal refundTotal){
|
|
|
+ public com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> handleRefundTransactions(String projectOid, String oid, String userId, String refundOrderNo, BigDecimal refundTotal) {
|
|
|
//获取机构待结算账户
|
|
|
PayAccount orgWaitSettle = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.WaitSettle);
|
|
|
//获取用户余额支付子账
|
|
|
@@ -137,7 +136,7 @@ public class WechatPayService extends SuperService {
|
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
sourceTransaction.setAmount(refundTotal.negate().longValue());
|
|
|
sourceTransaction.setRemark("微信小程序支付");
|
|
|
- sourceTransaction.setMeta(Map.of("paymentType",PaymentType.WeChat, "description","微信小程序支付", "summary", "微信小程序支付"));
|
|
|
+ sourceTransaction.setMeta(Map.of("paymentType", PaymentType.WeChat, "description", "微信小程序支付", "summary", "微信小程序支付"));
|
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
|
|
|
|
//构建入账账户
|
|
|
@@ -146,7 +145,7 @@ public class WechatPayService extends SuperService {
|
|
|
destinationTransaction.setOrderNumber(refundOrderNo);
|
|
|
destinationTransaction.setAmount(refundTotal.longValue());
|
|
|
destinationTransaction.setRemark("微信小程序支付");
|
|
|
- destinationTransaction.setMeta(Map.of("paymentType",PaymentType.WeChat, "description","微信小程序支付", "summary", "微信小程序支付"));
|
|
|
+ destinationTransaction.setMeta(Map.of("paymentType", PaymentType.WeChat, "description", "微信小程序支付", "summary", "微信小程序支付"));
|
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
|
return transactionLogService.transfer(transferModel);
|
|
|
}
|