【发布时间】: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