Skip to main content

teloxide_core_ng/payloads/
create_invoice_link.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{BusinessConnectionId, LabeledPrice, Seconds};
6
7impl_payload! {
8    /// Use this method to create a link for an invoice. Returns the created invoice link as String on success.
9    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
10    pub CreateInvoiceLink (CreateInvoiceLinkSetters) => String {
11        required {
12            /// Product name, 1-32 characters
13            pub title: String [into],
14            /// Product description, 1-255 characters
15            pub description: String [into],
16            /// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
17            pub payload: String [into],
18            /// Three-letter ISO 4217 currency code, see [more on currencies]. Pass `XTR` for payments in [Telegram Stars].
19            ///
20            /// [more on currencies]: https://core.telegram.org/bots/payments#supported-currencies
21            /// [Telegram Stars]: https://t.me/BotNews/90
22            pub currency: String [into],
23            /// Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
24            pub prices: Vec<LabeledPrice> [collect],
25        }
26        optional {
27            /// Payments provider token, obtained via [Botfather]. Pass `None` for payments in [Telegram Stars].
28            ///
29            /// [Botfather]: https://t.me/botfather
30            /// [Telegram Stars]: https://t.me/BotNews/90
31            pub provider_token: String [into],
32            /// Unique identifier of the business connection on behalf of which the link will be created. For payments in [Telegram Stars] only.
33            ///
34            /// [Telegram Stars]: https://t.me/BotNews/90
35            pub business_connection_id: BusinessConnectionId,
36            /// The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user.
37            pub subscription_period: Seconds,
38            /// The maximum accepted amount for tips in the smallest units of the currency (integer, **not** float/double). For example, for a maximum tip of `US$ 1.45` pass `max_tip_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). Defaults to 0
39            ///
40            /// [`currencies.json`]: https://core.telegram.org/bots/payments/currencies.json
41            pub max_tip_amount: u32,
42            /// A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed _max_tip_amount_.
43            pub suggested_tip_amounts: Vec<u32> [collect],
44            /// A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
45            pub provider_data: String [into],
46            /// URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
47            pub photo_url: String [into],
48            /// Photo size in bytes
49            pub photo_size: String [into],
50            /// Photo width
51            pub photo_width: String [into],
52            /// Photo height
53            pub photo_height: String [into],
54            /// Pass _True_, if you require the user's full name to complete the order
55            pub need_name: bool,
56            /// Pass _True_, if you require the user's phone number to complete the order
57            pub need_phone_number: bool,
58            /// Pass _True_, if you require the user's email address to complete the order
59            pub need_email: bool,
60            /// Pass _True_, if you require the user's shipping address to complete the order
61            pub need_shipping_address: bool,
62            /// Pass _True_, if user's phone number should be sent to provider
63            pub send_phone_number_to_provider: bool,
64            /// Pass _True_, if user's email address should be sent to provider
65            pub send_email_to_provider: bool,
66            /// Pass _True_, if the final price depends on the shipping method
67            pub is_flexible: bool,
68        }
69    }
70}