Skip to content

Instantly share code, notes, and snippets.

@matsubo
Created March 17, 2014 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsubo/9597473 to your computer and use it in GitHub Desktop.
Save matsubo/9597473 to your computer and use it in GitHub Desktop.
config/initializers/activemerchant_proxy.rb
unless Settings.activemerchant.proxy.host.blank?
module ActiveMerchant
class Connection
alias_method :http_original, :http
private
def http
proxy = Settings.activemerchant.proxy
http = Net::HTTP.new(endpoint.host, endpoint.port, proxy.host, proxy.port)
configure_debugging(http)
configure_timeouts(http)
configure_ssl(http)
configure_cert(http)
http
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment