telegram_bot_raw_ars/types/pre_checkout_query.rs
1use crate::types::*;
2
3/// This object contains information about an incoming pre-checkout query.
4#[derive(Debug, Clone, PartialEq, PartialOrd, Deserialize)]
5pub struct PreCheckoutQuery {
6 /// Unique query identifier
7 pub id: CallbackQueryId,
8 /// User who sent the query
9 pub from: User,
10 /// Three-letter ISO 4217 currency code
11 pub currency: String,
12 /// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
13 pub total_amount: Integer,
14 /// Bot specified invoice payload
15 pub invoice_payload: String,
16 /// Optional. Identifier of the shipping option chosen by the user
17 pub shipping_option_id: Option<String>,
18 /// Optional. Order info provided by the user
19 pub order_info: Option<OrderInfo>,
20}
21
22/// This object represents information about an order.
23#[derive(Debug, Clone, PartialEq, PartialOrd, Deserialize)]
24pub struct OrderInfo {
25 /// Optional. User name
26 pub name: Option<String>,
27 /// Optional. User's phone number
28 pub phone_number: Option<String>,
29 /// Optional. User email
30 pub email: Option<String>,
31 /// Optional. User shipping address
32 pub shipping_address: Option<ShippingAddress>,
33}
34
35/// This object represents a shipping address.
36#[derive(Debug, Clone, PartialEq, PartialOrd, Deserialize)]
37pub struct ShippingAddress {
38 /// ISO 3166-1 alpha-2 country code
39 pub country_code: String,
40 /// State, if applicable
41 pub state: String,
42 /// City
43 pub city: String,
44 /// First line for the address
45 pub street_line1: String,
46 /// Second line for the address
47 pub street_line2: String,
48 /// Address post code
49 pub post_code: String,
50}