forked from Wechat-Group/weixin-java-demo-springmvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4216600
commit fb9d1b2
Showing
3 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.github.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
|
@@ -11,34 +12,40 @@ | |
/** | ||
* Created by FirenzesEagle on 2016/5/30 0030. | ||
* Email:[email protected] | ||
* | ||
* @author FirenzesEagle | ||
* @author BinaryWang | ||
*/ | ||
@Configuration | ||
public class MainConfig { | ||
|
||
//TODO(user) 填写公众号开发信息 | ||
//商站宝测试公众号 APP_ID | ||
protected static final String APP_ID = ""; | ||
//商站宝测试公众号 APP_SECRET | ||
protected static final String APP_SECRET = ""; | ||
//商站宝测试公众号 TOKEN | ||
protected static final String TOKEN = ""; | ||
//商站宝测试公众号 AES_KEY | ||
protected static final String AES_KEY = ""; | ||
|
||
//商站宝微信支付商户号 | ||
protected static final String PARTNER_ID = ""; | ||
//商站宝微信支付平台商户API密钥(https://pay.weixin.qq.com/index.php/core/account/api_cert) | ||
protected static final String PARTNER_KEY = ""; | ||
@Value("#{wxProperties.appid}") | ||
private String appid; | ||
|
||
@Value("#{wxProperties.appsecret}") | ||
private String appsecret; | ||
|
||
@Value("#{wxProperties.token}") | ||
private String token; | ||
|
||
@Value("#{wxProperties.aeskey}") | ||
private String aesKey; | ||
|
||
@Value("#{wxProperties.partener_id}") | ||
private String partenerId; | ||
|
||
@Value("#{wxProperties.partener_key}") | ||
private String partenerKey; | ||
|
||
@Bean | ||
public WxMpConfigStorage wxMpConfigStorage() { | ||
WxMpInMemoryConfigStorage configStorage = new WxMpInMemoryConfigStorage(); | ||
configStorage.setAppId(MainConfig.APP_ID); | ||
configStorage.setSecret(MainConfig.APP_SECRET); | ||
configStorage.setToken(MainConfig.TOKEN); | ||
configStorage.setAesKey(MainConfig.AES_KEY); | ||
configStorage.setPartnerId(MainConfig.PARTNER_ID); | ||
configStorage.setPartnerKey(MainConfig.PARTNER_KEY); | ||
configStorage.setAppId(this.appid); | ||
configStorage.setSecret(this.appsecret); | ||
configStorage.setToken(this.token); | ||
configStorage.setAesKey(this.aesKey); | ||
configStorage.setPartnerId(this.partenerId); | ||
configStorage.setPartnerKey(this.partenerKey); | ||
return configStorage; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#公众号 APP_ID | ||
appid= | ||
#公众号 APP_SECRET | ||
appsecret= | ||
#公众号 TOKEN | ||
token= | ||
#公众号 AES_KEY | ||
aeskey= | ||
#微信支付商户号 | ||
partener_id= | ||
#微信支付平台商户API密钥 | ||
partener_key= |