Skip to content

Commit ee0e8eb

Browse files
author
adkumar3
committed
changes
1 parent da1d218 commit ee0e8eb

File tree

13 files changed

+364
-437
lines changed

13 files changed

+364
-437
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,19 @@ You do not need to download and build the source to use the SDK but if you want
8686
8787
h. "serverURL" config parameter will take precedence over sendToProduction and sendToAkamai config parameters. By default the "serverURL" configuration is commented out.
8888

89-
<<<<<<< HEAD
9089
i. "enablejdkcert" parameter if set to true then it will read the JKS file specified at keysDirectory location. The file should be of the same name as specified in keyFilename.
9190

9291
j. cacerts this property will be considered only if "enablejdkcert" is set to true. If it is set to true then it means the JKS file is under cacerts folder of the JDK and
9392
it will read the JKS file from cacerts.
9493
9594
k. Please refer to the accompanying documentation for the other optional properties that you may wish to specify.
96-
=======
95+
9796
i. "allowRetry" config parameter will only work for HttpClient. Set allowRetry config parameter to "true" to enable retry mechanism and set merchant specific values for the retry.
9897
Set integer values for config parameter numberOfRetries & retryInterval. Retry Interval is time delay for next retry in seconds. number of retry parameter should be set between
9998
1 to 5 any other value will throw an Error Message. Refer to the "Retry Pattern" section below.
10099
101100
j. Please refer to the accompanying documentation for the other optional properties that you may wish to specify.
102-
>>>>>>> upstream/master
101+
103102

104103

105104
4. Build this project using Maven.

java/pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
3+
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.sonatype.oss</groupId>
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>com.cybersource</groupId>
1111
<artifactId>cybersource-sdk-java</artifactId>
12-
<version>6.2.3-SNAPSHOT</version>
12+
<version>6.2.5-SNAPSHOT</version>
1313
<name>cybersource-sdk-java</name>
1414
<description>Simple Order API Client</description>
1515
<url>http://www.cybersource.com</url>
@@ -33,13 +33,13 @@
3333
<email>[email protected]</email>
3434
</developer>
3535
</developers>
36-
36+
3737
<properties>
3838
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3939
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4040
</properties>
4141
<packaging>jar</packaging>
42-
42+
4343
<profiles>
4444
<profile>
4545
<id>release-artifacts</id>
@@ -172,7 +172,7 @@
172172
</build>
173173
</profile>
174174
</profiles>
175-
175+
176176
<dependencies>
177177
<dependency>
178178
<groupId>junit</groupId>
@@ -185,11 +185,11 @@
185185
<artifactId>commons-httpclient</artifactId>
186186
<version>3.1</version>
187187
<exclusions>
188-
<exclusion>
189-
<groupId>commons-logging</groupId>
190-
<artifactId>commons-logging</artifactId>
191-
</exclusion>
192-
</exclusions>
188+
<exclusion>
189+
<groupId>commons-logging</groupId>
190+
<artifactId>commons-logging</artifactId>
191+
</exclusion>
192+
</exclusions>
193193
</dependency>
194194
<dependency>
195195
<groupId>org.bouncycastle</groupId>
@@ -200,14 +200,14 @@
200200
<groupId>org.apache.ws.security</groupId>
201201
<artifactId>wss4j</artifactId>
202202
<version>1.6.19</version>
203-
</dependency>
203+
</dependency>
204204
<dependency>
205205
<groupId>org.apache.commons</groupId>
206206
<artifactId>commons-lang3</artifactId>
207207
<version>3.4</version>
208208
</dependency>
209209
<dependency>
210-
<groupId>org.mockito</groupId>
210+
<groupId>org.mockito</groupId>
211211
<artifactId>mockito-all</artifactId>
212212
<version>1.10.19</version>
213213
<scope>test</scope>

java/src/main/resources/cybs.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ allowRetry=true
2626
numberOfRetries=5
2727
retryInterval=5
2828

29-
<<<<<<< HEAD
29+
3030
# If This property is set to true then the p12 certificate must be stored in JKS format
3131
# program will read it from there. If it is set to false then the certificate will be read from
3232
# the location specified above from the key directory location
@@ -38,10 +38,10 @@ cacert=false
3838
cacertpassword=changeit
3939
# Mechanism to differentiate whether Payload is encrypted or not
4040
#useSignAndEncrypted=<-- Set it to true for MLE[MessageLevelEncryption] -->
41-
=======
41+
4242
# Mechanism to differentiate whether Payload is encrypted or not
4343
useSignAndEncrypted=<-- Set it to true for MLE[MessageLevelEncryption] -->
44-
>>>>>>> upstream/master
44+
4545

4646
timeout=1000
4747

pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
66
<modelVersion>4.0.0</modelVersion>
7-
7+
88
<name>cybersource-sdk-java-master</name>
9-
9+
1010
<modules>
1111
<module>zip</module>
1212
<module>java</module>
1313
</modules>
14-
14+
1515
<packaging>pom</packaging>
16-
16+
1717
<parent>
1818
<groupId>org.sonatype.oss</groupId>
1919
<artifactId>oss-parent</artifactId>
2020
<version>7</version>
2121
</parent>
22-
22+
2323
<groupId>com.cybersource</groupId>
2424
<artifactId>cybersource-sdk-master</artifactId>
25-
<version>6.2.4</version>
26-
27-
25+
<version>6.2.5</version>
26+
27+
2828
</project>

samples/nvp/compileSample.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LOCAL_CP=
88
# -----------------------------------------------------------------------------
99

1010
if test -d ../../lib
11-
then LOCAL_CP=$LOCAL_CP:../../lib/cybersource-sdk-java-6.2.4.jar
11+
then LOCAL_CP=$LOCAL_CP:../../lib/cybersource-sdk-java-6.2.5-SNAPSHOT.jar
1212
fi
1313

1414
if test ! -d ../../lib

samples/nvp/cybs.properties

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
merchantID=
2-
keysDirectory=
3-
keyAlias=
4-
keyPassword=
5-
targetAPIVersion=1.129
6-
1+
merchantID=< ---merchant_id ---->
2+
keysDirectory=<--- P12 key directory location -->
3+
keyAlias=<--- key alias name for P12 key --->
4+
keyPassword=<--- P12 key password --->
5+
targetAPIVersion=<-- API Version Number -->
6+
# KeyFilename is the name of the JKS file
7+
keyFilename=<--JKS_file_name -->
78
# the following flags can be used to control the endpoint to which requests will be sent.
89
# Set sendToProduction=true to send requests to Cybersource production environment.
910
# Set sendToAkamai=true to send requests through Akamai to Cybersource.
1011
# If serverURL is provided then it takes precedence over the above settings. By default
11-
# the serverURL config is commented out.
12-
sendToProduction=false
13-
sendToAkamai=true
14-
#serverURL=https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor
12+
# the serverURL config is commented out.
13+
sendToProduction=<-- Set it to true for Production -->
14+
sendToAkamai=<-- Set it to true for Akamai -->
15+
#serverURL=< -- Service URL or Transaction Processor URL -->
1516

1617
#useHttpClient=false
1718

@@ -25,15 +26,29 @@ allowRetry=true
2526
numberOfRetries=5
2627
retryInterval=5
2728

29+
30+
# If This property is set to true then the p12 certificate must be stored in JKS format
31+
# program will read it from there. If it is set to false then the certificate will be read from
32+
# the location specified above from the key directory location
33+
enablejdkcert=false
34+
# if Cacert property is enabled then it means the certificates are kept under the cacert folder of JDK
35+
# And it will read from JDK cert. This property will be considered only if enableJDKcert is set to true.
36+
cacert=false
37+
# Enter the password for cacert file. By default it will use the default password for JDK
38+
cacertpassword=changeit
2839
# Mechanism to differentiate whether Payload is encrypted or not
29-
useSignAndEncrypted=false
40+
#useSignAndEncrypted=<-- Set it to true for MLE[MessageLevelEncryption] -->
41+
42+
# Mechanism to differentiate whether Payload is encrypted or not
43+
useSignAndEncrypted=<-- Set it to true for MLE[MessageLevelEncryption] -->
44+
3045

3146
timeout=1000
3247

3348
# logging should normally be disabled in production as it would slow down the
3449
# processing. Enable it only when troubleshooting an issue.
3550
enableLog=true
36-
logDirectory=./logs
51+
logDirectory=<-- Directory where cybs.log file will be created -->
3752
logMaximumSize=10
3853

3954
# Optional proxy server settings

samples/nvp/logs/cybs.log

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,56 @@ com.cybersource.ws.client.ConfigException: The file "/.p12" is missing or is not
452452
at com.cybersource.sample.RunSample.runAuth(RunSample.java:152)
453453
at com.cybersource.sample.RunSample.main(RunSample.java:57)
454454

455+
456+
2017-03-01 14:19:58.031 main TRANSTART> =======================================
457+
2017-03-01 14:19:58.038 main MERCHCFG > merchantID=, keysDirectory=, keyAlias=, keyPassword=, sendToProduction=false, sendToAkamai=true, targetAPIVersion=1.129, keyFilename=(null), serverURL=(null), namespaceURI=(null), enableLog=true, logDirectory=./logs, logFilename=(null), logMaximumSize=10, useHttpClient=false, timeout=1000, useSignAndEncrypted=false
458+
2017-03-01 14:19:58.043 main PROXYCFG > https.proxyHost=userproxy.visa.com, https.proxyPort=443, https.proxyUser=(null), https.proxyPassword=(null)
459+
2017-03-01 14:19:58.078 main REQUEST >
460+
UUID > c2958df3-6321-4d2e-b1eb-ddaee4d8dd94
461+
Input request is
462+
=======================================
463+
purchaseTotals_currency=USD
464+
billTo_city=Mountain View
465+
shipTo_lastName=xxx
466+
billTo_email=noboxxxxxxxxxxxxxxxcom
467+
clientLibrary=Java Basic
468+
billTo_country=US
469+
billTo_lastName=xxx
470+
billTo_street1=1295xxxxxxxxxxxxxoad
471+
shipTo_state=CA
472+
clientLibraryVersion=6.2.3
473+
ccAuthService_run=true
474+
shipTo_city=San Mateo
475+
shipTo_street1=10xxxxxxxxxxxt
476+
clientEnvironment=Mac OS X/10.11.6/Oracle Corporation/1.8.0_74
477+
shipTo_postalCode=94401
478+
shipTo_country=US
479+
card_accountNumber=4111xxxxxxxxx111
480+
merchantReferenceCode=MRC-14344
481+
shipTo_firstName=xxxxx
482+
item_1_unitPrice=56.78
483+
billTo_postalCode=94043
484+
billTo_state=CA
485+
billTo_firstName=xxxxx
486+
card_expirationMonth=xx
487+
item_0_unitPrice=12.34
488+
merchantID=
489+
billTo_ipAddress=10.7.7.7
490+
card_expirationYear=xxxx
491+
billTo_phoneNumber=65xxxxxxxxx0
492+
493+
2017-03-01 14:19:58.091 main INFO > Client, End of soapWrap 85ms
494+
2017-03-01 14:19:58.386 main EXCEPTION> Exception while loading KeyStore, 'null'
495+
2017-03-01 14:19:58.393 main EXCEPTION>
496+
ClientException details:
497+
innerException:
498+
com.cybersource.ws.client.ConfigException: The file "/.p12" is missing or is not a file.
499+
at com.cybersource.ws.client.MerchantConfig.getKeyFile(MerchantConfig.java:339)
500+
at com.cybersource.ws.client.SecurityUtil.readAndStoreCertificateAndPrivateKey(SecurityUtil.java:115)
501+
at com.cybersource.ws.client.SecurityUtil.loadMerchantP12File(SecurityUtil.java:92)
502+
at com.cybersource.ws.client.Client.soapWrapAndSign(Client.java:205)
503+
at com.cybersource.ws.client.Client.runTransaction(Client.java:120)
504+
at com.cybersource.ws.client.Client.runTransaction(Client.java:75)
505+
at com.cybersource.sample.RunSample.runAuth(RunSample.java:152)
506+
at com.cybersource.sample.RunSample.main(RunSample.java:57)
507+

0 commit comments

Comments
 (0)