diff --git a/src/core/payments.rs b/src/core/payments.rs index 6c6027e0..37bd0ef7 100644 --- a/src/core/payments.rs +++ b/src/core/payments.rs @@ -1,4 +1,5 @@ use serde::Deserialize; +use crate::core::other::User; #[derive(Debug, Deserialize)] pub struct SendInvoice { @@ -25,4 +26,89 @@ pub struct SendInvoice { disable_notification: Option, reply_to_message_id: Option, reply_markup: Option, +} + +#[derive(Debug, Deserialize)] +pub struct AnswerShippingQuery { + shipping_query_id: String, + ok: Bool, + shipping_options: Option>, + error_message: Option, +} + +#[derive(Debug, Deserialize)] +pub struct AnswerPreCheckoutQuery { + pre_checkout_query_id: String, + ok: Bool, + error_message: Option, +} + +#[derive(Debug, Deserialize)] +pub struct LabeledPrice { + label: String, + amount: i64, +} + +#[derive(Debug, Deserialize)] +pub struct Invoice { + title: String, + description: String, + start_parameter: String, + currency: String, + total_amount: i64, +} + +#[derive(Debug, Deserialize)] +pub struct ShippingAddress { + country_code: String, + state: String, + city: String, + street_line1: String, + street_line2: String, + post_code: String, +} + +#[derive(Debug, Deserialize)] +pub struct OrderInfo { + name: String, + phone_number: String, + email: String, + shipping_address: ShippingAddress +} + +#[derive(Debug, Deserialize)] +pub struct ShippingOption { + id: i64, + title: String, + prices: Vec, +} + +#[derive(Debug, Deserialize)] +pub struct SuccessfulPayment { + currency: String, + total_amount: i64, + invoice_payload: String, + shipping_option_id: Option, + order_info: Option, + telegram_payment_charge_id: String, + provider_payment_charge_id: String, +} + +#[derive(Debug, Deserialize)] +pub struct ShippingQuery { + id: String, + from: User, + invoice_payload: String, + shipping_address: ShippingAddress, +} + +#[derive(Debug, Deserialize)] +pub struct PreCheckoutQuery { + id: String, + from: User, + currency: String, + total_amount: i64, + invoice_payload: String, + shipping_option_id: Option, + order_info: Option } \ No newline at end of file