LemonStand Forum: Authorize.net AIM - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Authorize.net AIM XML response?

#1 User is offline   robertbanh 

  • LemonFan
  • PipPipPipPipPip
  • Group: Members
  • Posts: 61
  • Joined: 13-July 11

Posted 13 April 2012 - 07:04 PM

I'm using Authorize.net (AIM) and I noticed the response is returning this error:

@AJAX-ERROR@(TESTMODE) Transactions of this market type cannot be processed on this system.

I was able to fix it by adding these 2 extra fields in the send request:

// add to process_payment_form() method
$fields['x_market_type'] = '2';
$fields['x_device_type'] = '8';


Then I noticed all the response is coming back as XML. So I had to convert the response:

$xml = @simplexml_load_string($response_fields[0], 'SimpleXMLElement', LIBXML_NOCDATA);
$re_code = (string) $xml->ResponseCode;
if ($re_code != '1')
{
    $errors = '';
    foreach ($xml->Errors as $e)
    {
        $msg = (string) $e->Error->ErrorText;
        $errors .= str_replace('<br/>', "\n", $msg);
    }
    throw new Phpr_ApplicationException($errors);
}

/*
 * Successful payment. Set order status and mark it as paid.
 */

$this->log_payment_attempt(
    $order, 
    'Successful payment', 
    1, 
    $this->prepare_fields_log($fields), 
    $response_fields, 
    $response,
    (string) $xml->CVVResultCode,
    $this->get_ccv_status_text((string) $xml->CVVResultCode),
    (string) $xml->AVSResultCode,
    $this->get_avs_status_text((string) $xml->AVSResultCode)
);

/*
 * Log transaction create/change
 */
$this->update_transaction_status(
    $host_obj, 
    $order, 
    (string) $xml->TransID,
    $this->get_status_name((string) $xml->ResponseCode),
    (string) $xml->ResponseCode
    );



Is anyone else seeing this problem? Either Authorize.net updated their API, or it's something I'm doing since my setup is always a bit different than the base install.
0

#2 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 4,066
  • Joined: 31-October 09

Posted 15 April 2012 - 03:22 PM

Hi Robert,

Yes, it is weird. I suspect that it relevant to the Authorize.Net account configuration. x_market_type is a field which belongs to the Card Present integration type: http://developer.aut...i/cardpresent/. AIM integration type doesn't include this field.

Thank you

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users