parent
c40ea62b30
commit
cb673b9ca4
@ -0,0 +1,26 @@
|
||||
package com.luoo.user.config;
|
||||
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAPublicKeyConfig;
|
||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 微信支付通知配置
|
||||
*/
|
||||
@Configuration
|
||||
public class WxPayNotificationConfig {
|
||||
@Resource
|
||||
private WxPayConfig wxPayConfig;
|
||||
|
||||
public NotificationConfig config() {
|
||||
// 初始化商户配置
|
||||
NotificationConfig config = new RSAPublicKeyConfig.Builder().merchantId(wxPayConfig.getMchId())
|
||||
. privateKeyFromPath(wxPayConfig.getPrivateKeyPath()).publicKeyFromPath (wxPayConfig.getPublicKeyPath()).publicKeyId(wxPayConfig.getPublicKeyId()).merchantSerialNumber(wxPayConfig.getMchSerialNo()).apiV3Key(wxPayConfig.getApiV3Key()).build();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.luoo.user.config;
|
||||
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAPublicKeyConfig;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 微信支付下单公钥 配置类
|
||||
*/
|
||||
@Configuration
|
||||
public class WxPayPublicKeyConfig {
|
||||
@Resource
|
||||
private WxPayConfig wxPayConfig;
|
||||
|
||||
public Config config() {
|
||||
// 初始化商户配置
|
||||
Config config = new RSAPublicKeyConfig.Builder().merchantId(wxPayConfig.getMchId())
|
||||
. privateKeyFromPath(wxPayConfig.getPrivateKeyPath()).publicKeyFromPath (wxPayConfig.getPublicKeyPath()).publicKeyId(wxPayConfig.getPublicKeyId()).merchantSerialNumber(wxPayConfig.getMchSerialNo()).apiV3Key(wxPayConfig.getApiV3Key()).build();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in new issue