Esempio n. 1
0
 public async Task <DraftMeta> UpdateDraftMetaAsync(
     Guid accountId,
     Guid draftId,
     DraftMetaRequest newMeta,
     TimeSpan?timeout = null) =>
 await client.SendRequestAsync <DraftMeta>(
     HttpMethod.Put,
     $"/v1/{accountId}/drafts/{draftId}/meta",
     contentDto : newMeta,
     timeout : timeout);
        public override async Task SetUp()
        {
            InitializeClient();
            Account = (await Client.Accounts.GetAccountsAsync(0, 1)).Accounts[0];
            var cert = (await Client.Accounts.GetAccountCertificatesAsync(Account.Id)).Certificates[0];

            validDraftMetaRequest = new DraftMetaRequest
            {
                Payer = new AccountInfoRequest
                {
                    Inn          = cert.Inn,
                    Organization = new OrganizationInfoRequest {
                        Kpp = cert.Kpp
                    }
                },
                Sender = new SenderRequest
                {
                    Inn         = cert.Inn,
                    Kpp         = cert.Kpp,
                    IpAddress   = "8.8.8.8",
                    Certificate = new CertificateRequest {
                        Content = cert.Content
                    }
                },
                Recipient = new RecipientInfoRequest {
                    FssCode = "11111"
                }
            };
            draft = await CreateDraftAsync();

            emptyDocument = await CreateEmptyDocument();

            filledDocument = await CreateFilledDocument(draft);

            filledDocumentSignature = await Client.Drafts.AddDocumentSignatureAsync(
                Account.Id,
                draft.Id,
                filledDocument.Id,
                new SignatureRequest { Base64Content = Convert.ToBase64String(new byte[] { 1, 2, 3, 4 }) });
        }
Esempio n. 3
0
 public async Task <Draft> CreateDraftAsync(Guid accountId, DraftMetaRequest draftRequest, TimeSpan?timeout = null) =>
 await client.SendRequestAsync <Draft>(
     HttpMethod.Post,
     $"/v1/{accountId}/drafts",
     contentDto : draftRequest,
     timeout : timeout);