1

我刚刚继承了一个有问题的狂欢项目。结账时,用户提供信用卡信息后,系统出现 rails 异常。我正在寻找有关可能需要登录参数的指导。我正在快速了解 spree 的工作原理,因此任何指导都会有所帮助。谢谢!

Started PUT "/checkout/update/payment" for 107.3.138.229 at 2012-09-28 08:52:11 -0700
Processing by Spree::CheckoutController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"XXXXXXX=", "order"=>{"payments_attributes"=>[{"payment_method_id"=>"2"}], "coupon_code"=>""}, "payment_source"=>{"2"=>{"number"=>"[FILTERED]", "month"=>"X", "year"=>"XXXX", "verification_value"=>"XXX", "first_name"=>"XXX", "last_name"=>"XXX"}}, "commit"=>"Save and Continue", "state"=>"payment"}
Completed 500 Internal Server Error in 464ms

ArgumentError (Missing required parameter: login):
  active_utils (1.0.4) lib/active_utils/common/requires_parameters.rb:11:in `block in requires!'
  active_utils (1.0.4) lib/active_utils/common/requires_parameters.rb:4:in `each'
  active_utils (1.0.4) lib/active_utils/common/requires_parameters.rb:4:in `requires!'
  activemerchant (1.20.4) lib/active_merchant/billing/gateways/authorize_net.rb:74:in `initialize'
  spree_core (1.1.3) app/models/spree/gateway.rb:25:in `new'
  spree_core (1.1.3) app/models/spree/gateway.rb:25:in `provider'
  spree_core (1.1.3) lib/spree/core/delegate_belongs_to.rb:82:in `delegator_for'
  spree_core (1.1.3) lib/spree/core/delegate_belongs_to.rb:44:in `block (2 levels) in delegate_belongs_to'
  spree_core (1.1.3) app/models/spree/payment/processing.rb:128:in `block in gateway_action'
  spree_core (1.1.3) app/models/spree/payment/processing.rb:172:in `protect_from_connection_error'
  spree_core (1.1.3) app/models/spree/payment/processing.rb:125:in `gateway_action'
  spree_core (1.1.3) app/models/spree/payment/processing.rb:22:in `authorize!'
  spree_core (1.1.3) app/models/spree/payment/processing.rb:11:in `process!'
  activerecord (3.2.8) lib/active_record/associations/collection_proxy.rb:89:in `each'
  activerecord (3.2.8) lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
  spree_core (1.1.3) app/models/spree/order.rb:380:in `process_payments!'
  spree_core (1.1.3) app/models/spree/order.rb:83:in `block (2 levels) in <class:Order>'
4

2 回答 2

1

我猜你的 authorize_net 模块没有提供所需的配置。和/或没有为您的环境提供配置(网关配置是基于每个环境提供的,因此如果您加载生产数据库配置并在开发中运行,您可能没有所需的配置)。

为了获得全局,authorize_net 模块是active_merchant gem(Shopify 的结帐模块)的一部分,并在spree_gateway中为 Spree 扩展,并且 active_merchant 的配置由 Spree 管理并存储在数据库中。

Spree 指南中提供了一个配置示例:

# gateway/authorize_net.rb
class Gateway::AuthorizeNet < Gateway
    preference :login, :string
    preference :password, :string

    def provider_class
        ActiveMerchant::Billing::AuthorizeNetGateway
    end
end

然后,您可以从管理面板设置登录名/密码或自动播种。

于 2012-10-01T01:06:21.653 回答
1

我在使用 autorize.net 网关作为我的付款方式时遇到了同样的问题。在我看到没有登录名和密码之前,由于这个 rails 异常来了。然后我在 authorize.net 上创建了测试帐户,并在管理员上设置了这个帐户登录 ID 和密钥authorize.net 配置和解决问题的一面。

      Card Not Present Test Account

          API Login ID 3cm2NkD3GyyyW

          Transaction Key 6v7CEMcRq5H74p5yyg   #as password

在提供测试帐户凭据之前,甚至与贝宝相同的错误

希望帮助别人

于 2012-11-23T11:52:36.863 回答