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

To configure a proxy, first initialize your Braintree gateway with your API credentials:

C♯
Copy
Copied
var gateway = new BraintreeGateway
              {
                  Environment = Braintree.Environment.PRODUCTION,
                  MerchantId = "braintree_merchant_id",
                  PublicKey = "braintree_public_key",
                  PrivateKey = "braintree_private_key"
              };

You can then set a proxy URL and port for your gateway configuration:

C♯
Copy
Copied
gateway.Configuration.WebProxy = new WebProxy("http://your-proxy-domain.com:8080");

To use an authenticated proxy, you can also pass in a custom proxy object with credentials:

C♯
Copy
Copied
var proxy = new WebProxy("http://your-proxy-domain.com:8080");
proxy.Credentials = new NetworkCredential("username", "password");
gateway.Configuration.WebProxy = proxy;

Still have questions?

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