File tree Expand file tree Collapse file tree
pay-java-ali/src/main/java/com/egzosn/pay/ali Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565public class AliPayService extends BasePayService <AliPayConfigStorage > implements AliPayServiceInf {
6666
6767
68+ /**
69+ * api服务地址,默认为国内
70+ */
71+ private String apiServerUrl ;
72+
6873 /**
6974 * 获取对应的请求地址
7075 *
7176 * @return 请求地址
7277 */
7378 @ Override
7479 public String getReqUrl (TransactionType transactionType ) {
80+ if (StringUtils .isNotEmpty (apiServerUrl )) {
81+ return apiServerUrl ;
82+ }
7583 return payConfigStorage .isTest () ? AliPayConst .DEV_REQ_URL : HTTPS_REQ_URL ;
7684 }
7785
@@ -850,5 +858,17 @@ public String refundDepositBackCompleted(RefundOrder refundOrder) {
850858 return null ;
851859 }
852860
861+ /**
862+ * 设置api服务器地址
863+ *
864+ * @param apiServerUrl api服务器地址
865+ * @return 自身
866+ */
867+ @ Override
868+ public AliPayServiceInf setApiServerUrl (String apiServerUrl ) {
869+ this .apiServerUrl = apiServerUrl ;
870+ return this ;
871+ }
872+
853873
854874}
Original file line number Diff line number Diff line change @@ -19,4 +19,13 @@ public interface AliPayServiceInf {
1919 * @return fail 消息获取失败 是 success 消息获取成功 否
2020 */
2121 String refundDepositBackCompleted (RefundOrder refundOrder );
22+
23+
24+ /**
25+ * 设置api服务器地址
26+ *
27+ * @param apiServerUrl api服务器地址
28+ * @return 自身
29+ */
30+ AliPayServiceInf setApiServerUrl (String apiServerUrl );
2231}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ private AliPayConst() {
2020 /**
2121 * 沙箱测试环境账号
2222 */
23- public static final String DEV_REQ_URL = "https://openapi.alipaydev.com/gateway.do" ;
23+ public static final String DEV_REQ_URL = "https://openapi-sandbox.dl .alipaydev.com/gateway.do" ;
2424
2525 public static final String SIGN = "sign" ;
2626
You can’t perform that action at this time.
0 commit comments