Commit 86a47481401067b1412ace9dc51660f727927901

Authored by tb
1 parent c2a50c4d

【功能优化】增加支付宝接口内容加密支持,注意需要和管理页面同时修改 #IAFYDQ

yudao-module-pay/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java
... ... @@ -27,6 +27,11 @@ public class AlipayPayClientConfig implements PayClientConfig {
27 27 public static final Integer MODE_CERTIFICATE = 2;
28 28  
29 29 /**
  30 + * 接口内容加密方式 - AES 加密
  31 + */
  32 + public static final String ENC_TYPE_AES = "AES";
  33 +
  34 + /**
30 35 * 签名算法类型 - RSA
31 36 */
32 37 public static final String SIGN_TYPE_DEFAULT = "RSA2";
... ... @@ -92,6 +97,19 @@ public class AlipayPayClientConfig implements PayClientConfig {
92 97 @NotBlank(message = "指定根证书内容字符串不能为空", groups = {ModeCertificate.class})
93 98 private String rootCertContent;
94 99  
  100 + /**
  101 + * 接口内容加密方式,如果为空,将使用无加密方式
  102 + * 如果要加密,目前支付宝只有 AES 一种加密方式
  103 + * <a href="https://opendocs.alipay.com/common/02mse3">支付宝开放平台</a>
  104 + * @see AlipayPayClientConfig#ENC_TYPE_AES
  105 + */
  106 + private String encryptType;
  107 +
  108 + /**
  109 + * 接口内容加密的私钥
  110 + */
  111 + private String encryptKey;
  112 +
95 113 public interface ModePublicKey {
96 114 }
97 115  
... ...