btcpay_client/models/
payment_request_data.rs

1/*
2 * BTCPay Greenfield API
3 *
4 * A full API to use your BTCPay Server
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct PaymentRequestData {
16    /// The amount of the payment request
17    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
18    pub amount: Option<String>,
19    /// The title of the payment request
20    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
21    pub title: Option<String>,
22    /// The currency of the payment request. If empty, the store's default currency code will be used.
23    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
24    pub currency: Option<String>,
25    /// The email used in invoices generated by the payment request
26    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
27    pub email: Option<String>,
28    /// The description of the payment request
29    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
30    pub description: Option<String>,
31    /// The expiry date of the payment request
32    #[serde(rename = "expiryDate", skip_serializing_if = "Option::is_none")]
33    pub expiry_date: Option<f32>,
34    /// Custom CSS styling for the payment request
35    #[serde(rename = "embeddedCSS", skip_serializing_if = "Option::is_none")]
36    pub embedded_css: Option<String>,
37    /// Custom CSS link for styling the payment request
38    #[serde(rename = "customCSSLink", skip_serializing_if = "Option::is_none")]
39    pub custom_css_link: Option<String>,
40    /// Whether to allow users to create invoices that partially pay the payment request 
41    #[serde(rename = "allowCustomPaymentAmounts", skip_serializing_if = "Option::is_none")]
42    pub allow_custom_payment_amounts: Option<bool>,
43    /// The id of the payment request
44    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
45    pub id: Option<String>,
46    /// The store identifier that the payment request belongs to
47    #[serde(rename = "storeId", skip_serializing_if = "Option::is_none")]
48    pub store_id: Option<String>,
49    /// The status of the payment request
50    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
51    pub status: Option<Status>,
52    /// The creation date of the payment request
53    #[serde(rename = "createdTime", skip_serializing_if = "Option::is_none")]
54    pub created_time: Option<f32>,
55}
56
57impl PaymentRequestData {
58    pub fn new() -> PaymentRequestData {
59        PaymentRequestData {
60            amount: None,
61            title: None,
62            currency: None,
63            email: None,
64            description: None,
65            expiry_date: None,
66            embedded_css: None,
67            custom_css_link: None,
68            allow_custom_payment_amounts: None,
69            id: None,
70            store_id: None,
71            status: None,
72            created_time: None,
73        }
74    }
75}
76
77/// The status of the payment request
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum Status {
80    #[serde(rename = "Pending")]
81    Pending,
82    #[serde(rename = "Completed")]
83    Completed,
84    #[serde(rename = "Expired")]
85    Expired,
86}
87
88impl Default for Status {
89    fn default() -> Status {
90        Self::Pending
91    }
92}
93