public FacturamaApi(string user, string password, string url) { var httpClient = new RestClient(url) { Authenticator = new HttpBasicAuthenticator(user, password) }; Clients = new ClientService(httpClient); Cfdis = new CfdiService(httpClient); Products = new ProductService(httpClient); BranchOffices = new BranchOfficeService(httpClient); Profile = new ProfileService(httpClient); TaxEntities = new TaxEntityService(httpClient); Series = new SerieService(httpClient); Catalogs = new CatalogService(httpClient); Store = new StoreService(httpClient); Charges = new ChargeService(httpClient); }
public FacturamaApi(string user, string password, bool isDevelopment = true) { var url = isDevelopment ? "https://apisandbox.facturama.mx/" : "https://api.facturama.mx/"; var httpClient = new RestClient(url) { Authenticator = new HttpBasicAuthenticator(user, password) }; Clients = new ClientService(httpClient); Cfdis = new CfdiService(httpClient); Products = new ProductService(httpClient); BranchOffices = new BranchOfficeService(httpClient); Profile = new ProfileService(httpClient); TaxEntities = new TaxEntityService(httpClient); Series = new SerieService(httpClient); Catalogs = new CatalogService(httpClient); }