public async Task <TaxCertificate> UpdateCertificateAsync(int certificateID, TaxCertificate cert, Address buyerLocation) { var companyID = _settings.CompanyID; var certificate = _avaTax.UpdateCertificateAsync(companyID, certificateID, TaxCertificateMapper.Map(cert, buyerLocation, companyID)); var pdf = GetCertificateBase64String(companyID, certificateID); var mappedCertificate = TaxCertificateMapper.Map(await certificate, await pdf); return(mappedCertificate); }
public async Task <TaxCertificate> GetCertificateAsync(int certificateID) { var companyID = _settings.CompanyID; var certificate = _avaTax.GetCertificateAsync(companyID, certificateID, ""); var pdf = GetCertificateBase64String(companyID, certificateID); var mappedCertificate = TaxCertificateMapper.Map(await certificate, await pdf); return(mappedCertificate); }
public async Task <TaxCertificate> CreateCertificateAsync(TaxCertificate cert, Address buyerLocation) { var companyID = _settings.CompanyID; var certificates = await _avaTax.CreateCertificatesAsync(companyID, false, new List <CertificateModel> { TaxCertificateMapper.Map(cert, buyerLocation, companyID) }); var pdf = await GetCertificateBase64String(companyID, certificates[0].id ?? 0); var mappedCertificate = TaxCertificateMapper.Map(certificates[0], pdf); return(mappedCertificate); }
public async Task <TaxCertificate> GetCertificateAsync(int certificateID) { if (ShouldMockAvalaraResponse()) { return(CreateMockTaxCertificate()); } var companyID = _settings.CompanyID; var certificate = _avaTax.GetCertificateAsync(companyID, certificateID, ""); var pdf = GetCertificateBase64String(companyID, certificateID); var mappedCertificate = TaxCertificateMapper.Map(await certificate, await pdf); return(mappedCertificate); }