Ruby on rails rails.net问题

Ruby on rails rails.net问题,ruby-on-rails,transactions,authorize.net,activemerchant,Ruby On Rails,Transactions,Authorize.net,Activemerchant,我在我的电子商务网站上有一个用于CC处理的Authorize.net帐户,我使用ActiveMerchant授权交易。直到不久前,它还工作得很好,然后就停止了。我不明白为什么。当我在测试模式下运行它时,它工作正常,创建了事务并成功地授权了资金。但当我尝试使用real account时,它失败了。当我从控制台运行它时,下面是代码: cc_hash = :first_name => 'Donald', :last_name => 'Duck',

我在我的电子商务网站上有一个用于CC处理的Authorize.net帐户,我使用ActiveMerchant授权交易。直到不久前,它还工作得很好,然后就停止了。我不明白为什么。当我在测试模式下运行它时,它工作正常,创建了事务并成功地授权了资金。但当我尝试使用real account时,它失败了。当我从控制台运行它时,下面是代码:

cc_hash =
  :first_name         => 'Donald',
  :last_name          => 'Duck',
  :number             => '4007000000027',
  :month              => '8',
  :year               => Time.now.year+1,
  :verification_value => '000'
}
card = ActiveMerchant::Billing::CreditCard.new(cc_hash)

#--- valid?
RYeller.bar
if card.valid?
  puts "card valid"
else
  puts "card not valid"
end

#ActiveMerchant::Billing::Base.mode = :test
#gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(:login=>'scrubbed',:password=>'scrubbed')

ActiveMerchant::Billing::Base.mode = :production
gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(:login=>'scrubbed',:password=>'scrubbed')

amount  = rand(1000)+2500 
options = {}
options[:order_id]    = "WEBSITE 26"
options[:description] = 'WEBSITE TEST'

#--- authorize transaction
response = gateway.authorize(amount, card, options)
puts response.inspect
当我在测试模式下运行它时,在我的沙盒帐户(上面代码中注释掉的两行代码)中,它工作得很好。当我在我的真实帐户上运行它时(代码如上所示)-我得到一个错误:“处理过程中发生错误。请致电商户服务提供商。”完整响应哈希为:

#<ActiveMerchant::Billing::Response:0x1078607d8 @fraud_review=false, @params={"response_reason_code"=>"35", "avs_result_code"=>"P", "transaction_id"=>"scrubbed", "response_code"=>2, "response_reason_text"=>"An error occurred during processing. Call Merchant Service Provider.", "card_code"=>"P"}, @message="An error occurred during processing. Call Merchant Service Provider", @authorization="scrubbed", @test=false, @cvv_result={"message"=>"Not Processed", "code"=>"P"}, @success=false, @avs_result={"message"=>"Postal code matches, but street address not verified.", "street_match"=>nil, "postal_match"=>"Y", "code"=>"P"}>
#“35”、“avs#u result#u code”=>“P”、“transaction#u id”=>“scrobed”、“response#u code”=>2、“response#u reason#text”=>“处理过程中出错。呼叫商户服务提供商”、@authorization=“scrobed”、@test=false、@cvv#result=>“message”=>“未处理”、“代码”=>“P”}、@success=false、@avs_result={“消息”=>“邮政编码匹配,但街道地址未验证。”、“街道匹配”=>nil、“邮政匹配”=>“Y”、“代码”=>“P”}>
我正在使用测试CC编号和卡。有效吗?测试返回true

当我在Authorize.net中查看事务时,我看到所有创建的事务和所有正确的信息,但是事务代码是一般错误


有什么想法吗?非常感谢您的帮助,我已经筋疲力尽了。您的产品Authorize.net是否处于测试模式?如果没有,Donanld Duck将无法使用假信用卡结账

您应该能够登录到production Authorize.net帐户,并将测试订单视为拒绝。如果您这样做,则一切正常,您需要使用真卡进行测试以获得成功的交易。如果您想使用假卡进行测试,则需要将您的生产帐户重新设置为测试