2018-12-31 20:04:05 +01:00
|
|
|
//
|
2022-01-01 01:35:39 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2018-12-31 20:04:05 +01:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
2021-03-26 16:15:21 +01:00
|
|
|
#include "td/telegram/DialogId.h"
|
2021-03-31 03:15:02 +02:00
|
|
|
#include "td/telegram/FullMessageId.h"
|
2022-09-22 17:49:08 +02:00
|
|
|
#include "td/telegram/LabeledPricePart.h"
|
2021-03-31 00:20:40 +02:00
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
#include "td/telegram/telegram_api.h"
|
2018-12-31 20:04:05 +01:00
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
2022-06-27 12:30:18 +02:00
|
|
|
#include "td/utils/Promise.h"
|
2018-04-11 16:21:24 +02:00
|
|
|
#include "td/utils/Slice.h"
|
2018-04-11 23:18:03 +02:00
|
|
|
#include "td/utils/Status.h"
|
2018-12-31 20:04:05 +01:00
|
|
|
#include "td/utils/StringBuilder.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
2021-03-31 00:20:40 +02:00
|
|
|
class Td;
|
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
struct ShippingOption {
|
|
|
|
string id;
|
|
|
|
string title;
|
|
|
|
vector<LabeledPricePart> price_parts;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(const ShippingOption &lhs, const ShippingOption &rhs);
|
|
|
|
bool operator!=(const ShippingOption &lhs, const ShippingOption &rhs);
|
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, const ShippingOption &shipping_option);
|
|
|
|
|
2022-09-22 18:08:06 +02:00
|
|
|
tl_object_ptr<td_api::formattedText> get_product_description_object(const string &description);
|
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void answer_shipping_query(Td *td, int64 shipping_query_id,
|
|
|
|
vector<tl_object_ptr<td_api::shippingOption>> &&shipping_options,
|
2018-12-31 20:04:05 +01:00
|
|
|
const string &error_message, Promise<Unit> &&promise);
|
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void answer_pre_checkout_query(Td *td, int64 pre_checkout_query_id, const string &error_message,
|
|
|
|
Promise<Unit> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2022-05-03 17:50:29 +02:00
|
|
|
void get_payment_form(Td *td, td_api::object_ptr<td_api::InputInvoice> &&input_invoice,
|
|
|
|
const td_api::object_ptr<td_api::themeParameters> &theme,
|
2021-04-07 21:49:09 +02:00
|
|
|
Promise<tl_object_ptr<td_api::paymentForm>> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2022-05-03 17:50:29 +02:00
|
|
|
void validate_order_info(Td *td, td_api::object_ptr<td_api::InputInvoice> &&input_invoice,
|
|
|
|
td_api::object_ptr<td_api::orderInfo> &&order_info, bool allow_save,
|
|
|
|
Promise<td_api::object_ptr<td_api::validatedOrderInfo>> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2022-05-03 17:50:29 +02:00
|
|
|
void send_payment_form(Td *td, td_api::object_ptr<td_api::InputInvoice> &&input_invoice, int64 payment_form_id,
|
|
|
|
const string &order_info_id, const string &shipping_option_id,
|
|
|
|
const td_api::object_ptr<td_api::InputCredentials> &credentials, int64 tip_amount,
|
|
|
|
Promise<td_api::object_ptr<td_api::paymentResult>> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2021-03-31 03:15:02 +02:00
|
|
|
void get_payment_receipt(Td *td, FullMessageId full_message_id,
|
2021-03-26 16:15:21 +01:00
|
|
|
Promise<tl_object_ptr<td_api::paymentReceipt>> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void get_saved_order_info(Td *td, Promise<tl_object_ptr<td_api::orderInfo>> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void delete_saved_order_info(Td *td, Promise<Unit> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void delete_saved_credentials(Td *td, Promise<Unit> &&promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2022-05-06 15:37:11 +02:00
|
|
|
void export_invoice(Td *td, td_api::object_ptr<td_api::InputMessageContent> &&invoice, Promise<string> &&promise);
|
|
|
|
|
2021-03-31 02:18:00 +02:00
|
|
|
void get_bank_card_info(Td *td, const string &bank_card_number,
|
|
|
|
Promise<td_api::object_ptr<td_api::bankCardInfo>> &&promise);
|
2020-02-13 17:20:34 +01:00
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
} // namespace td
|