Skip to content

Instantly share code, notes, and snippets.

@citrus
Created September 26, 2011 19:38
Show Gist options
  • Save citrus/1243183 to your computer and use it in GitHub Desktop.
Save citrus/1243183 to your computer and use it in GitHub Desktop.
Gateway::UsaEpay
# config/application.rb
module YourApp
class Application < Rails::Application
require 'spree_site'
# ...
end
end
# lib/spree_site.rb
module SpreeSite
class Engine < Rails::Engine
def self.activate
Gateway::UsaEpay.register
end
config.to_prepare &method(:activate).to_proc
end
end
# app/models/gateway/usa_epay.rb
class Gateway::UsaEpay < Gateway
preference :login, :string
def provider_class
ActiveMerchant::Billing::UsaEpayGateway
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment