From d724a9e72af381763c3b9ffb5ff72e9c97d230c9 Mon Sep 17 00:00:00 2001 From: DB <2502523450@qq.com> Date: Fri, 14 Jun 2024 16:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=99=AE=E9=80=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/wxPay/WxPayConfiguration.java | 9 ++-- .../config/wxPay/WxPayProperties.java | 43 +++++++++++++++++-- .../src/main/resources/application-pay.yml | 12 ++++-- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java index 9238d66..c1eb645 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java @@ -36,9 +36,12 @@ public class WxPayConfiguration { WxPayConfig payConfig = new WxPayConfig(); payConfig.setAppId(StrUtil.trimToNull(properties.getBackstageAppId())); payConfig.setMchId(StrUtil.trimToNull(properties.getBackstageMchId())); - payConfig.setMchKey(StrUtil.trimToNull(properties.getBackstageMchKey())); - payConfig.setKeyPath(properties.getBackstageKeyPath()); + payConfig.setPrivateKeyPath(properties.getBackstagePrivateKeyPath()); + payConfig.setPrivateCertPath(properties.getBackstagePrivateCertPath()); payConfig.setNotifyUrl(properties.getBackstagePayNotifyUrl()); + //v3 + payConfig.setApiV3Key(properties.getBackstageMchV3Key()); + payConfig.setCertSerialNo(properties.getBackstageV3CertSerialNo()); // 可以指定是否使用沙箱环境 payConfig.setUseSandboxEnv(false); WxPayServiceImpl wxPayService = new WxPayServiceImpl(); @@ -47,7 +50,7 @@ public class WxPayConfiguration { } /** - * 获取普通微信支付 + * 获取服务商微信支付 * @author DB * @since 2024/3/13 * @return WxPayService diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayProperties.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayProperties.java index c35c983..06fd105 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayProperties.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayProperties.java @@ -23,14 +23,24 @@ public class WxPayProperties { private String backstageMchId; /** - * 后台商户密钥 + * 后台支付私钥路径 */ - private String backstageMchKey; + private String backstagePrivateKeyPath; /** - * 后台证书路径 + * 后台支付证书路径 */ - private String backstageKeyPath; + private String backstagePrivateCertPath; + + /** + * 后台商户V3密钥 + */ + private String backstageMchV3Key; + + /** + * 后台证书序列号 + */ + private String backstageV3CertSerialNo; /** * 后台支付通知地址 @@ -62,6 +72,11 @@ public class WxPayProperties { */ private String serviceApiV3Key; + /** + * 服务商证书序列号 + */ + private String serviceApiV3CertSerialNo; + /** * 服务id */ @@ -81,4 +96,24 @@ public class WxPayProperties { * 服务商支付通知地址 */ private String servicePayNotifyUrl; + + /** + * 服务商签约计划通知地址 + */ + private String serviceSignPlanNotifyUrl; + + /** + * 服务商签约计划订单通知地址 + */ + private String serviceSignPlanOrderNotifyUrl; + + /** + * 服务商退款通知地址 + */ + private String serviceRefundNotifyUrl; + + /** + * 校区续费通知地址 + */ + private String storeRenewNotifyUrl; } diff --git a/Cpop-Pay/src/main/resources/application-pay.yml b/Cpop-Pay/src/main/resources/application-pay.yml index ad4a3f4..0b97d69 100644 --- a/Cpop-Pay/src/main/resources/application-pay.yml +++ b/Cpop-Pay/src/main/resources/application-pay.yml @@ -4,10 +4,14 @@ wx: backstage-app-id: wx1eb0e5fb7dac3c05 # 后台普通支付商户号 backstage-mch-id: 1618436087 - # 后台商户密钥 - backstage-mch-key: JamBox20220329174000000000000002 + # 后台支付私钥路径 + backstage-private-key-path: https://dataresource-1302318474.cos.accelerate.myqcloud.com/918956b7eb83462a8d35c29609277195.pem # 后台证书路径 - backstage-key-path: https://6265-beibeike-qy-b33k4-1302318474.tcb.qcloud.la/apiclient_cert.p12?sign=151cbcc241ad40403ad7b4731127554a&t=1661146932 + backstage-private-cert-path: https://dataresource-1302318474.cos.accelerate.myqcloud.com/896174289c4a434c9ac699c014900c29.pem + # 后台商户密钥 + backstage-mch-v3-key: JamBox20220329174000000000000002 + # 后台商户密钥序列号 + backstage-v3-cert-serial-no: 3E412CC35F245689D5BBB5FEE82367DD18589752 # 服务商appid service-app-id: wx1eb0e5fb7dac3c05 # 服务商商户号 @@ -18,6 +22,8 @@ wx: service-private-cert-path: https://dataresource-1302318474.cos.accelerate.myqcloud.com/1a40dd000db44a9fb98f25fefaf4e519.pem # 服务商apiV3密钥 service-api-v3-key: JamBox20230919174000000000000002 + # 服务商apiV3密钥序列号 + service-api-v3-cert-serial-no: 3D69FDEA1D1E48ACFF058A3FF55788DCE2C9FC0C # 服务id service-id: 00003053000000169450961228104460 # 分账服务商账号