mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
add payment struct
This commit is contained in:
parent
c6ad316d4d
commit
3c97b34fef
1 changed files with 86 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use crate::core::other::User;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct SendInvoice {
|
pub struct SendInvoice {
|
||||||
|
@ -26,3 +27,88 @@ pub struct SendInvoice {
|
||||||
reply_to_message_id: Option<i64>,
|
reply_to_message_id: Option<i64>,
|
||||||
reply_markup: Option<InlineKeyboardMarkup>,
|
reply_markup: Option<InlineKeyboardMarkup>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
pub struct AnswerShippingQuery {
|
||||||
|
shipping_query_id: String,
|
||||||
|
ok: Bool,
|
||||||
|
shipping_options: Option<Vec<ShippingOption>>,
|
||||||
|
error_message: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
pub struct AnswerPreCheckoutQuery {
|
||||||
|
pre_checkout_query_id: String,
|
||||||
|
ok: Bool,
|
||||||
|
error_message: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[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<LabeledPrice>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
pub struct SuccessfulPayment {
|
||||||
|
currency: String,
|
||||||
|
total_amount: i64,
|
||||||
|
invoice_payload: String,
|
||||||
|
shipping_option_id: Option<String>,
|
||||||
|
order_info: Option<OrderInfo>,
|
||||||
|
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<String>,
|
||||||
|
order_info: Option<OrderInfo>
|
||||||
|
}
|
Loading…
Reference in a new issue