diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java index 4e1fd88..1f715bd 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java @@ -8,6 +8,7 @@ public class TbMerchantThirdApply implements Serializable { private String type; private String appId; + private String alipayAppId; private Byte status; @@ -20,6 +21,7 @@ public class TbMerchantThirdApply implements Serializable { private Long updatedAt; private String appToken; + private String alipayAppToken; private String smallAppid; @@ -127,4 +129,20 @@ public class TbMerchantThirdApply implements Serializable { public void setAlipaySmallAppid(String alipaySmallAppid) { this.alipaySmallAppid = alipaySmallAppid; } + + public String getAlipayAppId() { + return alipayAppId; + } + + public void setAlipayAppId(String alipayAppId) { + this.alipayAppId = alipayAppId; + } + + public String getAlipayAppToken() { + return alipayAppToken; + } + + public void setAlipayAppToken(String alipayAppToken) { + this.alipayAppToken = alipayAppToken; + } } \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 06f06a8..dfc3aa3 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -316,12 +316,16 @@ public class PayService { } String smallAppid = thirdApply.getSmallAppid(); + String appId = thirdApply.getAppId(); + String appToken = thirdApply.getAppToken(); if ("aliPay".equals(payType)){ smallAppid = thirdApply.getAlipaySmallAppid(); + appId = thirdApply.getAlipayAppId(); + appToken = thirdApply.getAlipayAppToken(); } String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT"; PublicResp publicResp = thirdPayService.scanpay(thirdUrl, - thirdApply.getAppId(), + appId, reqbody, reqbody, payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(), @@ -333,7 +337,7 @@ public class PayService { thirdApply.getStoreId(), callFSTBack, null, - thirdApply.getAppToken()); + appToken); if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) { if ("000000".equals(publicResp.getCode())) { WxScanPayResp wxScanPayResp = publicResp.getObjData(); @@ -660,13 +664,17 @@ public class PayService { reqbody = body.toString(); } String smallAppid = thirdApply.getSmallAppid(); + String appId = thirdApply.getAppId(); + String appToken = thirdApply.getAppToken(); if ("aliPay".equals(payType)){ smallAppid = thirdApply.getAlipaySmallAppid(); + appId = thirdApply.getAlipayAppId(); + appToken = thirdApply.getAlipayAppToken(); } String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT"; PublicResp publicResp = thirdPayService.scanpay( thirdUrl, - thirdApply.getAppId(), + appId, reqbody, reqbody, payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(), @@ -679,7 +687,7 @@ public class PayService { thirdApply.getStoreId(), callBackGroupurl, null, - thirdApply.getAppToken()); + appToken); if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) { if ("000000".equals(publicResp.getCode())) { WxScanPayResp wxScanPayResp = publicResp.getObjData(); diff --git a/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml b/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml index 02f37a7..208ccb8 100644 --- a/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml +++ b/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml @@ -18,10 +18,10 @@ - id, type, app_id, status, pay_password, applyment_state, created_at, updated_at,small_appid,alipay_small_appid,store_id + id, type, app_id, alipay_app_id, status, pay_password, applyment_state, created_at, updated_at,small_appid,alipay_small_appid,store_id - app_token + app_token, alipay_app_token