make successful payment use OrderInfo; derive Default on OrderInfo

This commit is contained in:
zggff 2022-01-05 00:54:45 +03:00
parent 1d0ff0a0f6
commit 25090dc72c
3 changed files with 4 additions and 2 deletions

View file

@ -5,7 +5,7 @@ use crate::types::ShippingAddress;
/// This object represents information about an order.
///
/// [The official docs](https://core.telegram.org/bots/api#orderinfo).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Default)]
pub struct OrderInfo {
/// User's name.
pub name: Option<String>,

View file

@ -35,5 +35,6 @@ pub struct PreCheckoutQuery {
pub shipping_option_id: Option<String>,
/// Order info provided by the user.
#[serde(default)]
pub order_info: OrderInfo,
}

View file

@ -29,7 +29,8 @@ pub struct SuccessfulPayment {
pub shipping_option_id: Option<String>,
/// Order info provided by the user.
pub order_info: Option<OrderInfo>,
#[serde(default)]
pub order_info: OrderInfo,
/// Telegram payment identifier.
pub telegram_payment_charge_id: String,