If your server requires HTTP requests to be made through a proxy, you can follow these steps to set up proxies for the server-side SDK.

Setup

Set a proxy address and port in your gateway:

Ruby
Copy
Copied
gateway = Braintree::Gateway.new(
  :environment => :sandbox,
  :merchant_id => "use_your_merchant_id",
  :public_key => "use_your_public_key",
  :private_key => "use_your_private_key",
  :proxy_address => "http://your-proxy-domain.com",
  :proxy_port => "8080",
)
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

To use an authenticated proxy, you can additionally specify a username and password:

Ruby
Copy
Copied
gateway = Braintree::Gateway.new(
  :proxy_user => "username",
  :proxy_pass => "password",
)
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

Still have questions?

If you can’t find an answer, contact our Support team