mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-31 12:59:35 +08:00
支付宝新增自定义URL
This commit is contained in:
@@ -65,6 +65,11 @@ import com.egzosn.pay.common.util.str.StringUtils;
|
||||
public class AliPayService extends BasePayService<AliPayConfigStorage> implements AliPayServiceInf {
|
||||
|
||||
|
||||
/**
|
||||
* api服务地址,默认为国内
|
||||
*/
|
||||
private String apiServerUrl;
|
||||
|
||||
/**
|
||||
* 获取对应的请求地址
|
||||
*
|
||||
@@ -72,6 +77,9 @@ public class AliPayService extends BasePayService<AliPayConfigStorage> implement
|
||||
*/
|
||||
@Override
|
||||
public String getReqUrl(TransactionType transactionType) {
|
||||
if (StringUtils.isNotEmpty(apiServerUrl)) {
|
||||
return apiServerUrl;
|
||||
}
|
||||
return payConfigStorage.isTest() ? AliPayConst.DEV_REQ_URL : HTTPS_REQ_URL;
|
||||
}
|
||||
|
||||
@@ -850,5 +858,17 @@ public class AliPayService extends BasePayService<AliPayConfigStorage> implement
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置api服务器地址
|
||||
*
|
||||
* @param apiServerUrl api服务器地址
|
||||
* @return 自身
|
||||
*/
|
||||
@Override
|
||||
public AliPayServiceInf setApiServerUrl(String apiServerUrl) {
|
||||
this.apiServerUrl = apiServerUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,4 +19,13 @@ public interface AliPayServiceInf {
|
||||
* @return fail 消息获取失败 是 success 消息获取成功 否
|
||||
*/
|
||||
String refundDepositBackCompleted(RefundOrder refundOrder);
|
||||
|
||||
|
||||
/**
|
||||
* 设置api服务器地址
|
||||
*
|
||||
* @param apiServerUrl api服务器地址
|
||||
* @return 自身
|
||||
*/
|
||||
AliPayServiceInf setApiServerUrl(String apiServerUrl);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public final class AliPayConst {
|
||||
/**
|
||||
* 沙箱测试环境账号
|
||||
*/
|
||||
public static final String DEV_REQ_URL = "https://openapi.alipaydev.com/gateway.do";
|
||||
public static final String DEV_REQ_URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
|
||||
|
||||
public static final String SIGN = "sign";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user