Showing results for 
Search instead for 
Did you mean: 

Error 57 Giving me trouble

I am using uniCenta, an open source solution, that integrated your JAVA SDK.  The oPOS has some 13000 users and I find it hard to believe that I am the first to use Authorize.Net  I searched the forums and did not find uniCenta mentioned.


When I run the software in Test mode with a developer API ID etc, I receive an email with: Response : This transaction approved.


When I run the software in Live mode with a real API ID and tranaction key I get error 57 Error during processing transaction. This error code is shown inside the software.



I am aware that code 57 suggests that some field is left blank. (Which ones?)

I am aware that code 57 is sent to Lightspeed POS when they have the x_market_type set wrong. (How do I find that?)
I am aware that the message suggest to contact the merchant service provide - and we have. 


An Auth.Net tech support agent also run a test from within your virtual terminal and the transaction was apporpriately declined suggesting that your settings match the merchant service provider. 


So all that said, it seems to point the POS software.


However, when I look at the transaction detail provided when logged in as a merchant, I do not see any missing fields.  Obviously I can not see all the required fields in that table as required in the Min Field list.


Below is a transaction with the error.  Can someone look at tranaction data stream and tell me what is going on?


Transaction ID: 4122569184
Transaction Status: General Error  (Processor error - An error occurred during authorization. If these errors persist, contact merchant service provider)
Settlement Information
Settlement Amount:USD 2.38
Settlement Date and Time:20-Jan-2012 17:27:23
Business Day:20-Jan-2012
Batch ID:179178369

The Response Reason Code Tool had this to say:


Integration Team Suggestions: This error is caused when a transaction is passed and a required field is left blank.

The Secure Source account you have set up with Wells Fargo specifies certain required information in order to process transactions. These are the required fields for credit card transactions:

First Name
Last Name
Zip Code
Phone OR Email

eCheck.Net® transactions require all of the above requirements, plus the following:

Bank Name
Account #
ABA Routing Code
(Driver's License # AND Driver's License State AND Date of Birth on Driver's License) OR (Customer Organization Type (I-individual B-business) AND Customer SSN)


The information you provided doesn't say whether you may have left any of that out or not?


Thanks TJ for the response.


I am very aware of the Response Reason Code's answer.


I do not have a Secure Source account with Wells Fargo.


And no, I do not supply all those fields. This is a card present account in a Retail/Restaurant environment.


Based on the Min Required Fields (page 13) of the Card Present Guide those fields are not required.


I even allowed a tech inside the company to run a transaction from within their virtual terminal that did not supply those fields either.  Their transaction passed.


I am seeking inside help to tell me about the data stream. This does not see to be an account settings. This seems to be a data stream of items taht are not shown in the customer records.

About all I can suggest is to (a) find where in the Java SDK the data is actually sent to, and backtrack from there until you find where things are going wrong, or (b) contact the authors of your software and get tech support from them. Never seen this particular problem before, and the chances of us being able to identify it with this amount of information are rather low.

what more info do you need.


I have been told that we are set up as Retail, Card Present, Resaurant


Here is the java code.  I am not a Java specific programmer but the code seems pretty eazy to read and compare against the Card Present specs


 * <p>Title: AIM Java Version 1.4.1_02-b06</p>
 * <p>Description: Advanced Integration Method</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: Authorize.Net</p>
 * @author Authorize.Net
 * @version 3.1

 *  Based on sample code and snipptes provided by:
 *  Patrick Phelan,
 *  Roedy Green, Canadian Mind Products

// Modifications by Adrian Romero & Mikel Irurita

package com.openbravo.pos.payment;

import java.text.NumberFormat;
import java.text.DecimalFormat;

import com.openbravo.pos.forms.*;
import com.openbravo.pos.util.AltEncrypter;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class PaymentGatewayAuthorizeNet implements PaymentGateway {
    private static String ENDPOINTADDRESS;
    private static final String OPERATIONVALIDATE = "AUTH_CAPTURE";
    private static final String OPERATIONREFUND = "CREDIT";
    private static final String APPROVED = "1";
    private String m_sCommerceID;
    private String m_sCommercePassword;
    private boolean m_bTestMode;

    /** Creates a new instance of PaymentGatewayAuthorizeNet */
    public PaymentGatewayAuthorizeNet(AppProperties props) {
        // Grab some configuration variables
        m_sCommerceID = props.getProperty("payment.commerceid");
        AltEncrypter cypher = new AltEncrypter("cypherkey" + props.getProperty("payment.commerceid"));
        this.m_sCommercePassword = cypher.decrypt(props.getProperty("payment.commercepassword").substring(6));

        m_bTestMode = Boolean.valueOf(props.getProperty("payment.testmode")).booleanValue();
        ENDPOINTADDRESS = (m_bTestMode)
                ? ""
                : "";
    public PaymentGatewayAuthorizeNet() {

    public void execute(PaymentInfoMagcard payinfo) {

        StringBuffer sb = new StringBuffer();
        try {
            //test -> login:44CWBFp7wh9 / pass:43P7s8qb84CVT9Jx
            sb.append(URLEncoder.encode(m_sCommerceID, "UTF-8"));

            sb.append(URLEncoder.encode(m_sCommercePassword, "UTF-8"));
            NumberFormat formatter = new DecimalFormat("0000.00");
            String amount = formatter.format(Math.abs(payinfo.getTotal()));
            sb.append(URLEncoder.encode(amount.replace(',', '.'), "UTF-8"));
            if (payinfo.getTrack1(true) == null) {
                sb.append(URLEncoder.encode(payinfo.getCardNumber(), "UTF-8"));

                String tmp = payinfo.getExpirationDate();
                sb.append(URLEncoder.encode(tmp, "UTF-8"));

                String[] cc_name = payinfo.getHolderName().split(" ");
                if (cc_name.length > 0) {
                   sb.append(URLEncoder.encode(cc_name[0], "UTF-8"));
                if (cc_name.length > 1) {
                   sb.append(URLEncoder.encode(cc_name[1], "UTF-8"));
            } else {
                // Example Track1
                // %B4111111111111111^PADILLA VISDOMINE/LUIS^0905123000000000000002212322222?5
            if (payinfo.getTotal() >= 0.0) {
                //sb.append("&x_card_code=340"); //CCV
            else {

            // open secure connection
            URL url = new URL(ENDPOINTADDRESS);

            URLConnection connection = url.openConnection();

            // not necessarily required but fixes a bug with some servers

            // POST the data in the string buffer
            DataOutputStream out = new DataOutputStream(connection.getOutputStream());

            // process and read the gateway response
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String returned = in.readLine();
            in.close(); // fin
            AuthorizeNetParser anp = new AuthorizeNetParser(returned);
            Map props = anp.splitXML();
            if (anp.getResult().equals(LocalRes.getIntString("button.ok"))) {
                if (APPROVED.equals(props.get("ResponseCode"))) {
                    //Transaction approved
                    payinfo.paymentOK((String) props.get("AuthCode"), (String) props.get("TransID"), returned);
                } else {
                    StringBuilder errorLine = new StringBuilder();
                    //Transaction declined
                    if (anp.getNumErrors()>0) {
                        for (int i=1; i<=anp.getNumErrors(); i++) {
                            errorLine.append(": ");
                    payinfo.paymentError(AppLocal.getIntString("message.paymenterror"), errorLine.toString());
            else {
                payinfo.paymentError(anp.getResult(), "");
        } catch (UnsupportedEncodingException eUE) {
            payinfo.paymentError(AppLocal.getIntString("message.paymentexceptionservice"), eUE.getMessage());
        } catch (MalformedURLException eMURL) { 
            payinfo.paymentError(AppLocal.getIntString("message.paymentexceptionservice"), eMURL.getMessage());
        } catch(IOException e){
            payinfo.paymentError(AppLocal.getIntString("message.paymenterror"), e.getMessage());
    private class AuthorizeNetParser extends DefaultHandler {
    private SAXParser m_sp = null;
    private Map props = new HashMap();
    private String text;
    private InputStream is;
    private String result;
    private int numMessages = 0;
    private int numErrors = 0;
    public AuthorizeNetParser(String input) {
        is = new ByteArrayInputStream(input.getBytes());
    public Map splitXML(){
        try {
            if (m_sp == null) {
                SAXParserFactory spf = SAXParserFactory.newInstance();
                m_sp = spf.newSAXParser();
            m_sp.parse(is, this);
        } catch (ParserConfigurationException ePC) {
            result = LocalRes.getIntString("exception.parserconfig");
        } catch (SAXException eSAX) {
            result = LocalRes.getIntString("exception.xmlfile");
        } catch (IOException eIO) {
            result = LocalRes.getIntString("exception.iofile");
        result = LocalRes.getIntString("button.ok");
        return props;
    public void endElement(String uri, String localName, String qName) throws SAXException {
        try {
            if (qName.equals("ResponseCode")) {
                props.put("ResponseCode", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("ErrorCode")){
                props.put("ErrorCode"+Integer.toString(numErrors), URLDecoder.decode(text, "UTF-8"));
                text = "";
            } else if (qName.equals("ErrorText")) {
                props.put("ErrorText"+Integer.toString(numErrors), URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("Code")) {
                props.put("Code"+Integer.toString(numMessages), URLDecoder.decode(text, "UTF-8"));
                text = "";
            } else if (qName.equals("Description")) {
                props.put("Description"+Integer.toString(numMessages), URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("AuthCode")) {
                props.put("AuthCode", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("AVSResultCode")) {
                props.put("AVSResultCode", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("CVVResultCode")) {
                props.put("CVVResultCode", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("TransID")) {
                props.put("TransID", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("RefTransID")) {
                props.put("RefTransID", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("TransHash")) {
                props.put("TransHash", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("TestMode")) {
                props.put("TestMode", URLDecoder.decode(text, "UTF-8"));
            } else if (qName.equals("UserRef")) {
                props.put("UserRef", URLDecoder.decode(text, "UTF-8"));
        catch(UnsupportedEncodingException eUE){
            result = eUE.getMessage();
    public void startDocument() throws SAXException {
        text = new String();

    public void endDocument() throws SAXException {
    public void characters(char[] ch, int start, int length) throws SAXException {
        if (text!=null) {
            text = new String(ch, start, length);
    public String getResult(){
        return this.result;
    public int getNumErrors(){
        return numErrors;
    public int getNumMessages(){
        return numMessages;


I could be wrong, as I'm not familiar with Java integration, but this doesn't look like it's using a recent version of the Java SDK. It's constructing a raw query string to pass to and then XML parsing the response. Can you run a transaction through and print out the contents of sb just before this line?


And then both the XML and the split result from this:

Map props = anp.splitXML();

This will make it a lot easier to verify if something is missing or improperly formatted or whatever.



This error is caused on Global Card Present merchants if the merchant's POS software submits an x_device_type value of 1 (unknown).  The reason that this occurs, is that Global does not actually accept this value.  If the POS software provider changes that value to something different, such as 2 (unattended terminal), or 5 (PC based terminal), it should be fine.  A list of these values can be found on pages 15 and 16 of the CP Integration guide. Please note that Global is the type of processor used on this account based on the transaction ID provided on the thread.




Administrator Administrator

I'm thinking that the vast majority of posts on this forum could be solved simply by having more complete lists of what error codes could actually mean in the Response Reason Code Tool.

Sorry to resurrect an old thread on my first post, but this is why I came here. is passing the transaction to MSI, but it's denied.  So far the information I have either gathered myself, or been given to by reps of both and MSI, is the following....


Payment transaction error!

30: Configuration with processor is invalid.  Call Merchant Service provider.


82: Cashback not approved.  Cashback limit exceeded.


CVV invalid


VAR sheet has been given to us and verified with as being correct.  The card used for testing was not used as a debit card, as there is no option for it in uniCenta I've yet seen.  No requests for cashback were made.  The openbravo/unicenta EMS & oPOS projects have listed as a supported gateway.  It was the openbravo faq that I found the link to the test account.  The test account worked fine in unicenta, but not the account we just set up with



Does this x_device_type value issue not exist with other processors?  If not, could you suggest a merchant?