mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 20:15:06 +08:00
commit
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.jsowell.wxpay.config;
|
||||
|
||||
|
||||
import com.jsowell.wxpay.common.WeChatPayParameter;
|
||||
import com.jsowell.wxpay.utils.WechatPayUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Order(value = 2)
|
||||
@Component
|
||||
public class WechatPayConfig implements CommandLineRunner {
|
||||
/**
|
||||
* 公众号appid
|
||||
*/
|
||||
@Value("${wechat.appId}")
|
||||
private String wechatAppId;
|
||||
|
||||
/**
|
||||
* 商户号id
|
||||
*/
|
||||
@Value("${wechat.mchId}")
|
||||
private String wechatMchId;
|
||||
|
||||
/**
|
||||
* 商户序列号
|
||||
*/
|
||||
@Value("${wechat.mchSerialNo}")
|
||||
private String mchSerialNo;
|
||||
/**
|
||||
* 支付key
|
||||
*/
|
||||
@Value("${wechat.v3Key}")
|
||||
private String wechatV3Key;
|
||||
|
||||
/**
|
||||
* 微信支付回调url
|
||||
*/
|
||||
@Value("${wechat.callback}")
|
||||
private String payCallbackUrl;
|
||||
|
||||
/**
|
||||
* 微信退款回调url
|
||||
*/
|
||||
@Value("${wechat.refundCallback}")
|
||||
private String refundCallbackUrl;
|
||||
|
||||
/**
|
||||
* 统一下单url
|
||||
*/
|
||||
@Value("${wechat.unifiedOrder.url}")
|
||||
private String wechatUnifiedOrderUrl;
|
||||
|
||||
/**
|
||||
* 统一下单url
|
||||
*/
|
||||
@Value("${wechat.unifiedOrder.jsurl}")
|
||||
private String wechatUnifiedOrderUrlJS;
|
||||
|
||||
/**
|
||||
* jsapi申请退款url
|
||||
*/
|
||||
@Value("${wechat.refund.jsurl}")
|
||||
private String wechatRefundJsUrl;
|
||||
|
||||
/**
|
||||
* 平台证书列表地址
|
||||
*/
|
||||
@Value("${wechat.certificates.url}")
|
||||
private String wechatCertificatesUrl;
|
||||
|
||||
/**
|
||||
* 商户私钥路径
|
||||
*/
|
||||
@Value("${wechat.key.path}")
|
||||
private String wechatKeyPath;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// System.out.println(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 MyStartupRunner1 order 2 <<<<<<<<<<<<<");
|
||||
//微信支付
|
||||
WeChatPayParameter.mchId = wechatMchId;
|
||||
WeChatPayParameter.appId = wechatAppId;
|
||||
WeChatPayParameter.v3Key = wechatV3Key;
|
||||
WeChatPayParameter.certificatesUrl = wechatCertificatesUrl;
|
||||
WeChatPayParameter.unifiedOrderUrl = wechatUnifiedOrderUrl;
|
||||
WeChatPayParameter.unifiedOrderUrlJS = wechatUnifiedOrderUrlJS;
|
||||
WeChatPayParameter.notifyUrl = payCallbackUrl;
|
||||
WeChatPayParameter.refundJsUrl = wechatRefundJsUrl;
|
||||
WeChatPayParameter.refundNotifyUrl = refundCallbackUrl;
|
||||
//加载商户私钥
|
||||
WeChatPayParameter.privateKey = WechatPayUtils.getPrivateKey(wechatKeyPath);
|
||||
WeChatPayParameter.mchSerialNo = mchSerialNo;
|
||||
//获取平台证书
|
||||
WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user