5

I am trying to integrate payu.in payment gateway into my rails app. I have integrated their gem in the application but when i go to

/admin/payment_methods/new

I am not able to see the payment gateway under the provider options.

I have followed the steps as prescribed in http://guides.spreecommerce.com/payment_gateways.html

My app/models/spree/gateway/payu.rb looks like this:

module Spree
  class Gateway::Payu < Gateway
    def provider_class
      ActiveMerchant::Billing::Integrations::PayuIn
    end
  end
end
Shadwell
  • 34,314
  • 14
  • 94
  • 99
phoenixwizard
  • 5,079
  • 7
  • 27
  • 38
  • did u get this thing working,, i integrated like mentioned above in question and now i am getting error (NoMethodError in Spree::CheckoutController#update. undefined method `authorize' for ActiveMerchant::Billing::Integrations::PayuIn:Module) – Dave Jun 18 '14 at 16:02

2 Answers2

4

I believe you need something like this:

config.after_initialize do |app|
  app.config.spree.payment_methods += [
    Spree::BillingIntegration::PaypalExpress,
    Spree::BillingIntegration::PaypalExpressUk
  ]
end

(See: https://github.com/spree/spree_paypal_express/blob/master/lib/spree_paypal_express/engine.rb#L23-28 )

GeekOnCoffee
  • 1,155
  • 5
  • 15
1

For me it just worked when I added a similar line of code:

config.after_initialize do
  Rails.configuration.spree.payment_methods << Spree::PaymentMethod::Pagarme
end

To my config/application.rb file.

(I saw it in http://blog.siyelo.com/active-merchant-and-spree)