cancel
Showing results for 
Search instead for 
Did you mean: 

echeck integration

Can you please provide me the sample code for doing payment using echeck??its very urgent..

 

Thanks

minal_adit
Member
7 REPLIES 7

You can use the sample code provided for the Advanced Integration Method (AIM) to process AIM transactions which will also allow you to process echeck transactions. You just need to change a few of the parameters.


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
stymiee
Expert
Expert

Maybe this will be easier for you to use. Download the Authnet PHP Class from this tutorial and save it as AuthnetAIM.class.php. Here's sample code you would need to use it to process eChecks:

 

$total    = $_POST['total'];
$routing  = $_POST['routing'];
$account  = $_POST['acctnumber'];
$bankname = $_POST['bankname'];
$acctname = $_POST['acctname'];
switch ($_POST['accttype'])
{
    case 'Personal Checking':
        $accttype = 'checking';
        $echecktype = 'PPD';
        break;
    case 'Business Checking':
        $accttype = 'businessChecking';
        $echecktype = 'CCD';
        break;
    case 'Savings':
        $accttype = 'savings';
        $echecktype = 'PPD';
}

require_once('AuthnetAIM.class.php');
$payment = new AuthnetAIM();
$payment->setEcheck($total, $routing, $account, $accttype, $bankname, $acctname, $echecktype);
$payment->process();

 

You'll notice you'll need to create a form field that lets users choose what checking account type they are using called 'accttype' and then use PHP to use what they choose to set two of the parameters sent to Authnet to process the transaction. Also be sure to do proper data validation.


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post

I have tried this repeatedly and no matter what get the same error every time even when using a real 9-digit routing number:

 

exception 'AuthnetAIMException' with message 'AuthnetAIM::setEcheck() requires a nine digit ABA/routing number.'

I found the issue (I always do right after posting on forums...)

 

In the PHP class, it was missing a reference to a variable.

 

Wrong (and in current PHP class that I downloaded a few weeks ago):

 

 

    final public function setEcheck($aba, $account, $accttype, $bankname, $bankacctname, $echecktype, $transtype = 'AUTH_CAPTURE')

 

Right

 

 

 

    final public function setEcheck($amount, $aba, $account, $accttype, $bankname, $bankacctname, $echecktype, $transtype = 'AUTH_CAPTURE')

 

 

Can you please suggest me any reference  where I caould implement this in ASP.Net ?

John Conde:   

 

I tried to implement the code you provided in the blog post that I am responding to but it could not operate properly because  the amount is NOT included in the argument list of the setEcheck function ( of AuthnetAIM.class.php ) .  So the sample code does not match the downloadable library file.

 

I am trying to get some code to implement echeck on my web site, can you suggest or provide anything that I could use ?

 

 

Thank you,    Steve Padgett.