小程序支持支付宝支付
This commit is contained in:
@@ -8,6 +8,7 @@ public class TbMerchantThirdApply implements Serializable {
|
|||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private String appId;
|
private String appId;
|
||||||
|
private String alipayAppId;
|
||||||
|
|
||||||
private Byte status;
|
private Byte status;
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ public class TbMerchantThirdApply implements Serializable {
|
|||||||
private Long updatedAt;
|
private Long updatedAt;
|
||||||
|
|
||||||
private String appToken;
|
private String appToken;
|
||||||
|
private String alipayAppToken;
|
||||||
|
|
||||||
private String smallAppid;
|
private String smallAppid;
|
||||||
|
|
||||||
@@ -127,4 +129,20 @@ public class TbMerchantThirdApply implements Serializable {
|
|||||||
public void setAlipaySmallAppid(String alipaySmallAppid) {
|
public void setAlipaySmallAppid(String alipaySmallAppid) {
|
||||||
this.alipaySmallAppid = 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 smallAppid = thirdApply.getSmallAppid();
|
||||||
|
String appId = thirdApply.getAppId();
|
||||||
|
String appToken = thirdApply.getAppToken();
|
||||||
if ("aliPay".equals(payType)){
|
if ("aliPay".equals(payType)){
|
||||||
smallAppid = thirdApply.getAlipaySmallAppid();
|
smallAppid = thirdApply.getAlipaySmallAppid();
|
||||||
|
appId = thirdApply.getAlipayAppId();
|
||||||
|
appToken = thirdApply.getAlipayAppToken();
|
||||||
}
|
}
|
||||||
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
||||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(thirdUrl,
|
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(thirdUrl,
|
||||||
thirdApply.getAppId(),
|
appId,
|
||||||
reqbody,
|
reqbody,
|
||||||
reqbody,
|
reqbody,
|
||||||
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
||||||
@@ -333,7 +337,7 @@ public class PayService {
|
|||||||
thirdApply.getStoreId(),
|
thirdApply.getStoreId(),
|
||||||
callFSTBack,
|
callFSTBack,
|
||||||
null,
|
null,
|
||||||
thirdApply.getAppToken());
|
appToken);
|
||||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||||
if ("000000".equals(publicResp.getCode())) {
|
if ("000000".equals(publicResp.getCode())) {
|
||||||
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
||||||
@@ -660,13 +664,17 @@ public class PayService {
|
|||||||
reqbody = body.toString();
|
reqbody = body.toString();
|
||||||
}
|
}
|
||||||
String smallAppid = thirdApply.getSmallAppid();
|
String smallAppid = thirdApply.getSmallAppid();
|
||||||
|
String appId = thirdApply.getAppId();
|
||||||
|
String appToken = thirdApply.getAppToken();
|
||||||
if ("aliPay".equals(payType)){
|
if ("aliPay".equals(payType)){
|
||||||
smallAppid = thirdApply.getAlipaySmallAppid();
|
smallAppid = thirdApply.getAlipaySmallAppid();
|
||||||
|
appId = thirdApply.getAlipayAppId();
|
||||||
|
appToken = thirdApply.getAlipayAppToken();
|
||||||
}
|
}
|
||||||
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
||||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(
|
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(
|
||||||
thirdUrl,
|
thirdUrl,
|
||||||
thirdApply.getAppId(),
|
appId,
|
||||||
reqbody,
|
reqbody,
|
||||||
reqbody,
|
reqbody,
|
||||||
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
||||||
@@ -679,7 +687,7 @@ public class PayService {
|
|||||||
thirdApply.getStoreId(),
|
thirdApply.getStoreId(),
|
||||||
callBackGroupurl,
|
callBackGroupurl,
|
||||||
null,
|
null,
|
||||||
thirdApply.getAppToken());
|
appToken);
|
||||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||||
if ("000000".equals(publicResp.getCode())) {
|
if ("000000".equals(publicResp.getCode())) {
|
||||||
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
<result column="app_token" jdbcType="LONGVARCHAR" property="appToken" />
|
<result column="app_token" jdbcType="LONGVARCHAR" property="appToken" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<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>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
app_token
|
app_token, alipay_app_token
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
||||||
select
|
select
|
||||||
|
|||||||
Reference in New Issue
Block a user