修改支付

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

@ -19,6 +19,8 @@ public class WxPayBean {
private String appSecret;
private String mchId;
private String apiV2;
private String slAppId;
private String slMchId;
private String certPath;
private String domain; // 填写完整的回调地址
@ -70,6 +72,22 @@ public class WxPayBean {
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
public String toString() {
return "WxPayBean [appId=" + appId + ", appSecret=" + appSecret + ", mchId=" + mchId + ", apiV2="

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

@ -84,15 +84,22 @@ aliyun.oss.domain = https://wine-east-img.oss-cn-zhangjiakou.aliyuncs.com
################## \u5FAE\u4FE1\u76F8\u5173\u914D\u7F6E ##########################
# \u516C\u4F17\u53F7\u914D\u7F6E
# \u516C\u4F17\u53F7\u914D\u7F6E
weixin.official.appId=wxf4327ef05c27a0
weixin.official.appSecret=1f55e8749332234d9a074873d8e6a3
# \u5C0F\u7A0B\u5E8F\u914D\u7F6E
wxpay.appId = wx53b5ac263b9cdb5b
wxpay.appSecret = baa127ca662344cf9b0b8e52b26bac9d
# \u5FAE\u4FE1\u652F\u4ED8
wxpay.mchId=1485526382
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\u5E8FAppSecret: baa127ca662344cf9b0b8e52b26bac9d
#\u5FAE\u4FE1\u652F\u4ED8: 1485526382
@ -101,8 +108,6 @@ wxpay.apiV2=f5aacf8f7ff800f4cd039f2514c5d7da
#\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 ######################
alipay.appId = \u5E94\u7528\u7F16\u53F7

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

Loading…
Cancel
Save