コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: AvalaraCommand.cs プロジェクト: lauerya/headstart
        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);
        }