小程序支持支付宝支付
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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<WxScanPayResp> 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<WxScanPayResp> 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();
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<result column="app_token" jdbcType="LONGVARCHAR" property="appToken" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
app_token
|
||||
app_token, alipay_app_token
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
|
||||
Reference in New Issue
Block a user