Search code examples
ruby-on-railspaypalactivemerchant

How to require module extension code


My setup: Rails 3.0.9, Ruby 1.9.2

I need to extend Active Merchant module to include my own code, I'm following the article here http://blog.matthodan.com/how-to-add-support-for-paypal-website-payment

As per the article, I created paypal_recurring_payments.rb in /vendor/plugins/active_merchant/lib/active_merchant/billing/gateways/paypal/. Next I have to modify an Active Merchant gem file paypal.rb to add a line of code. The problem is that I can't deploy that code change to Heroku, so I need an alternate way of doing this. Any insights will be much appreciated.


Solution

    1. Fork the gem on github
    2. Make the appropriate change to your fork of the gem.
    3. Reference your fork in the Gemfile using the :git option. See the docs for examples.