Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
        /// <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();
        }
Exemplo n.º 3
0
 public Account(AuthCredential authCredential)
 {
     this.AuthCredential    = authCredential;
     this.HttpRequestClient = HttpRequestClient.GetInstance(this.AuthCredential);
 }
Exemplo n.º 4
0
 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);
 }