我正在尝试将payu.in支付网关集成到我的rails应用程序中。 我已经在应用程序中集成了他们的gem,但是当我去
时/ admin / payment_methods / new
我无法在提供商选项下看到付款网关。
我已遵循http://guides.spreecommerce.com/payment_gateways.html
中规定的步骤我的app / models / spree / gateway / payu.rb如下所示:
module Spree
class Gateway::Payu < Gateway
def provider_class
ActiveMerchant::Billing::Integrations::PayuIn
end
end
end
答案 0 :(得分:4)
我相信你需要这样的东西:
config.after_initialize do |app|
app.config.spree.payment_methods += [
Spree::BillingIntegration::PaypalExpress,
Spree::BillingIntegration::PaypalExpressUk
]
end
(参见:https://github.com/spree/spree_paypal_express/blob/master/lib/spree_paypal_express/engine.rb#L23-28)
答案 1 :(得分:1)
对我而言,当我添加类似代码时,它才起作用:
config.after_initialize do
Rails.configuration.spree.payment_methods << Spree::PaymentMethod::Pagarme
end
到我的config / application.rb文件。