- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.' } } } }
โ07-26-2017 05:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @SpectrumNet
It would help if you provided your entire request with any sensitive information removed.
Richard
โ07-26-2017 05:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<?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>
โ07-26-2017 06:13 AM - edited โ07-26-2017 06:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
โ07-31-2017 11:17 AM