File tree Expand file tree Collapse file tree 3 files changed +7
-25
lines changed
src/main/java/net/authorize Expand file tree Collapse file tree 3 files changed +7
-25
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
2
<project name =" anet-java-sdk" default =" compile" basedir =" ." >
3
- <property name =" version" value =" 1.8.2 " />
3
+ <property name =" version" value =" 1.9.0 " />
4
4
<property name =" dirs.base" value =" ${ basedir } " />
5
5
<property name =" src.dir" value =" ${ basedir } /src/main/java" />
6
6
<property name =" javadocs.dir" value =" ${ basedir } /docs/javadocs" />
Original file line number Diff line number Diff line change 15
15
import net .authorize .api .contract .v1 .MessageTypeEnum ;
16
16
import net .authorize .api .contract .v1 .MessagesType ;
17
17
import net .authorize .api .contract .v1 .MessagesType .Message ;
18
+ import net .authorize .util .Constants ;
18
19
import net .authorize .util .HttpUtility ;
19
20
import net .authorize .util .LogHelper ;
20
21
@@ -75,9 +76,7 @@ protected void setApiRequest(Q apiRequest) {
75
76
}
76
77
77
78
protected void setClientId () {
78
- String clientId = "sdk-java-" + getVersion ();
79
-
80
- this .apiRequest .setClientId (clientId );
79
+ this .apiRequest .setClientId (getClientId ());
81
80
}
82
81
83
82
public S getApiResponse () {
@@ -253,26 +252,7 @@ private void validateAndSetMerchantAuthentication() {
253
252
}
254
253
}
255
254
256
- public synchronized String getVersion () {
257
- String version = null ;
258
-
259
- // try to load from maven properties first
260
- try {
261
- Properties p = new Properties ();
262
- InputStream is = getClass ().getResourceAsStream ("/META-INF/maven/net.authorize/anet-java-sdk/pom.properties" );
263
- if (is != null ) {
264
- p .load (is );
265
- version = p .getProperty ("version" , "" );
266
- }
267
- } catch (Exception e ) {
268
- // ignore
269
- }
270
-
271
- if (version == null ) {
272
- // we could not compute the version so use a blank
273
- version = "" ;
274
- }
275
-
276
- return version ;
255
+ public synchronized String getClientId () {
256
+ return Constants .CLIENT_ID ;
277
257
}
278
258
}
Original file line number Diff line number Diff line change @@ -32,4 +32,6 @@ public final class Constants {
32
32
33
33
public static final String HTTP_READ_TIME_OUT = "http.ReadTimeout" ;
34
34
public static final int HTTP_READ_TIME_OUT_DEFAULT_VALUE = 30000 ;
35
+
36
+ public static final String CLIENT_ID = "sdk-java-1.9.0" ;
35
37
}
You can’t perform that action at this time.
0 commit comments