Skip to content

Commit

Permalink
GenerateReceiptXml to SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Skukov committed Oct 1, 2019
1 parent 0fce0ab commit d7490b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/DiadocApi.cpp
Expand Up @@ -803,6 +803,19 @@ DiadocApi::WebFile::~WebFile()
{
}


DiadocApi::WebFile DiadocApi::GenerateReceiptXml(const std::wstring& boxId, const std::wstring& messageId, const std::wstring& attachmentId, const Diadoc::Api::Proto::Invoicing::Signer signer)
{
WppTraceDebugOut("GenerateReceiptXml...");
auto requestBody = ToProtoBytes(signer);
std::wstringstream buf;
buf << L"/GenerateReceiptXml?boxId=" << StringHelper::CanonicalizeUrl(boxId) << L"&messageId=" << StringHelper::CanonicalizeUrl(messageId) << L"&attachmentId=" << StringHelper::CanonicalizeUrl(attachmentId);
auto connect = session_.Connect(api_url_.c_str(), api_port_);
auto request = connect.OpenRequest(POST.c_str(), buf.str().c_str(), NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, connection_flags_);
SendRequest(request, requestBody);
return WebFile(request);
}

DiadocApi::WebFile DiadocApi::GenerateDocumentReceiptXml(const std::wstring& boxId, const std::wstring& messageId, const std::wstring& attachmentId, const Diadoc::Api::Proto::Invoicing::Signer signer)
{
WppTraceDebugOut("GenerateDocumentReceiptXml...");
Expand Down
2 changes: 2 additions & 0 deletions src/DiadocApi.h
Expand Up @@ -155,6 +155,8 @@ class DiadocApi
Bytes_t Content;
};

WebFile GenerateReceiptXml(const std::wstring& boxId, const std::wstring& messageId, const std::wstring& attachmentId, const Diadoc::Api::Proto::Invoicing::Signer);

WebFile GenerateDocumentReceiptXml(const std::wstring& boxId, const std::wstring& messageId, const std::wstring& attachmentId, const Diadoc::Api::Proto::Invoicing::Signer);

WebFile GenerateInvoiceDocumentReceiptXml(const std::wstring& boxId, const std::wstring& messageId, const std::wstring& attachmentId, const Diadoc::Api::Proto::Invoicing::Signer);
Expand Down

0 comments on commit d7490b1

Please sign in to comment.