cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with accented characters

When trying to sumbit a payment transaction I get an error when using accented characters.

 

Here is the error I get in response: 


{ ErrorResponse:
{ '$':
{ 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
xmlns: 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' },
messages:
{ resultCode: 'Error',
message:
{ code: 'E00003',
text: 'Unexpected end of file has occurred. The following elements are not closed: createTransactionRequest. Line 1, position 971.' } } } }

SpectrumNet
Member
3 REPLIES 3

Hello @SpectrumNet

 

It would help if you provided your entire request with any sensitive information removed.

 

Richard

RichardH
Administrator Administrator
Administrator

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><createTransactionRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>****</name><transactionKey>**********</transactionKey></merchantAuthentication><transactionRequest><transactionType>authOnlyTransaction</transactionType><amount>1</amount><payment><creditCard><cardNumber>****************</cardNumber><expirationDate>0619</expirationDate><cardCode>***</cardCode></creditCard></payment><profile><createProfile>true</createProfile></profile><order><description>Card verification</description></order><customer><id>********</id><email>testinfo@test.com</email></customer><billTo><firstName>****</firstName><lastName>*******</lastName><company>Test</company><address>áá</address><city>Grandville</city><state/><zip>49323</zip><country/></billTo></transactionRequest></createTransactionRequest>

SpectrumNet
Member

That request should work as is. For example, here's what the request looks like if I take your same code, but just put valid values back in and send it as a straight HTTP request to our system:

 

POST /xml/v1/request.api HTTP/1.1
Host: apitest.authorize.net
Content-Type: application/xml
Cache-Control: no-cache

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><createTransactionRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
	<merchantAuthentication>
	    <name>{{loginID}}</name>
	    <transactionKey>{{transKey}}</transactionKey>
	</merchantAuthentication>
<transactionRequest><transactionType>authOnlyTransaction</transactionType><amount>1</amount><payment><creditCard><cardNumber>4111111111111111</cardNumber><expirationDate>0619</expirationDate><cardCode>123</cardCode></creditCard></payment><profile><createProfile>true</createProfile></profile><order><description>Card verification</description></order><customer><id>********</id><email>testinfo@test.com</email></customer><billTo><firstName>****</firstName><lastName>*******</lastName><company>Test</company><address>áá</address><city>Grandville</city><state/><zip>49323</zip><country/></billTo></transactionRequest></createTransactionRequest>

 

You can duplicate this also by inserting accented characters in the "Try it" tab in one of the transaction requests in our API Reference Guide and noticing that it works just fine. If something's failing, it's because whatever code you're using to generate the request is mangling the code somehow before it's getting sent. Chances are you need to set encoding within your code, or escape some characters or something like that.