我有一个问题得到authorize.net从我的Rails应用程序运行信用卡交易。API登录/ trans密钥与ActiveMerchant和Authorize.net的问题
下面是在我的environment.rb
if ENV['RAILS_ENV'] != 'production'
::GATEWAY = gateway = ActiveMerchant::Billing::Base.gateway(:authorize_net).new(
:login => "scrubbed",
:password => "scrubbed")
else
::GATEWAY = gateway = ActiveMerchant::Billing::Base.gateway(:authorize_net).new(
:login => "scrubbed",
:password => "scrubbed", :test => 'true')
end
我下面的瑞恩·贝茨Railscast集成 - 这是在命令模式
def purchase
response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)
transactions.create!(:action => "purchase", :amount => price_in_cents, :response => response)
cart.update_attribute(:purchased_at, Time.now) if response.success?
response.success?
end
我已经调试了输出和一切似乎正确发送,但它返回以下错误:
GATEWAY.purchase(price_in_cents, credit_card, purchase_options)#<ActiveMerchant::Billing::Response:0x1066efda0 @fraud_review=false, @params={"response_reason_text"=>"The merchant login ID or password is invalid or the account is inactive.", "transaction_id"=>"0", "response_code"=>3, "response_reason_code"=>"13", "avs_result_code"=>"P", "card_code"=>nil}, @message="The merchant login ID or password is invalid or the account is inactive", @avs_result={"code"=>"P", "postal_match"=>"Y", "street_match"=>"N", "message"=>"Postal code matches, but street address not verified."}, @test=true, @authorization="0", @success=false, @cvv_result={"code"=>nil, "message"=>nil}>
我已经检查了API Key和Trans Key,两者都是正确的。 Authorize.net设置为自己的最终测试模式,但我不认为这应该引起这个问题...
任何帮助,将不胜感激......
什么是你的整个“response.message”时>真的吗? – Salil 2010-04-22 15:28:25