Improve the name of the method canPurchaseFromStore.

This commit is contained in:
levlam 2024-05-16 15:05:31 +03:00
parent d6ed36f218
commit 88ee1e8a65
4 changed files with 13 additions and 13 deletions

View File

@ -10742,8 +10742,8 @@ launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParamet
//@message_id Identifier of the giveaway or a giveaway winners message in the chat
getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo;
//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose
canPurchasePremium purpose:StorePaymentPurpose = Ok;
//@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase @purpose Transaction purpose
canPurchaseFromStore purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose
assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok;

View File

@ -9388,7 +9388,7 @@ void Td::on_request(uint64 id, const td_api::getPremiumGiveawayInfo &request) {
get_premium_giveaway_info(this, {DialogId(request.chat_id_), MessageId(request.message_id_)}, std::move(promise));
}
void Td::on_request(uint64 id, td_api::canPurchasePremium &request) {
void Td::on_request(uint64 id, td_api::canPurchaseFromStore &request) {
CHECK_IS_USER();
CREATE_OK_REQUEST_PROMISE();
can_purchase_premium(this, std::move(request.purpose_), std::move(promise));

View File

@ -1833,7 +1833,7 @@ class Td final : public Actor {
void on_request(uint64 id, const td_api::getPremiumGiveawayInfo &request);
void on_request(uint64 id, td_api::canPurchasePremium &request);
void on_request(uint64 id, td_api::canPurchaseFromStore &request);
void on_request(uint64 id, td_api::assignAppStoreTransaction &request);

View File

@ -3380,36 +3380,36 @@ class CliClient final : public Actor {
MessageId message_id;
get_args(args, chat_id, message_id);
send_request(td_api::make_object<td_api::getPremiumGiveawayInfo>(chat_id, message_id));
} else if (op == "cppr" || op == "cpprb") {
} else if (op == "cpfs" || op == "cpfsb") {
UserId user_id;
string currency;
int64 amount;
ChatId boosted_chat_id;
get_args(args, user_id, currency, amount, boosted_chat_id);
if (currency.empty()) {
send_request(td_api::make_object<td_api::canPurchasePremium>(
send_request(td_api::make_object<td_api::canPurchaseFromStore>(
td_api::make_object<td_api::storePaymentPurposePremiumSubscription>(false, false)));
} else if (op == "cppr") {
send_request(td_api::make_object<td_api::canPurchasePremium>(
} else if (op == "cpfs") {
send_request(td_api::make_object<td_api::canPurchaseFromStore>(
td_api::make_object<td_api::storePaymentPurposeGiftedPremium>(user_id, currency, amount)));
} else {
send_request(td_api::make_object<td_api::canPurchasePremium>(
send_request(td_api::make_object<td_api::canPurchaseFromStore>(
td_api::make_object<td_api::storePaymentPurposePremiumGiftCodes>(boosted_chat_id, currency, amount,
vector<int64>{user_id})));
}
} else if (op == "cpprg") {
} else if (op == "cpfsg") {
PremiumGiveawayParameters parameters;
string currency;
int64 amount;
get_args(args, parameters, currency, amount);
send_request(td_api::make_object<td_api::canPurchasePremium>(
send_request(td_api::make_object<td_api::canPurchaseFromStore>(
td_api::make_object<td_api::storePaymentPurposePremiumGiveaway>(parameters, currency, amount)));
} else if (op == "cpprs") {
} else if (op == "cpfss") {
string currency;
int64 amount;
int64 star_count;
get_args(args, currency, amount, star_count);
send_request(td_api::make_object<td_api::canPurchasePremium>(
send_request(td_api::make_object<td_api::canPurchaseFromStore>(
td_api::make_object<td_api::storePaymentPurposeStars>(currency, amount, star_count)));
} else if (op == "gbf") {
send_request(td_api::make_object<td_api::getBusinessFeatures>(nullptr));