修改支付

main
孟权伟 4 months ago
parent 497ce9c141
commit 7004c06821

@ -19,6 +19,8 @@ public class WxPayBean {
private String appSecret; private String appSecret;
private String mchId; private String mchId;
private String apiV2; private String apiV2;
private String slAppId;
private String slMchId;
private String certPath; private String certPath;
private String domain; // 填写完整的回调地址 private String domain; // 填写完整的回调地址
@ -70,6 +72,22 @@ public class WxPayBean {
this.domain = domain; this.domain = domain;
} }
public String getSlAppId() {
return slAppId;
}
public void setSlAppId(String slAppId) {
this.slAppId = slAppId;
}
public String getSlMchId() {
return slMchId;
}
public void setSlMchId(String slMchId) {
this.slMchId = slMchId;
}
@Override @Override
public String toString() { public String toString() {
return "WxPayBean [appId=" + appId + ", appSecret=" + appSecret + ", mchId=" + mchId + ", apiV2=" return "WxPayBean [appId=" + appId + ", appSecret=" + appSecret + ", mchId=" + mchId + ", apiV2="

@ -607,8 +607,10 @@ public class WeixinServiceImpl implements WeixinService {
getApiConfig(storeId, platform); getApiConfig(storeId, platform);
WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig(); WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig();
Map<String, String> params = RefundModel.builder() Map<String, String> params = RefundModel.builder()
.appid(wxPayApiConfig.getAppId()) .sub_appid(wxPayApiConfig.getAppId())
.mch_id(wxPayApiConfig.getMchId()) .sub_mch_id(wxPayApiConfig.getMchId())
.appid(wxPayApiConfig.getSlAppId())
.mch_id(wxPayApiConfig.getSlMchId())
.nonce_str(WxPayKit.generateStr()) .nonce_str(WxPayKit.generateStr())
.transaction_id("") .transaction_id("")
.out_trade_no(orderSn) .out_trade_no(orderSn)
@ -924,8 +926,10 @@ public class WeixinServiceImpl implements WeixinService {
getApiConfig(storeId, platform); getApiConfig(storeId, platform);
WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig(); WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig();
Map<String, String> params = MicroPayModel.builder() Map<String, String> params = MicroPayModel.builder()
.appid(wxPayApiConfig.getAppId()) .sub_appid(wxPayApiConfig.getAppId())
.mch_id(wxPayApiConfig.getMchId()) .sub_mch_id(wxPayApiConfig.getMchId())
.appid(wxPayApiConfig.getSlAppId())
.mch_id(wxPayApiConfig.getSlMchId())
.nonce_str(WxPayKit.generateStr()) .nonce_str(WxPayKit.generateStr())
.body(reqData.get("body")) .body(reqData.get("body"))
.attach(reqData.get("body")) .attach(reqData.get("body"))
@ -1007,8 +1011,11 @@ public class WeixinServiceImpl implements WeixinService {
WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig(); WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig();
Map<String, String> params = UnifiedOrderModel Map<String, String> params = UnifiedOrderModel
.builder() .builder()
.appid(wxPayApiConfig.getAppId()) .sub_appid(wxPayApiConfig.getAppId())
.mch_id(wxPayApiConfig.getMchId()) .sub_mch_id(wxPayApiConfig.getMchId())
.sub_openid(reqData.get("openid"))
.appid(wxPayApiConfig.getSlAppId())
.mch_id(wxPayApiConfig.getSlMchId())
.nonce_str(WxPayKit.generateStr()) .nonce_str(WxPayKit.generateStr())
.body(reqData.get("body")) .body(reqData.get("body"))
.attach(reqData.get("body")) .attach(reqData.get("body"))
@ -1017,7 +1024,6 @@ public class WeixinServiceImpl implements WeixinService {
.spbill_create_ip(ip) .spbill_create_ip(ip)
.notify_url(wxPayApiConfig.getDomain() + CALL_BACK_URL) .notify_url(wxPayApiConfig.getDomain() + CALL_BACK_URL)
.trade_type(reqData.get("trade_type")) .trade_type(reqData.get("trade_type"))
.openid(reqData.get("openid"))
.build() .build()
.createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5);
String xmlResult = WxPayApi.pushOrder(false, params); String xmlResult = WxPayApi.pushOrder(false, params);
@ -1067,8 +1073,11 @@ public class WeixinServiceImpl implements WeixinService {
sceneInfo.setH5Info(h5Info); sceneInfo.setH5Info(h5Info);
Map<String, String> params = UnifiedOrderModel Map<String, String> params = UnifiedOrderModel
.builder() .builder()
.appid(wxPayApiConfig.getAppId()) .sub_appid(wxPayApiConfig.getAppId())
.mch_id(wxPayApiConfig.getMchId()) .sub_mch_id(wxPayApiConfig.getMchId())
.sub_openid(reqData.get("openid"))
.appid(wxPayApiConfig.getSlAppId())
.mch_id(wxPayApiConfig.getSlMchId())
.nonce_str(WxPayKit.generateStr()) .nonce_str(WxPayKit.generateStr())
.body(reqData.get("body")) .body(reqData.get("body"))
.attach(reqData.get("body")) .attach(reqData.get("body"))
@ -1119,6 +1128,8 @@ public class WeixinServiceImpl implements WeixinService {
String apiV2 = wxPayBean.getApiV2(); String apiV2 = wxPayBean.getApiV2();
String certPath = wxPayBean.getCertPath(); String certPath = wxPayBean.getCertPath();
String appId = wxPayBean.getAppId(); String appId = wxPayBean.getAppId();
String slAppId = wxPayBean.getSlAppId();
String slMchId = wxPayBean.getSlMchId();
logger.info("微信支付店铺信息:{}", JsonUtil.toJSONString(mtStore)); logger.info("微信支付店铺信息:{}", JsonUtil.toJSONString(mtStore));
if (mtStore != null && StringUtil.isNotEmpty(mtStore.getWxApiV2()) && StringUtil.isNotEmpty(mtStore.getWxMchId())) { if (mtStore != null && StringUtil.isNotEmpty(mtStore.getWxApiV2()) && StringUtil.isNotEmpty(mtStore.getWxMchId())) {
mchId = mtStore.getWxMchId(); mchId = mtStore.getWxMchId();
@ -1131,6 +1142,8 @@ public class WeixinServiceImpl implements WeixinService {
} }
} }
apiConfig = WxPayApiConfig.builder() apiConfig = WxPayApiConfig.builder()
.slAppId(slAppId)
.slMchId(slMchId)
.appId(appId) .appId(appId)
.mchId(mchId) .mchId(mchId)
.partnerKey(apiV2) .partnerKey(apiV2)

@ -84,15 +84,22 @@ aliyun.oss.domain = https://wine-east-img.oss-cn-zhangjiakou.aliyuncs.com
################## \u5FAE\u4FE1\u76F8\u5173\u914D\u7F6E ########################## ################## \u5FAE\u4FE1\u76F8\u5173\u914D\u7F6E ##########################
# \u516C\u4F17\u53F7\u914D\u7F6E # \u516C\u4F17\u53F7\u914D\u7F6E
# \u516C\u4F17\u53F7\u914D\u7F6E
weixin.official.appId=wxf4327ef05c27a0 weixin.official.appId=wxf4327ef05c27a0
weixin.official.appSecret=1f55e8749332234d9a074873d8e6a3 weixin.official.appSecret=1f55e8749332234d9a074873d8e6a3
# \u5C0F\u7A0B\u5E8F\u914D\u7F6E # \u5C0F\u7A0B\u5E8F\u914D\u7F6E
wxpay.appId = wx53b5ac263b9cdb5b wxpay.appId = wx53b5ac263b9cdb5b
wxpay.appSecret = baa127ca662344cf9b0b8e52b26bac9d wxpay.appSecret = baa127ca662344cf9b0b8e52b26bac9d
# \u5FAE\u4FE1\u652F\u4ED8
wxpay.mchId=1485526382 wxpay.mchId=1485526382
wxpay.apiV2=f5aacf8f7ff800f4cd039f2514c5d7da wxpay.apiV2=f5aacf8f7ff800f4cd039f2514c5d7da
wxpay.slAppId=1485526382
wxpay.slMchId=f5aacf8f7ff800f4cd039f2514c5d7da
wxpay.certPath=D:/apiclient_cert.p12
wxpay.domain=https://yanghaodong.51vip.biz
#\u5FAE\u4FE1\u5C0F\u7A0B\u5E8Fappid: wx53b5ac263b9cdb5b #\u5FAE\u4FE1\u5C0F\u7A0B\u5E8Fappid: wx53b5ac263b9cdb5b
#\u5FAE\u4FE1\u5C0F\u7A0B\u5E8FAppSecret: baa127ca662344cf9b0b8e52b26bac9d #\u5FAE\u4FE1\u5C0F\u7A0B\u5E8FAppSecret: baa127ca662344cf9b0b8e52b26bac9d
#\u5FAE\u4FE1\u652F\u4ED8: 1485526382 #\u5FAE\u4FE1\u652F\u4ED8: 1485526382
@ -101,8 +108,6 @@ wxpay.apiV2=f5aacf8f7ff800f4cd039f2514c5d7da
#\u5FAE\u4FE1\u652F\u4ED8apiv3\u5BC6\u94A5\uFF1Af5aacf8f7ff800f4cd039f2514c5d7da #\u5FAE\u4FE1\u652F\u4ED8apiv3\u5BC6\u94A5\uFF1Af5aacf8f7ff800f4cd039f2514c5d7da
wxpay.certPath=D:/apiclient_cert.p12
wxpay.domain=https://yanghaodong.51vip.biz
################## \u652F\u4ED8\u5B9D\u652F\u4ED8\u76F8\u5173\u914D\u7F6E ###################### ################## \u652F\u4ED8\u5B9D\u652F\u4ED8\u76F8\u5173\u914D\u7F6E ######################
alipay.appId = \u5E94\u7528\u7F16\u53F7 alipay.appId = \u5E94\u7528\u7F16\u53F7

@ -88,6 +88,8 @@ wxpay.appId = wxb6af3741234162bc
wxpay.appSecret = 76a538bfa5b55a4564d5f2be5540 wxpay.appSecret = 76a538bfa5b55a4564d5f2be5540
wxpay.mchId=1636980812 wxpay.mchId=1636980812
wxpay.apiV2=34354320201030y323e432342343 wxpay.apiV2=34354320201030y323e432342343
wxpay.slAppId=1485526382
wxpay.slMchId=f5aacf8f7ff800f4cd039f2514c5d7da
wxpay.certPath=/usr/local/fuint/cert/apiclient_cert.p12 wxpay.certPath=/usr/local/fuint/cert/apiclient_cert.p12
wxpay.domain=https://www.fuint.cn/fuint-application wxpay.domain=https://www.fuint.cn/fuint-application

Loading…
Cancel
Save