mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-06 21:26:26 +08:00
feat 微信只保留p12证书, 支付宝中证书直接以文本方式保存
This commit is contained in:
@@ -9,7 +9,6 @@ import cn.bootx.platform.daxpay.core.channel.alipay.service.AlipayConfigService;
|
||||
import cn.bootx.platform.daxpay.dto.channel.alipay.AlipayConfigDto;
|
||||
import cn.bootx.platform.daxpay.param.channel.alipay.AlipayConfigParam;
|
||||
import cn.bootx.platform.daxpay.param.channel.alipay.AlipayConfigQuery;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -17,6 +16,7 @@ import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -64,9 +64,9 @@ public class AlipayConfigController {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Operation(summary = "将文件转换成base64")
|
||||
@PostMapping("/toBase64")
|
||||
public ResResult<String> toBase64(MultipartFile file){
|
||||
return Res.ok(Base64.encode(file.getBytes()));
|
||||
@Operation(summary = "读取证书文件内容")
|
||||
@PostMapping("/readPem")
|
||||
public ResResult<String> readPem(MultipartFile file){
|
||||
return Res.ok(new String(file.getBytes(), StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CashierController {
|
||||
|
||||
private final CashierService cashierService;
|
||||
|
||||
@Operation(summary = "发起支付(单渠道,包括聚合付款码方式)")
|
||||
@Operation(summary = "发起支付(单渠道)")
|
||||
@PostMapping("/singlePay")
|
||||
public ResResult<PayResult> singlePay(@RequestBody CashierSinglePayParam cashierSinglePayParam) {
|
||||
return Res.ok(cashierService.singlePay(cashierSinglePayParam));
|
||||
|
||||
@@ -77,28 +77,14 @@ public class WeChatPayConfig extends MpBaseEntity implements EntityBaseFunction<
|
||||
@DbColumn(comment = "APPID对应的接口密码")
|
||||
private String appSecret;
|
||||
|
||||
/** .p12证书Base64 */
|
||||
/** API证书中p12证书Base64 */
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@BigField
|
||||
@EncryptionField
|
||||
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
|
||||
@DbColumn(comment = "API 证书中的 p12 文件存储的 id")
|
||||
@DbColumn(comment = "API证书中p12证书Base64")
|
||||
private String p12;
|
||||
|
||||
/** cert.pem证书的Base64 */
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@BigField
|
||||
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
|
||||
@DbColumn(comment = "cert.pem证书的Base64")
|
||||
private String certPem;
|
||||
|
||||
/** key.pem的私钥Base64 */
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
|
||||
@BigField
|
||||
@DbColumn(comment = "私钥key.pem的Base64")
|
||||
private String keyPem;
|
||||
|
||||
/** 应用域名,回调中会使用此参数 */
|
||||
@DbColumn(comment = "应用域名")
|
||||
private String domain;
|
||||
|
||||
@@ -47,14 +47,6 @@ public class WeChatPayConfigDto extends BaseDto implements Serializable {
|
||||
@SensitiveInfo
|
||||
private String p12;
|
||||
|
||||
@Schema(description = "API 证书中的 cert.pem 证书")
|
||||
@SensitiveInfo(value = SensitiveInfo.SensitiveType.OTHER, front = 15)
|
||||
private String certPem;
|
||||
|
||||
@Schema(description = "API 证书中的 key.pem 私钥")
|
||||
@SensitiveInfo(value = SensitiveInfo.SensitiveType.OTHER, front = 15)
|
||||
private String keyPem;
|
||||
|
||||
@Schema(description = "应用域名,回调中会使用此参数")
|
||||
private String domain;
|
||||
|
||||
|
||||
@@ -46,15 +46,9 @@ public class WeChatPayConfigParam {
|
||||
@Schema(description = "APPID对应的接口密码,用于获取接口调用凭证access_token时使用")
|
||||
private String appSecret;
|
||||
|
||||
@Schema(description = "API 证书中的 p12 文件id")
|
||||
@Schema(description = "API 证书中的 p12 文件")
|
||||
private String p12;
|
||||
|
||||
@Schema(description = "API 证书中的 cert.pem 证书")
|
||||
private String certPem;
|
||||
|
||||
@Schema(description = "API 证书中的 key.pem 私钥")
|
||||
private String keyPem;
|
||||
|
||||
@Schema(description = "应用域名,回调中会使用此参数")
|
||||
private String domain;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user