Allow to create invoice links on behalf of business.

This commit is contained in:
levlam 2024-11-13 19:50:58 +03:00
parent b65e207b71
commit d4323f5ac0

View File

@ -11255,6 +11255,17 @@ td::Status Client::process_delete_messages_query(PromisedQueryPtr &query) {
td::Status Client::process_create_invoice_link_query(PromisedQueryPtr &query) {
TRY_RESULT(input_message_invoice, get_input_message_invoice(query.get()));
auto business_connection_id = query->arg("business_connection_id").str();
if (!business_connection_id.empty()) {
check_business_connection(business_connection_id, std::move(query),
[this, input_message_invoice = std::move(input_message_invoice)](
const BusinessConnection *business_connection, PromisedQueryPtr query) mutable {
send_request(make_object<td_api::createInvoiceLink>(business_connection->id_,
std::move(input_message_invoice)),
td::make_unique<TdOnCreateInvoiceLinkCallback>(std::move(query)));
});
return td::Status::OK();
}
send_request(make_object<td_api::createInvoiceLink>(td::string(), std::move(input_message_invoice)),
td::make_unique<TdOnCreateInvoiceLinkCallback>(std::move(query)));
return td::Status::OK();