mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2025-01-01 07:05:49 +01:00
Add refundStarPayment method.
This commit is contained in:
parent
325dc5d293
commit
486539c514
@ -246,6 +246,7 @@ bool Client::init_methods() {
|
|||||||
methods_.emplace("deletemessage", &Client::process_delete_message_query);
|
methods_.emplace("deletemessage", &Client::process_delete_message_query);
|
||||||
methods_.emplace("deletemessages", &Client::process_delete_messages_query);
|
methods_.emplace("deletemessages", &Client::process_delete_messages_query);
|
||||||
methods_.emplace("createinvoicelink", &Client::process_create_invoice_link_query);
|
methods_.emplace("createinvoicelink", &Client::process_create_invoice_link_query);
|
||||||
|
methods_.emplace("refundstarpayment", &Client::process_refund_star_payment_query);
|
||||||
methods_.emplace("setgamescore", &Client::process_set_game_score_query);
|
methods_.emplace("setgamescore", &Client::process_set_game_score_query);
|
||||||
methods_.emplace("getgamehighscores", &Client::process_get_game_high_scores_query);
|
methods_.emplace("getgamehighscores", &Client::process_get_game_high_scores_query);
|
||||||
methods_.emplace("answerwebappquery", &Client::process_answer_web_app_query_query);
|
methods_.emplace("answerwebappquery", &Client::process_answer_web_app_query_query);
|
||||||
@ -10461,6 +10462,18 @@ td::Status Client::process_create_invoice_link_query(PromisedQueryPtr &query) {
|
|||||||
return td::Status::OK();
|
return td::Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td::Status Client::process_refund_star_payment_query(PromisedQueryPtr &query) {
|
||||||
|
TRY_RESULT(user_id, get_user_id(query.get()));
|
||||||
|
TRY_RESULT(telegram_payment_charge_id, get_required_string_arg(query.get(), "telegram_payment_charge_id"));
|
||||||
|
check_user_no_fail(
|
||||||
|
user_id, std::move(query),
|
||||||
|
[this, telegram_payment_charge_id = telegram_payment_charge_id.str(), user_id](PromisedQueryPtr query) {
|
||||||
|
send_request(make_object<td_api::refundStarPayment>(user_id, telegram_payment_charge_id),
|
||||||
|
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
|
||||||
|
});
|
||||||
|
return td::Status::OK();
|
||||||
|
}
|
||||||
|
|
||||||
td::Status Client::process_set_game_score_query(PromisedQueryPtr &query) {
|
td::Status Client::process_set_game_score_query(PromisedQueryPtr &query) {
|
||||||
auto chat_id = query->arg("chat_id");
|
auto chat_id = query->arg("chat_id");
|
||||||
auto message_id = get_message_id(query.get());
|
auto message_id = get_message_id(query.get());
|
||||||
|
@ -647,6 +647,7 @@ class Client final : public WebhookActor::Callback {
|
|||||||
td::Status process_delete_message_query(PromisedQueryPtr &query);
|
td::Status process_delete_message_query(PromisedQueryPtr &query);
|
||||||
td::Status process_delete_messages_query(PromisedQueryPtr &query);
|
td::Status process_delete_messages_query(PromisedQueryPtr &query);
|
||||||
td::Status process_create_invoice_link_query(PromisedQueryPtr &query);
|
td::Status process_create_invoice_link_query(PromisedQueryPtr &query);
|
||||||
|
td::Status process_refund_star_payment_query(PromisedQueryPtr &query);
|
||||||
td::Status process_set_game_score_query(PromisedQueryPtr &query);
|
td::Status process_set_game_score_query(PromisedQueryPtr &query);
|
||||||
td::Status process_get_game_high_scores_query(PromisedQueryPtr &query);
|
td::Status process_get_game_high_scores_query(PromisedQueryPtr &query);
|
||||||
td::Status process_answer_web_app_query_query(PromisedQueryPtr &query);
|
td::Status process_answer_web_app_query_query(PromisedQueryPtr &query);
|
||||||
|
Loading…
Reference in New Issue
Block a user