"eladmin-system/src/main/vscode:/vscode.git/clone" did not exist on "acaf83af02938b80470693d1f0effe233bb1c94f"
Commit ac6e491e authored by zhuxiao's avatar zhuxiao
Browse files

微信支付配置添加证书文件(apiclient_cert.pem)

parent 2aa6c194
...@@ -734,9 +734,9 @@ VALUES ('alipay', '支付宝官方', 1, 1, 2, ...@@ -734,9 +734,9 @@ VALUES ('alipay', '支付宝官方', 1, 1, 2,
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark) INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1, 2, VALUES ('wxpay', '微信支付官方', 1, 1, 2,
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]', '[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"key", "desc":"APIv2密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiV3Key", "desc":"APIv3密钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(apiclient_cert.p12)", "type": "file","verify":""},{"name":"apiClientCert", "desc":"证书文件(apiclient_cert.pem) ", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(apiclient_key.pem)", "type": "file","verify":""}]',
'[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子账户appID(线上支付必填)","type":"text","verify":""}]', '[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子账户appID(线上支付必填)","type":"text","verify":""}]',
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]', '[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"key", "desc":"APIv2密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiV3Key", "desc":"APIv3密钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(apiclient_cert.p12)", "type": "file","verify":""},{"name":"apiClientCert", "desc":"证书文件(apiclient_cert.pem) ", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(apiclient_key.pem)", "type": "file","verify":""}]',
'[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]', '[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道'); 'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道');
......
...@@ -240,3 +240,16 @@ VALUES ('pppay', 'PayPal支付', 1, 0, 1, ...@@ -240,3 +240,16 @@ VALUES ('pppay', 'PayPal支付', 1, 0, 1,
## -- ++++ [v1.11.0] ===> [v1.12.0] ++++ ## -- ++++ [v1.11.0] ===> [v1.12.0] ++++
-- 分账重试 -- 分账重试
insert into t_sys_entitlement values('ENT_DIVISION_RECORD_RESEND', '按钮:重试', 'no-icon', '', '', 'PB', 0, 1, 'ENT_DIVISION_RECORD', '0', 'MCH', now(), now()); insert into t_sys_entitlement values('ENT_DIVISION_RECORD_RESEND', '按钮:重试', 'no-icon', '', '', 'PB', 0, 1, 'ENT_DIVISION_RECORD', '0', 'MCH', now(), now());
## -- ++++ [v1.12.0] ===> [v1.13.0] ++++
DELETE FROM t_pay_interface_define WHERE if_code = 'wxpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1, 2,
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"key", "desc":"APIv2密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiV3Key", "desc":"APIv3密钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(apiclient_cert.p12)", "type": "file","verify":""},{"name":"apiClientCert", "desc":"证书文件(apiclient_cert.pem) ", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(apiclient_key.pem)", "type": "file","verify":""}]',
'[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子账户appID(线上支付必填)","type":"text","verify":""}]',
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址(置空将使用官方)", "type": "text"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"key", "desc":"APIv2密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiV3Key", "desc":"APIv3密钥(V3接口必填)", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号(V3接口必填)", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(apiclient_cert.p12)", "type": "file","verify":""},{"name":"apiClientCert", "desc":"证书文件(apiclient_cert.pem) ", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(apiclient_key.pem)", "type": "file","verify":""}]',
'[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道');
...@@ -62,6 +62,9 @@ public class WxpayIsvParams extends IsvParams { ...@@ -62,6 +62,9 @@ public class WxpayIsvParams extends IsvParams {
/** API证书(.p12格式)**/ /** API证书(.p12格式)**/
private String cert; private String cert;
/** 证书文件(.pem格式) **/
private String apiClientCert;
/** 私钥文件(.pem格式) **/ /** 私钥文件(.pem格式) **/
private String apiClientKey; private String apiClientKey;
......
...@@ -77,6 +77,9 @@ public class WxpayNormalMchParams extends NormalMchParams { ...@@ -77,6 +77,9 @@ public class WxpayNormalMchParams extends NormalMchParams {
**/ **/
private String cert; private String cert;
/** 证书文件(.pem格式) **/
private String apiClientCert;
/** /**
* 私钥文件(.pem格式) * 私钥文件(.pem格式)
**/ **/
......
...@@ -53,7 +53,7 @@ public class WxServiceWrapper { ...@@ -53,7 +53,7 @@ public class WxServiceWrapper {
public static WxServiceWrapper buildWxServiceWrapper(String mchId, String appId, String appSecret, String mchKey, String apiVersion, String apiV3Key, public static WxServiceWrapper buildWxServiceWrapper(String mchId, String appId, String appSecret, String mchKey, String apiVersion, String apiV3Key,
String serialNo, String cert, String apiClientKey){ String serialNo, String cert, String apiClientCert, String apiClientKey){
WxPayConfig wxPayConfig = new WxPayConfig(); WxPayConfig wxPayConfig = new WxPayConfig();
wxPayConfig.setMchId(mchId); wxPayConfig.setMchId(mchId);
...@@ -62,21 +62,23 @@ public class WxServiceWrapper { ...@@ -62,21 +62,23 @@ public class WxServiceWrapper {
if (CS.PAY_IF_VERSION.WX_V2.equals(apiVersion)) { // 微信API V2 if (CS.PAY_IF_VERSION.WX_V2.equals(apiVersion)) { // 微信API V2
wxPayConfig.setSignType(WxPayConstants.SignType.MD5); wxPayConfig.setSignType(WxPayConstants.SignType.MD5);
}
ChannelCertConfigKitBean channelCertConfigKitBean = SpringBeansUtil.getBean(ChannelCertConfigKitBean.class); ChannelCertConfigKitBean channelCertConfigKitBean = SpringBeansUtil.getBean(ChannelCertConfigKitBean.class);
// api证书。
if(StringUtils.isNotBlank(cert)){
wxPayConfig.setKeyPath(channelCertConfigKitBean.getCertFilePath(cert));
}
} else if (CS.PAY_IF_VERSION.WX_V3.equals(apiVersion)) { // 微信API V3
ChannelCertConfigKitBean channelCertConfigKitBean = SpringBeansUtil.getBean(ChannelCertConfigKitBean.class);
if(StringUtils.isNotBlank(apiV3Key)) {
wxPayConfig.setApiV3Key(apiV3Key); wxPayConfig.setApiV3Key(apiV3Key);
}
if(StringUtils.isNotBlank(serialNo)) {
wxPayConfig.setCertSerialNo(serialNo); wxPayConfig.setCertSerialNo(serialNo);
}
if(StringUtils.isNotBlank(cert)){
wxPayConfig.setKeyPath(channelCertConfigKitBean.getCertFilePath(cert)); wxPayConfig.setKeyPath(channelCertConfigKitBean.getCertFilePath(cert));
wxPayConfig.setPrivateCertPath(channelCertConfigKitBean.getCertFilePath(cert)); }
if(StringUtils.isNotBlank(apiClientCert)){
wxPayConfig.setPrivateCertPath(channelCertConfigKitBean.getCertFilePath(apiClientCert));
}
if(StringUtils.isNotBlank(apiClientKey)) {
wxPayConfig.setPrivateKeyPath(channelCertConfigKitBean.getCertFilePath(apiClientKey)); wxPayConfig.setPrivateKeyPath(channelCertConfigKitBean.getCertFilePath(apiClientKey));
} }
...@@ -98,14 +100,14 @@ public class WxServiceWrapper { ...@@ -98,14 +100,14 @@ public class WxServiceWrapper {
//放置 wxJavaService //放置 wxJavaService
return buildWxServiceWrapper(wxpayParams.getMchId(), wxpayParams.getAppId(), return buildWxServiceWrapper(wxpayParams.getMchId(), wxpayParams.getAppId(),
wxpayParams.getAppSecret(), wxpayParams.getKey(), wxpayParams.getApiVersion(), wxpayParams.getApiV3Key(), wxpayParams.getAppSecret(), wxpayParams.getKey(), wxpayParams.getApiVersion(), wxpayParams.getApiV3Key(),
wxpayParams.getSerialNo(), wxpayParams.getCert(), wxpayParams.getApiClientKey()); wxpayParams.getSerialNo(), wxpayParams.getCert(), wxpayParams.getApiClientCert(), wxpayParams.getApiClientKey());
} }
public static WxServiceWrapper buildWxServiceWrapper(WxpayNormalMchParams wxpayParams){ public static WxServiceWrapper buildWxServiceWrapper(WxpayNormalMchParams wxpayParams){
//放置 wxJavaService //放置 wxJavaService
return buildWxServiceWrapper(wxpayParams.getMchId(), wxpayParams.getAppId(), return buildWxServiceWrapper(wxpayParams.getMchId(), wxpayParams.getAppId(),
wxpayParams.getAppSecret(), wxpayParams.getKey(), wxpayParams.getApiVersion(), wxpayParams.getApiV3Key(), wxpayParams.getAppSecret(), wxpayParams.getKey(), wxpayParams.getApiVersion(), wxpayParams.getApiV3Key(),
wxpayParams.getSerialNo(), wxpayParams.getCert(), wxpayParams.getApiClientKey()); wxpayParams.getSerialNo(), wxpayParams.getCert(), wxpayParams.getApiClientCert(), wxpayParams.getApiClientKey());
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment