测试支付回调地址3
This commit is contained in:
@@ -29,6 +29,9 @@ public class SqxApplication {
|
||||
if ("pay.extractNotifyUrl".equals(key)) {
|
||||
WuyouPay.setExtractNotifyUrl(value.toString());
|
||||
}
|
||||
if ("pay.h5BaseUrl".equals(key)) {
|
||||
WuyouPay.setH5BaseUrl(value.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,8 @@ public class WuyouController {
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
|
||||
BaseResp baseResp = WuyouPay.payOrder(payDetails.getTradeNo(), order.getPayMoney().toString(), request.getHeader("User-Agent"));
|
||||
BaseResp baseResp = WuyouPay.payOrder(payDetails.getTradeNo(), order.getPayMoney().toString(),
|
||||
request.getHeader("User-Agent"), String.format("%d-%d", order.getCourseId(), order.getCourseDetailsId()));
|
||||
if (baseResp.getCode() == null) {
|
||||
return Result.error(baseResp.getErrorMsg());
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class WuyouPay {
|
||||
|
||||
static String NOTIFY_URL = "";
|
||||
static String EXTRACT_NOTIFY_URL = "";
|
||||
static String H5_BASE_URL = "";
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WuyouPay.class);
|
||||
|
||||
@@ -27,7 +28,11 @@ public class WuyouPay {
|
||||
EXTRACT_NOTIFY_URL = extractNotifyUrl;
|
||||
}
|
||||
|
||||
public static BaseResp payOrder(String orderNo, String amount, String userAgent) {
|
||||
public static void setH5BaseUrl(String h5BaseUrl) {
|
||||
H5_BASE_URL = h5BaseUrl;
|
||||
}
|
||||
|
||||
public static BaseResp payOrder(String orderNo, String amount, String userAgent, String allId) {
|
||||
Map<String, Object> params = getBaseParams();
|
||||
params.put("type", "6001");
|
||||
params.put("is_code", "1");
|
||||
@@ -37,7 +42,9 @@ public class WuyouPay {
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
params.put("sign", sign);
|
||||
params.put("return_url", "https://video-h5.hnsiyao.cn/me/detail/detail?a=111-1231311");
|
||||
params.put("return_url", H5_BASE_URL + allId);
|
||||
|
||||
// https://dj-h5.hnsiyao.cn/me/detail/detail?allId=1230-98688
|
||||
|
||||
String body = request(Constants.PAY_URL, params, userAgent);
|
||||
|
||||
@@ -119,7 +126,7 @@ public class WuyouPay {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
payOrder("20221118123456794", "0.1", "Mozilla/5.0");
|
||||
payOrder("20221118123456794", "0.1", "Mozilla/5.0", "1230-98688");
|
||||
// queryOrder("20221118123456791", "0.1", "Mozilla/5.0");
|
||||
|
||||
extractOrder("20221118123456793", "1", "1157756119@qq.com", "巩奕杰");
|
||||
|
||||
@@ -35,5 +35,6 @@ spring:
|
||||
|
||||
|
||||
pay:
|
||||
h5BaseUrl: https://video-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||
extractNotifyUrl: https://video.hnsiyao.cn/sqx_fast/app/wuyou/extractNotify
|
||||
|
||||
@@ -34,5 +34,6 @@ spring:
|
||||
multi-statement-allow: true
|
||||
|
||||
pay:
|
||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/notify
|
||||
extractNotifyUrl: https://dj-api.hnsiyao.cn/sqx_fast/app/wuyou/extractNotify
|
||||
|
||||
Reference in New Issue
Block a user