2011-10-23 32 views
0

我使用activemerchant在這樣ActiveMerchant需要引腳?

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

Rails應用程序,當我看到錯誤代碼(10117)爲usaepay我不斷收到此錯誤代碼

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

我注意到,我需要進入引腳。我有,但我不知道如何實施。我想這兩個以下

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庫的初始化我看到登錄,但不改變引腳

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

...任何想法我怎麼能送這個引腳到Activemerchant

UPDATE

這裏是我的電話給transa ction

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) 

,但仍然沒有

回答

1

也許你需要的授權銷傳遞到交易。您可以將代碼粘貼到您要求交易的地方嗎?

例如,調用此方法:capture(money, authorization, options = {})

編輯:

我不認爲ActiveMerchant已實現了引腳功能。以下是您的選項:

  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" 
) 
+0

肯定讓我更新我在我的問題粘貼問題 – Trace

+0

...讓我知道如果有什麼我可以給你幫我 – Trace

+0

再次感謝你的幫助 – Trace