How to do recurring with bank account payment mode using authorized.net

Posted by Salil on Stack Overflow See other posts from Stack Overflow or by Salil
Published on 2010-04-23T08:11:15Z Indexed on 2010/04/23 8:13 UTC
Read the original article Hit count: 369

Hi All,

I am using recurring facility of authorized.net using active_merchant plugin in rails. there are two payment method for this

1] Credit Card
2] Bank Account

I successfully done it using Credit Card

For Recurring i need my Test Mode off. Also my E-check, credit card processing, and subscriptions are all enabled.

But i am not able to subscribed using Bank Account

Following is my code

ActiveMerchant::Billing::Base.mode = :developer

#i found follwing test bank account on net
    account  = ActiveMerchant::Billing::Check.new(:account_holder_type=>"personal",:account_number=>"123123123", :account_type => "savings", :name=>"name", :routing_number=>"244183602")

    if account.valid? #this comes true
      gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(:login => 'Mylogin', :password => 'Mypassword')
      response = gateway.recurring( amount, nil, {:interval =>{:length=>@length, :unit =>:months},
                                        :duration =>{:start_date=>'2010-04-24', :occurrences=>1},
                                        :billing_address=>{:first_name=>'dinesh', :last_name=>'singh'},
                                        :bank_account=>{:account_holder_type=>"personal",:account_number=>"123123123", :account_type => "savings", :name_of_account=>"name", :routing_number=>"244183602"}
                                       })

if response.success?  #this comes false

  else
    puts response.message   ####>> ERROR
    render :action=>"account_payment"
  end

I get Follwing ERROR when i debug for response.message

"The test transaction was not successful. (128) This transaction cannot be processed."

Am i doing anything wrong i search for the another Test Bank Account Data but i didn't find it.

Please help I badly need it. Thanks in Advance.

Regards,

Salil Gaikwad

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activemerchant