修改无忧支付配置
This commit is contained in:
parent
2d9a74158a
commit
2c07d98be9
|
|
@ -1,15 +1,37 @@
|
|||
package com.sqx;
|
||||
|
||||
import com.sqx.modules.pay.wuyou.WuyouPay;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
public class SqxApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SqxApplication.class, args);
|
||||
ConfigurableApplicationContext context = SpringApplication.run(SqxApplication.class, args);
|
||||
context.getEnvironment().getPropertySources().forEach(source -> {
|
||||
if (source.getName().contains("application-dev.yml") || source.getName().contains("application-prod.yml")) {
|
||||
if (source.getSource() instanceof Map) {
|
||||
((Map<String, Object>) source.getSource()).forEach((key, value) -> {
|
||||
System.out.println(key + ": " + value);
|
||||
if ("pay.orderNotifyUrl".equals(key)) {
|
||||
WuyouPay.setNotifyUrl(value.toString());
|
||||
}
|
||||
if ("pay.extractNotifyUrl".equals(key)) {
|
||||
WuyouPay.setExtractNotifyUrl(value.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
System.out.println("(♥◠‿◠)ノ゙ 短剧系统启动成功 ლ(´ڡ`ლ)゙ \n"+
|
||||
" _ \n" +
|
||||
" | | \n" +
|
||||
|
|
@ -20,4 +42,4 @@ public class SqxApplication {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,4 @@ public class Constants {
|
|||
final static String EXTRACT_URL = BASE_URL + "/api/salary";
|
||||
final static String EXTRACT_QUERY_URL = BASE_URL + "/api/querySalary";
|
||||
|
||||
final static String NOTIFY_URL = "https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify";
|
||||
final static String EXTRACT_NOTIFY_URL = "https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,15 +13,27 @@ import java.util.Map;
|
|||
* @author GYJ
|
||||
*/
|
||||
public class WuyouPay {
|
||||
|
||||
static String NOTIFY_URL = "";
|
||||
static String EXTRACT_NOTIFY_URL = "";
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WuyouPay.class);
|
||||
|
||||
public static void setNotifyUrl(String notifyUrl) {
|
||||
NOTIFY_URL = notifyUrl;
|
||||
}
|
||||
|
||||
public static void setExtractNotifyUrl(String extractNotifyUrl) {
|
||||
EXTRACT_NOTIFY_URL = extractNotifyUrl;
|
||||
}
|
||||
|
||||
public static BaseResp payOrder(String orderNo, String amount, String userAgent) {
|
||||
Map<String, Object> params = getBaseParams();
|
||||
params.put("type", "6001");
|
||||
params.put("is_code", "1");
|
||||
params.put("out_trade_no", orderNo);
|
||||
params.put("total", amount);
|
||||
params.put("notify_url", Constants.NOTIFY_URL);
|
||||
params.put("notify_url", NOTIFY_URL);
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
params.put("sign", sign);
|
||||
|
|
@ -60,7 +72,7 @@ public class WuyouPay {
|
|||
params.put("bank_branch", "1");
|
||||
params.put("province", "1");
|
||||
params.put("city", "1");
|
||||
params.put("notify_url", Constants.EXTRACT_NOTIFY_URL);
|
||||
params.put("notify_url", EXTRACT_NOTIFY_URL);
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
params.put("sign", sign);
|
||||
|
|
|
|||
|
|
@ -33,3 +33,7 @@ spring:
|
|||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
|
||||
pay:
|
||||
orderNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||
extractNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/extractNotify
|
||||
|
|
|
|||
|
|
@ -33,3 +33,6 @@ spring:
|
|||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
pay:
|
||||
orderNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||
extractNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/extractNotify
|
||||
|
|
|
|||
Loading…
Reference in New Issue