feat 去除支付发起时的NotReturn属性,SQL脚本更新,部署调试

This commit is contained in:
bootx
2024-02-13 20:51:19 +08:00
parent 5ff2c5c389
commit ed03a55811
26 changed files with 3076 additions and 5652 deletions

View File

@@ -17,8 +17,8 @@ public class DaxPayDemoProperties {
/** 服务地址 */
private String serverUrl;
/** 前端地址 */
private String frontUrl;
/** 前端地址(h5) */
private String frontH5Url;
/** 签名方式 */
private SignTypeEnum signType = SignTypeEnum.MD5;

View File

@@ -82,12 +82,12 @@ public class AggregateService {
boolean exists = redisClient.exists(PREFIX_KEY + code);
if (!exists){
// 跳转到过期页面
return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontUrl(), URLEncodeUtil.encode("聚合支付码已过期..."));
return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontH5Url(), URLEncodeUtil.encode("聚合支付码已过期..."));
}
// 根据UA判断是什么环境
if (ua.contains(AggregatePayEnum.UA_ALI_PAY.getCode())) {
// 跳转支付宝中间页
return StrUtil.format("{}/aggregate/alipay?code={}", daxPayDemoProperties.getFrontUrl(),code);
return StrUtil.format("{}/aggregate/alipay?code={}", daxPayDemoProperties.getFrontH5Url(),code);
}
else if (ua.contains(AggregatePayEnum.UA_WECHAT_PAY.getCode())) {
// 微信重定向到中间页, 因为微信需要授权后才能发起支付
@@ -95,7 +95,7 @@ public class AggregateService {
}
else {
// 跳转到异常页
return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontUrl(), URLEncodeUtil.encode("请使用微信或支付宝扫码支付"));
return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontH5Url(), URLEncodeUtil.encode("请使用微信或支付宝扫码支付"));
}
}
@@ -126,7 +126,7 @@ public class AggregateService {
// 获取微信OpenId
String openId = this.getOpenId(authCode);
return StrUtil.format("{}/aggregate/wechatPay?aggregateCode={}&openId={}",
daxPayDemoProperties.getFrontUrl(),
daxPayDemoProperties.getFrontH5Url(),
aggregateCode,
openId);
}
@@ -156,7 +156,7 @@ public class AggregateService {
// 异步回调地址
simplePayParam.setNotNotify(true);
// 同步回调地址 无效
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontUrl()));
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontH5Url()));
DaxPayResult<PayOrderModel> execute = DaxPayKit.execute(simplePayParam);
// 判断是否支付成功
@@ -185,9 +185,9 @@ public class AggregateService {
// 异步回调地址
simplePayParam.setNotNotify(true);
// 支付成功同步回调地址
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontUrl()));
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontH5Url()));
// 中途退出 目前经测试不生效
simplePayParam.setQuitUrl(String.format("{}/result/error", daxPayDemoProperties.getFrontUrl()));
simplePayParam.setQuitUrl(String.format("{}/result/error", daxPayDemoProperties.getFrontH5Url()));
DaxPayResult<PayOrderModel> execute = DaxPayKit.execute(simplePayParam);

View File

@@ -88,7 +88,7 @@ public class CashierService {
.orElse("127.0.0.1");
simplePayParam.setClientIp(ip);
// 同步回调地址
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontUrl()));
simplePayParam.setReturnUrl(StrUtil.format("{}/result/success", daxPayDemoProperties.getFrontH5Url()));
// 发起支付
DaxPayResult<PayOrderModel> execute = DaxPayKit.execute(simplePayParam);
@@ -155,7 +155,7 @@ public class CashierService {
* 获取手机收银台链接
*/
public String getUniCashierUrl() {
return StrUtil.format("{}/cashier/uniCashier", daxPayDemoProperties.getFrontUrl());
return StrUtil.format("{}/cashier/uniCashier", daxPayDemoProperties.getFrontH5Url());
}
/**
@@ -178,7 +178,7 @@ public class CashierService {
* 微信授权回调页面, 然后重定向到统一收银台中, 携带openid
*/
public String wxAuthCallback(String code) {
return StrUtil.format("{}/cashier/uniCashier?source=redirect&openId={}", daxPayDemoProperties.getFrontUrl(), this.getOpenId(code));
return StrUtil.format("{}/cashier/uniCashier?source=redirect&openId={}", daxPayDemoProperties.getFrontH5Url(), this.getOpenId(code));
}
/**