In using the .NET compiled .dll from NuGet it seems the endpoint is hard coded in. Is there a method to passin the endpoint? Such as from an appsettings key? Thx
07-27-2017 11:34 AM
Are you trying to set the environment, sandbox or production?
Richard
07-27-2017 11:43 AM
Yes
What is was asking is there a method to pass the EndPoint URL string in?
It looks to be hard coded in.
Thx
G
07-27-2017 01:20 PM
string baseUrl = "YOUR_BASE_URL"; string xmlBaseUrl = "YOUR_XML_BASE_URL"; AuthorizeNet.Environment.createEnvironment(baseUrl, xmlBaseUrl);
As @RichardH referenced, Sandbox and Production URLs are already declared in Environment.cs
public class Environment { public static readonly Environment SANDBOX = new Environment("https://test.authorize.net", "https://apitest.authorize.net", "https://test.authorize.net"); public static readonly Environment PRODUCTION = new Environment("https://secure2.authorize.net","https://api2.authorize.net","https://cardpresent.authorize.net");
So just by changing
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
to
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.PRODUCTION;
you are effectively passing in the alternate URL.
07-27-2017 02:28 PM - edited 07-27-2017 02:39 PM