|
|
|
@@ -19,6 +19,7 @@ import com.iformall.domain.po.WxPayAccount; |
|
|
|
import com.iformall.domain.po.WxPayAccountBill; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.base.WxBillBaseEntity; |
|
|
|
import com.iformall.enums.EnumAppPlat; |
|
|
|
import com.iformall.enums.EnumBillAllType; |
|
|
|
import com.iformall.enums.EnumBillPayWay; |
|
|
|
import com.iformall.enums.EnumPayWay; |
|
|
|
@@ -49,11 +50,11 @@ public class WxMiniProgramServiceImpl extends PayBillBaseService implements PayB |
|
|
|
if (StringUtils.isBlank(openId)) { |
|
|
|
throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND.getCode(),"参数openId为空"); |
|
|
|
} |
|
|
|
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(wxPayAccountBill.getTenantId(), EnumPayWay.PAY_WAY_WECHAT.getPlat()); |
|
|
|
if(cAppInfo == null){ |
|
|
|
throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未查询到C端小程序"); |
|
|
|
WxAppinfo bAppInfo = wxAppinfoService.getBAppInfo(wxPayAccountBill, EnumAppPlat.WX); |
|
|
|
if(bAppInfo == null){ |
|
|
|
throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND.getCode(),"未查询到B端小程序"); |
|
|
|
} |
|
|
|
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); |
|
|
|
WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(bAppInfo.getPayId()); |
|
|
|
if(payAccount == null){ |
|
|
|
throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND.getCode(),"未查询到payAccount."); |
|
|
|
} |
|
|
|
@@ -68,7 +69,7 @@ public class WxMiniProgramServiceImpl extends PayBillBaseService implements PayB |
|
|
|
try { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
String uniquePayOrderNo = billdetail.getBillType()+"_"+idWorker.nextId(); |
|
|
|
PayAdapterResult wxResult = wxMiniAppPayAdapterService.payIsv(payAccount, cAppInfo, payAccount.getSubMchId(), openId, billdetail.getBillTypeName(), attach, uniquePayOrderNo, |
|
|
|
PayAdapterResult wxResult = wxMiniAppPayAdapterService.payIsv(payAccount, bAppInfo, payAccount.getSubMchId(), openId, billdetail.getBillTypeName(), attach, uniquePayOrderNo, |
|
|
|
fee, "127.0.0.1", wxPayAccountBill.getPaidCallBack()+"/"+wxPayAccountBill.getTenantId(), new Date(), false); |
|
|
|
if (wxResult.isSuccess()) { |
|
|
|
return wxResult; |
|
|
|
|