mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 15:01:45 +01:00
make successful payment use OrderInfo; derive Default on OrderInfo
This commit is contained in:
parent
1d0ff0a0f6
commit
25090dc72c
3 changed files with 4 additions and 2 deletions
|
@ -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>,
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue