Railsでactive_merchantプラグインを使用して、authorized.netの繰り返し機能を使用しています。これには2つの支払い方法があります
1] Credit Card
2] Bank Account
クレジットカードを使って成功しました
繰り返しの場合、テストモードをオフにする必要があります。また、電子小切手、クレジット カード処理、サブスクリプションがすべて有効になっています。
しかし、銀行口座を使用して購読することはできません
以下は私のコードです
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
response.message をデバッグすると、Followwing ERRORが発生します。
"The test transaction was not successful. (128) This transaction cannot be processed."
別のテスト銀行口座データを検索しましたが、見つかりませんでした。