[][src]Struct tgbot::methods::SendInvoice

pub struct SendInvoice { /* fields omitted */ }

Send invoice

Methods

impl SendInvoice[src]

pub fn new<A, B, C, D, E, F>(
    chat_id: Integer,
    title: A,
    description: B,
    payload: C,
    provider_token: D,
    start_parameter: E,
    currency: F,
    prices: Vec<LabeledPrice>
) -> Self where
    A: Into<String>,
    B: Into<String>,
    C: Into<String>,
    D: Into<String>,
    E: Into<String>,
    F: Into<String>, 
[src]

Creates a new SendInvoice with empty optional parameters

Arguments

  • chat_id - Unique identifier for the target private chat
  • title - Product name, 1-32 characters
  • description - Product description, 1-255 characters
  • payload - Bot-defined invoice payload, 1-128 bytes This will not be displayed to the user, use for your internal processes
  • provider_token - Payments provider token, obtained via Botfather
  • start_parameter - Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter
  • currency - Three-letter ISO 4217 currency code, see more on currencies
  • prices - Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

pub fn provider_data<S: Into<String>>(self, provider_data: S) -> Self[src]

JSON-encoded 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

pub fn photo_url<S: Into<String>>(self, photo_url: S) -> Self[src]

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

pub fn photo_size(self, photo_size: Integer) -> Self[src]

Photo size

pub fn photo_width(self, photo_width: Integer) -> Self[src]

Photo width

pub fn photo_height(self, photo_height: Integer) -> Self[src]

Photo height

pub fn need_name(self, need_name: bool) -> Self[src]

Pass True, if you require the user's full name to complete the order

pub fn need_phone_number(self, need_phone_number: bool) -> Self[src]

Pass True, if you require the user's phone number to complete the order

pub fn need_email(self, need_email: bool) -> Self[src]

Pass True, if you require the user's email address to complete the order

pub fn need_shipping_address(self, need_shipping_address: bool) -> Self[src]

Pass True, if you require the user's shipping address to complete the order

pub fn send_phone_number_to_provider(
    self,
    send_phone_number_to_provider: bool
) -> Self
[src]

Pass True, if user's phone number should be sent to provider

pub fn send_email_to_provider(self, send_email_to_provider: bool) -> Self[src]

Pass True, if user's email address should be sent to provider

pub fn flexible(self, is_flexible: bool) -> Self[src]

Pass True, if the final price depends on the shipping method

pub fn disable_notification(self, disable_notification: bool) -> Self[src]

Sends the message silently

Users will receive a notification with no sound

pub fn reply_to_message_id(self, reply_to_message_id: Integer) -> Self[src]

If the message is a reply, ID of the original message

pub fn reply_markup<I: Into<InlineKeyboardMarkup>>(
    self,
    reply_markup: I
) -> Self
[src]

Inline keyboard

If empty, one 'Pay total price' button will be shown If not empty, the first button must be a Pay button

Trait Implementations

impl Clone for SendInvoice[src]

impl Debug for SendInvoice[src]

impl Method for SendInvoice[src]

type Response = Message

Type of successful result in API response

impl Serialize for SendInvoice[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.