package com.sinata.config.properties;
|
|
import cn.hutool.core.util.StrUtil;
|
import com.sinata.core.util.ToolUtil;
|
import lombok.Data;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 微信支付配置
|
*
|
* @author frankevil
|
* @date 2023/3/3 23:43
|
**/
|
@Data
|
@Component
|
@ConfigurationProperties(prefix = WxPayProperties.WX_PLAY_PREFIX)
|
public class WxPayProperties {
|
protected static final String WX_PLAY_PREFIX = "wxpay";
|
|
/**
|
* 是否使用沙盒 默认不使用
|
*/
|
private boolean sandboxnew;
|
|
/**
|
* 应用编号
|
*/
|
private String appId;
|
|
/**
|
* appSecret 是 appId 对应的接口密码,微信公众号授权获取用户 openId 时使用
|
*/
|
private String appSecret;
|
/**
|
* 微信支付商户号
|
*/
|
private String mchId;
|
|
/**
|
* API 密钥,微信商户后台配置
|
*/
|
private String partnerKey;
|
/**
|
* apiclient_cert.p1 证书路径,在微信商户后台下载
|
*/
|
private String certPath;
|
|
/**
|
* 外网访问项目的域名,支付通知中会使用
|
*/
|
private String domain;
|
|
|
public String getCertPath() {
|
if (StrUtil.isNotBlank(certPath)) {
|
return ToolUtil.getJarPath() + certPath;
|
}
|
return "";
|
}
|
}
|