我試圖爲Spree實施一個新的支付網關,ActiveMerchant(Elavon)支持該網關。在Spree的網站上,這似乎很微不足道,但似乎有一個我失蹤的步驟。我已經寫在/app/model/gateways/elavon.rb向Spree添加新的ActiveMerchant網關(Elavon)
class Gateway::Elavon < Gateway
preference :login, :string
preference :password, :string
preference :user, :string
def provider_class
ActiveMerchant::Billing::ElavonGateway
end
end
end
我猜的模型我缺少某種方式在啓動時加載該網關?我也相信我需要在加載時爲狂熱設置一個特定的設置,並且似乎也無法使其工作。
Spree::Config.set(:auto_capture, true)
我試過把它放在config/application.rb中,但無濟於事。
我甚至只使用這種寶石的嘗試: https://github.com/baracek/spree_elavon_gateway
當我嘗試啓動大禮包,我得到的錯誤:
/home/dave/.rvm/gems/ruby-1.9.2-p290/bundler/gems/spree_elavon_gateway-802ab1e3bf31/app/models/gateway/elavon.rb:1:in `<top (required)>': wrong argument type Module (expected Class) (TypeError)
任何幫助或指針是極大的讚賞。
任何成功?我已經創建了自己的網關,但使用了主動式商家,現在我需要將這筆新款與我的熱潮結合起來,而且我迷路了。 – Gerep 2013-08-07 17:10:58