use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CheckoutSession {
#[serde(rename = "CheckoutSessionID")]
pub checkout_session_id: String,
#[serde(
rename = "PaymentMethodCategory",
skip_serializing_if = "Option::is_none"
)]
pub payment_method_category: Option<String>,
#[serde(rename = "SourceCurrency")]
pub source_currency: String,
#[serde(rename = "DestinationCurrency")]
pub destination_currency: String,
#[serde(rename = "SourceAmount", skip_serializing_if = "Option::is_none")]
pub source_amount: Option<String>,
#[serde(rename = "DestinationAmount", skip_serializing_if = "Option::is_none")]
pub destination_amount: Option<String>,
#[serde(rename = "AuthorizedAmount", skip_serializing_if = "Option::is_none")]
pub authorized_amount: Option<String>,
#[serde(rename = "Status")]
pub status: String,
#[serde(rename = "ExternalID", skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
#[serde(rename = "CustomerID")]
pub customer_id: String,
#[serde(rename = "ReturnURL")]
pub return_url: String,
#[serde(rename = "LineItems")]
pub line_items: Vec<models::LineItem>,
#[serde(rename = "Type")]
pub r#type: String,
#[serde(rename = "Expiry", skip_serializing_if = "Option::is_none")]
pub expiry: Option<String>,
#[serde(rename = "Created")]
pub created: String,
}
impl CheckoutSession {
pub fn new(
checkout_session_id: String,
source_currency: String,
destination_currency: String,
status: String,
customer_id: String,
return_url: String,
line_items: Vec<models::LineItem>,
r#type: String,
created: String,
) -> CheckoutSession {
CheckoutSession {
checkout_session_id,
payment_method_category: None,
source_currency,
destination_currency,
source_amount: None,
destination_amount: None,
authorized_amount: None,
status,
external_id: None,
customer_id,
return_url,
line_items,
r#type,
expiry: None,
created,
}
}
}