Skip to content

Commit 517bbc1

Browse files
committed
Fixing the XML escaping for few elements that are likely to have special
characters. AuthorizeNet#4
1 parent 97a2f96 commit 517bbc1

File tree

7 files changed

+1812
-1713
lines changed

7 files changed

+1812
-1713
lines changed

src/main/java/net/authorize/Transaction.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ public static void setTransactionFieldDelimiter(String transactionFieldDelimiter
3737
Transaction.TRANSACTION_FIELD_DELIMITER = transactionFieldDelimiter;
3838
}
3939

40-
/**
41-
* Try to decode string value from xml node as per proper xml requirements
42-
* @param node which is a text element
43-
* @return decoded String value
44-
*/
45-
public static String getDecodedString(Node node) {
46-
String value = node.getTextContent();
47-
String decodedValue = XmlUtility.create(value);
48-
49-
return decodedValue;
50-
}
51-
5240
public String toNVPString() { return ""; }
5341

5442
public String toXMLString() { return ""; }
@@ -72,9 +60,21 @@ public static void setEncapCharDelimiter(String encapCharDelimiter) {
7260
* @return Node with encoded text value appropriate for XML
7361
*/
7462
public static Node getEncodedString(net.authorize.util.BasicXmlDocument document, String value) {
75-
String encodedValue = XmlUtility.getXml(value);
63+
String encodedValue = XmlUtility.escapeStringForXml(value);
7664
Node node = document.getDocument().createTextNode(encodedValue);
7765

7866
return node;
7967
}
68+
69+
/**
70+
* Try to decode string value from xml node as per proper xml requirements
71+
* @param node which is a text element
72+
* @return decoded String value
73+
*/
74+
public static String getDecodedString(Node node) {
75+
String value = node.getTextContent();
76+
String decodedValue = XmlUtility.descapeStringForXml(value);
77+
78+
return decodedValue;
79+
}
8080
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy