Skip to content

Commit e673958

Browse files
committed
changes added for null check in sample
1 parent 19af21f commit e673958

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

java/src/main/java/com/cybersource/ws/client/MerchantConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public MerchantConfig(Properties _props, String _merchantID)
261261
logFilename = getProperty(merchantID, "logFilename");
262262
logMaximumSize = getIntegerProperty(merchantID, "logMaximumSize", 10);
263263
useHttpClient = getBooleanProperty(merchantID, "useHttpClient", ConnectionHelper.getDefaultUseHttpClient());
264-
customHttpClass = getProperty(merchantID, "customHttpClass");
264+
customHttpClass = getProperty(merchantID, "customHttpClass"," ");
265265
timeout = getIntegerProperty(merchantID, "timeout", DEFAULT_TIMEOUT);
266266
proxyHost = getProperty(merchantID, "proxyHost");
267267
proxyPort = getIntegerProperty(merchantID, "proxyPort", DEFAULT_PROXY_PORT);

samples/xml/src/main/java/com/cybersource/sample/RunSample.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ public static void main(String[] args) {
4949

5050
case 0:
5151
authReply = runAuth(props, "auth");
52+
if(authReply==null)
53+
break;
5254
requestID = getRequestID(authReply);
5355
decision = getDecisonCode(authReply);
5456
break;
5557

5658
case 1:
5759
authReply = runAuth(props, "auth");
60+
if(authReply==null)
61+
break;
5862
requestID = getRequestID(authReply);
5963
decision = getDecisonCode(authReply);
6064
if (!(("null".equals(requestID)) && (decision
@@ -65,12 +69,16 @@ public static void main(String[] args) {
6569

6670
case 2:
6771
authReply = runAuthEMV(props, "emvauth");
72+
if(authReply==null)
73+
break;
6874
requestID = getRequestID(authReply);
6975
decision = getDecisonCode(authReply);
7076
break;
7177

7278
case 3:
7379
authReply = runAuth(props, "auth");
80+
if(authReply==null)
81+
break;
7482
requestID = getRequestID(authReply);
7583
decision = getDecisonCode(authReply);
7684
captureReply = runCapture(props, requestID, "capture");
@@ -82,6 +90,8 @@ public static void main(String[] args) {
8290

8391
case 4:
8492
authReply = runAuth(props, "auth");
93+
if(authReply=null)
94+
break;
8595
requestID = getRequestID(authReply);
8696
decision = getDecisonCode(authReply);
8797
if (!(("null".equals(requestID)) && "decline".equalsIgnoreCase(decision)))

0 commit comments

Comments
 (0)