【问题标题】:ActiveMerchant requiring pin?ActiveMerchant 需要密码?
【发布时间】:2011-12-13 15:00:03
【问题描述】:

我在这样的 Rails 应用程序中使用 activemerchant

ActiveMerchant::Billing::Base.mode = :test
::GATEWAY = ActiveMerchant::Billing::UsaEpayGateway.new(
  :login => "SOMEKEY"
)

我不断收到此错误代码

error_code: \"10117\"\nauth_code: \"000000\"\nstatus: Error\nerror: Transaction authentication required.\n

当我查看usaepay 的错误代码 (10117) 时,我注意到我需要输入密码。这个我有,但我不知道如何实现。我在下面尝试了这两个

ActiveMerchant::Billing::Base.mode = :test
::GATEWAY = ActiveMerchant::Billing::UsaEpayGateway.new(
  :login => "SOMEKEY",
  :password => "MYPIN"
)

ActiveMerchant::Billing::Base.mode = :test
::GATEWAY = ActiveMerchant::Billing::UsaEpayGateway.new(
  :login => "SOMEKEY",
  :pin => "MYPIN"
)

我仍然遇到同样的错误 查看 USAEPAY 库的初始化程序,我看到登录但没有 pin

  def initialize(options = {})
    requires!(options, :login)
    @options = options
    super
   end  

...任何想法我可以如何将此 pin 发送到 Activemerchant

更新

这是我对交易的调用

options = {
  :card_code=>self.card_verification
  :billing_address=>{
    :address1=>self.billing_address,
    :city=>self.city,
    :state=>self.state,
    :zip=>self.zip,
    :country=>"US"
  }
}
response = GATEWAY.purchase(price_in_cents, credit_card, options)

我试过这样做

options = {
  :card_code=>self.card_verification,
  :pin=>"333333",
  :billing_address=>{
    :address1=>self.billing_address,
    :city=>self.city,
    :state=>self.state,
    :zip=>self.zip,
    :country=>"US"
  }
}
response = GATEWAY.purchase(price_in_cents, credit_card, options)

还是什么都没有

【问题讨论】:

    标签: ruby-on-rails ruby credit-card activemerchant


    【解决方案1】:

    也许您需要将授权密码传递给交易。请把代码粘贴到你调用交易的地方好吗?

    比如调用这个方法:capture(money, authorization, options = {})

    编辑:

    我认为 ActiveMerchant 没有实现 pin 功能。以下是您的选择:

    1. 使用另一个脚本。以下是一些示例:http://wiki.usaepay.com/developer/ruby
    2. 将此添加到您的 Gemfile:gem 'activemerchant', :git => 'git://github.com/kalinchuk/active_merchant.git' 它会从我的 github 帐户安装一个 gem。我将 pin 字段添加到活跃的商家。

    然后您可以调用:

    ::GATEWAY = ActiveMerchant::Billing::UsaEpayGateway.new(
        :login => "SOMEKEY",
        :pin => "PIN"
    )
    

    【讨论】:

    • 粘贴在我的问题中...如果还有什么可以帮助我的,请告诉我
    猜你喜欢
    • 2021-09-23
    • 2016-03-25
    • 2012-10-03
    • 1970-01-01
    • 2011-06-17
    • 2017-11-28
    • 1970-01-01
    • 2015-08-27
    • 2013-02-08
    相关资源
    最近更新 更多