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 11<?xml version =" 1.0" ?>
22<project name =" anet-java-sdk" default =" compile" basedir =" ." >
3- <property name =" version" value =" 1.8.2 " />
3+ <property name =" version" value =" 1.9.0 " />
44 <property name =" dirs.base" value =" ${ basedir } " />
55 <property name =" src.dir" value =" ${ basedir } /src/main/java" />
66 <property name =" javadocs.dir" value =" ${ basedir } /docs/javadocs" />
Original file line number Diff line number Diff line change 1515import net .authorize .api .contract .v1 .MessageTypeEnum ;
1616import net .authorize .api .contract .v1 .MessagesType ;
1717import net .authorize .api .contract .v1 .MessagesType .Message ;
18+ import net .authorize .util .Constants ;
1819import net .authorize .util .HttpUtility ;
1920import net .authorize .util .LogHelper ;
2021
@@ -75,9 +76,7 @@ protected void setApiRequest(Q apiRequest) {
7576 }
7677
7778 protected void setClientId () {
78- String clientId = "sdk-java-" + getVersion ();
79-
80- this .apiRequest .setClientId (clientId );
79+ this .apiRequest .setClientId (getClientId ());
8180 }
8281
8382 public S getApiResponse () {
@@ -253,26 +252,7 @@ private void validateAndSetMerchantAuthentication() {
253252 }
254253 }
255254
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 ;
277257 }
278258}
Original file line number Diff line number Diff line change @@ -32,4 +32,6 @@ public final class Constants {
3232
3333 public static final String HTTP_READ_TIME_OUT = "http.ReadTimeout" ;
3434 public static final int HTTP_READ_TIME_OUT_DEFAULT_VALUE = 30000 ;
35+
36+ public static final String CLIENT_ID = "sdk-java-1.9.0" ;
3537}
You can’t perform that action at this time.
0 commit comments