예제 #1
0
 public MBillsAPIFacade()
 {
     httpClient       = new HttpClient();
     authenticator    = new MBillsAuthenticator(httpClient);
     this.apiRootPath = GAppSettings.Get("TEST_ENDPOINT", null);
     if (this.apiRootPath == null)
     {
         throw new Exception("TEST_ENDPOINT variable was not defined in the configuration file");
     }
 }
        public MBillsAuthenticator(HttpClient client)
        {
            string apiKey        = GAppSettings.Get("TEST_APIKEY");
            string secretKey     = GAppSettings.Get("TEST_SECRETKEY");
            string endpoint      = GAppSettings.Get("TEST_ENDPOINT");
            string publicKeyPath = GAppSettings.Get("TEST_PUBLICKEYFILEPATH");

            validator   = new MBillsSignatureValidator(publicKeyPath, apiKey);
            authGen     = new MBillsAuthHeaderGenerator(apiKey, secretKey);
            this.client = client;
        }