CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Authorize.net Error Solutions
Pages: [1]

Author Topic: Authorize.net Error Solutions  (Read 555 times)

Keith

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Authorize.net Error Solutions
September 08, 2010, 02:45:59 pm
I am using the authorize.net implementation on IIS7 with php5.2.9. I had all kinds of problems. Finally got them all solved (at least for my server and my gateway). I spent the better part of one day working on this so perhaps these items will help someone. Your gateway may work differently and thus not need any modifications.

Modifications made to CRM/core/payment/AuthorizeNet.php

1. Windows needs to know about the ca cert location. It was not available on my machine. So, I downloaded the file here: http://curl.haxx.se/ca/cacert.pem I placed it in a folder on my system and then added the following line (around 110).

        curl_setopt( $submit, CURLOPT_POST, true );  // existing
        curl_setopt( $submit, CURLOPT_RETURNTRANSFER, true );  // existing
        curl_setopt( $submit, CURLOPT_POSTFIELDS, implode( '&', $postFields ) ); // existing line
        curl_setopt( $submit, CURLOPT_CAINFO, 'c:\\inetpub\\certs\\cacert.pem');  // added line with my file location

Since we are not using recurring payments, I didn't add the line under the recurring payment function. Probably needs to go there as well.

2. My gateway requires a version number be sent so I added a line around 280

        $fields['x_amount']         = $this->_getParam( 'amount' );
        $fields['x_currency_code']  = $this->_getParam( 'currencyID' );
        $fields['x_description']    = $this->_getParam( 'description' );
        $fields['x_version']        = '3.1';  // added line

3. My gateway didn't like the expiration date as mm/yyyy, but wanted it as mmyy so I changed (around 290)
$fields['x_exp_date']       = "$exp_month.$exp_year";
to
$fields['x_exp_date']       = $exp_month.substr($exp_year,2,2);

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Authorize.net Error Solutions

This forum was archived on 2017-11-26.