У меня возникла проблема с получением authorize.net для выполнения транзакций по кредитным картам из моего приложения rails.Проблемы с API login/trans key с 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 и ключ Trans и оба правильные. Authorize.net установлен в режим тестирования на их конце, но я не думаю, что должно вызывать проблемы ...
любая помощь будет принята с благодарностью ...
, что весь ваш «response.message»? – Salil