Skip to content

Commit 5a0f432

Browse files
committed
minor code refactoring
1 parent df9ff9d commit 5a0f432

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -587,19 +587,11 @@ private static long parseLong(String val, long defaultValue) {
587587
}
588588

589589
public static String checkIfMTIFiledExist(Document request, String nsURI) {
590-
Element element = Utility.getElement(request, MERCHANT_TRANSACTION_IDENTIFIER, nsURI);
591-
String mtiFieldValue = checkIfMTIFiledExist(element);
590+
String mtiFieldValue = Utility.getElementText(request, MERCHANT_TRANSACTION_IDENTIFIER, nsURI);
592591
if(StringUtils.isBlank(mtiFieldValue)){
593-
element = Utility.getElement(request, MERCHANT_TRANSACTION_IDENTIFIER, null);
594-
mtiFieldValue = checkIfMTIFiledExist(element);
592+
mtiFieldValue = Utility.getElementText(request, MERCHANT_TRANSACTION_IDENTIFIER, null);
595593
}
596594
return mtiFieldValue;
597595
}
598596

599-
public static String checkIfMTIFiledExist(Element element) {
600-
if(element != null){
601-
return element.getAttribute(MERCHANT_TRANSACTION_IDENTIFIER);
602-
}
603-
return null;
604-
}
605597
}

0 commit comments

Comments
 (0)