Telebot 9.4
Library for Telegram bot API
Loading...
Searching...
No Matches
telebot-payments.h
Go to the documentation of this file.
1/*
2 * telebot
3 *
4 * Copyright (c) 2015 Elmurod Talipov.
5 *
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef __TELEBOT_PAYMENTS_H__
20#define __TELEBOT_PAYMENTS_H__
21
22#include <stdbool.h>
23#include "telebot-types.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
46 long long int chat_id, int message_thread_id, const char *title,
47 const char *description, const char *payload, const char *provider_token,
48 const char *currency, const char *prices, int max_tip_amount,
49 const char *suggested_tip_amounts, const char *start_parameter,
50 const char *provider_data, const char *photo_url, int photo_size,
51 int photo_width, int photo_height, bool need_name, bool need_phone_number,
52 bool need_email, bool need_shipping_address, bool send_phone_number_to_provider,
53 bool send_email_to_provider, bool is_flexible, bool disable_notification,
54 bool protect_content, const char *reply_parameters, const char *reply_markup,
55 telebot_message_t *message);
56
61 const char *title, const char *description, const char *payload,
62 const char *provider_token, const char *currency, const char *prices,
63 int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data,
64 const char *photo_url, int photo_size, int photo_width, int photo_height,
65 bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address,
66 bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible,
67 char **invoice_link);
68
73 const char *shipping_query_id, bool ok, const char *shipping_options,
74 const char *error_message);
75
80 const char *pre_checkout_query_id, bool ok, const char *error_message);
81
86
91 int offset, int limit, telebot_star_transactions_t *transactions);
92
97
102 long long int user_id, const char *telegram_payment_charge_id);
103
108 telebot_gifts_t *gifts);
109
114
119
124 long long int user_id, int offset, int limit, telebot_user_gifts_t *gifts);
125
130
135
140 long long int chat_id, int offset, int limit, telebot_user_gifts_t *gifts);
141
146
151 const char *gift_id, bool pay_for_upgrade, const char *text,
152 const char *text_parse_mode, const char *text_entities);
153
158 long long int user_id, long long int chat_id, const char *gift_id);
159
164 const char *gift_id);
165
170 long long int user_id, long long int chat_id, const char *gift_id,
171 bool pay_for_upgrade, const char *text, const char *text_parse_mode,
172 const char *text_entities);
173
178 long long int user_id, int month_count, int star_count, const char *text,
179 const char *text_parse_mode, const char *text_entities);
180
185#ifdef __cplusplus
186}
187#endif
188
189#endif /* __TELEBOT_PAYMENTS_H__ */
telebot_error_e telebot_upgrade_gift(telebot_handler_t handle, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to upgrade a gift.
telebot_error_e telebot_refund_star_payment(telebot_handler_t handle, long long int user_id, const char *telegram_payment_charge_id)
Use this method to refund a successful payment in Telegram Stars.
telebot_error_e telebot_convert_gift_to_stars(telebot_handler_t handle, const char *gift_id)
Use this method to convert a gift to Telegram Stars.
telebot_error_e telebot_get_chat_gifts(telebot_handler_t handle, long long int chat_id, int offset, int limit, telebot_user_gifts_t *gifts)
Use this method to get a list of gifts received by a chat.
telebot_error_e telebot_put_chat_gifts(telebot_user_gifts_t *gifts)
Release chat gifts obtained with telebot_get_chat_gifts.
telebot_error_e telebot_get_user_gifts(telebot_handler_t handle, long long int user_id, int offset, int limit, telebot_user_gifts_t *gifts)
Use this method to get a list of gifts received by a user.
telebot_error_e telebot_put_user_gifts(telebot_user_gifts_t *gifts)
Release user gifts obtained with telebot_get_user_gifts.
telebot_error_e telebot_get_star_transactions(telebot_handler_t handle, int offset, int limit, telebot_star_transactions_t *transactions)
Use this method to get the bot's Telegram Star transactions.
telebot_error_e telebot_put_user_gift(telebot_user_gift_t *gift)
Release a user gift object.
telebot_error_e telebot_get_available_gifts(telebot_handler_t handle, telebot_gifts_t *gifts)
Use this method to get a list of gifts that can be sent by the bot to users.
telebot_error_e telebot_answer_shipping_query(telebot_handler_t handle, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
Use this method to reply to shipping queries.
telebot_error_e telebot_put_star_transactions(telebot_star_transactions_t *transactions)
Release star transactions obtained with telebot_get_star_transactions.
telebot_error_e telebot_send_invoice(telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup, telebot_message_t *message)
Use this method to send an invoice.
telebot_error_e telebot_create_invoice_link(telebot_handler_t handle, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, char **invoice_link)
Use this method to create a link for an invoice.
telebot_error_e telebot_put_gift(telebot_gift_t *gift)
Release a gift object.
struct telebot_handler * telebot_handler_t
This is opaque object to represent a telebot handler.
Definition telebot-types.h:3489
telebot_error_e telebot_send_gift(telebot_handler_t handle, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to send a gift.
telebot_error_e telebot_put_available_gifts(telebot_gifts_t *gifts)
Release available gifts obtained with telebot_get_available_gifts.
telebot_error_e telebot_get_my_star_balance(telebot_handler_t handle, long long int *balance)
Use this method to get the current Telegram Stars balance of the bot.
telebot_error_e
Enumerations of error code for telebot programming interface.
Definition telebot-common.h:45
telebot_error_e telebot_gift_premium_subscription(telebot_handler_t handle, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to gift a Telegram Premium subscription to a user.
telebot_error_e telebot_transfer_gift(telebot_handler_t handle, long long int user_id, long long int chat_id, const char *gift_id)
Use this method to transfer a gift.
telebot_error_e telebot_answer_pre_checkout_query(telebot_handler_t handle, const char *pre_checkout_query_id, bool ok, const char *error_message)
Use this method to respond to pre-checkout queries.
This object represents a gift that can be sent by the bot.
Definition telebot-types.h:1471
This object represent a list of gifts.
Definition telebot-types.h:2222
This object represents a message.
Definition telebot-types.h:1777
Contains a list of Telegram Star transactions.
Definition telebot-types.h:1713
This object represents a gift received by a user.
Definition telebot-types.h:2244
This object represents a list of gifts received by a user.
Definition telebot-types.h:2278
This file contains types used to create telegram bot.