/// <summary> /// Configures the authentication credentials instead of the constructor /// </summary> /// <param name="authCredential"></param> public static HttpRequestClient GetInstance(AuthCredential authCredential) { if (_instance == null) { _instance = new HttpRequestClient(authCredential); } return(_instance); }
/// <summary> /// nitialize a new instance of the <see cref="HttpRequestClient"/> class /// </summary> /// <param name="authCredential"></param> /// The authCredentail which contains apikey, password and mode as it fields private HttpRequestClient(AuthCredential authCredential) { this.AuthCredential = authCredential; this.HttpClient = new HttpClient(); if (this.AuthCredential.Mode == Mode.Production) { this.Constant = new Constant(true); } else { this.Constant = new Constant(false); } // Set the intial http Request parameters this.HttpClient.BaseAddress = new Uri(this.Constant.BaseUrl); SetRequestHeaders(); }
public Account(AuthCredential authCredential) { this.AuthCredential = authCredential; this.HttpRequestClient = HttpRequestClient.GetInstance(this.AuthCredential); }
public PaymentProvider(AuthCredential authCredential) { this.AuthCredential = authCredential; this.HttpRequestClient = HttpRequestClient.GetInstance(this.AuthCredential); }
public Transaction(AuthCredential authCredential) { this.AuthCredential = authCredential; this.HttpRequestClient = HttpRequestClient.GetInstance(this.AuthCredential); }