pub struct Dispute {Show 14 fields
pub id: Option<String>,
pub object: Option<String>,
pub amount: Option<i64>,
pub charge: Option<String>,
pub created: Option<i64>,
pub currency: Option<String>,
pub evidence: Option<Evidence>,
pub evidence_details: Option<EvidenceDetails>,
pub is_charge_refundable: Option<bool>,
pub livemode: Option<bool>,
pub submit: Option<bool>,
pub payment_intent: Option<String>,
pub reason: Option<String>,
pub status: Option<String>,
}Expand description
Represents a charge to a credit or a debit card.
Fields§
§id: Option<String>§object: Option<String>§amount: Option<i64>§charge: Option<String>§created: Option<i64>§currency: Option<String>§evidence: Option<Evidence>§evidence_details: Option<EvidenceDetails>§is_charge_refundable: Option<bool>§livemode: Option<bool>§submit: Option<bool>§payment_intent: Option<String>§reason: Option<String>§status: Option<String>Implementations§
Source§impl Dispute
impl Dispute
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns an empty Dispute object
§Examples
let mut dispute = payup::stripe::Dispute::new();
dispute.amount = Some(100);Sourcepub async fn async_close(&self, creds: Auth) -> Result<Self, Error>
pub async fn async_close(&self, creds: Auth) -> Result<Self, Error>
Asynchronously close a dispute. Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
let mut dispute = payup::stripe::Dispute::new();
dispute.id = Some(format!("dp_"));
dispute = dispute.async_close(auth.clone()).await?;Sourcepub async fn async_get(creds: Auth, id: String) -> Result<Self, Error>
pub async fn async_get(creds: Auth, id: String) -> Result<Self, Error>
Asynchronously retrieves the dispute with the given ID.
§Arguments
auth- payup::stripe::Auth::new(client, secret)id- The id of the dispute you want to retrieve.
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
// Fetch customer using id
let dispute = payup::stripe::Dispute::async_get(auth, "ch_").await?;Sourcepub async fn async_list(creds: Auth) -> Result<Vec<Self>, Error>
pub async fn async_list(creds: Auth) -> Result<Vec<Self>, Error>
Asynchronously returns all stripe Disputes.
§Arguments
auth- payup::stripe::Auth::new(client, secret)
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
// Fetch all customers from stripe
let disputes = payup::stripe::Dispute::async_list(auth).await?;Sourcepub async fn async_update(&self, creds: Auth) -> Result<Self, Error>
pub async fn async_update(&self, creds: Auth) -> Result<Self, Error>
Asynchronously POSTs an update to an existing Dispute
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
// Crate some evidence to update the dispute with
let mut evidence = payup::stripe::Evidence::new();
evidence.billing_address = Some(format!(""));
evidence.cancellation_policy = Some(format!(""));
let mut dispute = payup::stripe::Dispute::new();
dispute.id = Some(format!("dp_"));
dispute.evidence = Some(evidence);
// Submit the evidence to the bank
dispute.submit = Some(true);
// Update the dispute
dispute = dispute.async_update(auth.clone()).await?;Sourcepub fn close(&self, creds: Auth) -> Result<Self, Error>
pub fn close(&self, creds: Auth) -> Result<Self, Error>
Close a dispute. Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
let mut dispute = payup::stripe::Dispute::new();
dispute.id = Some(format!("dp_"));
dispute = dispute.async_close(auth.clone())?;Sourcepub fn get(creds: Auth, id: String) -> Result<Self, Error>
pub fn get(creds: Auth, id: String) -> Result<Self, Error>
Retrieves the dispute with the given ID.
§Arguments
auth- payup::stripe::Auth::new(client, secret)id- The id of the dispute you want to retrieve.
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
// Fetch customer using id
let dispute = payup::stripe::Dispute::get(auth, "ch_")?;Sourcepub fn update(&self, creds: Auth) -> Result<Self, Error>
pub fn update(&self, creds: Auth) -> Result<Self, Error>
POSTs an update to an existing Dispute
§Examples
// Create the Authentication refererence
let auth = payup::stripe::Auth::new(client, secret);
// Crate some evidence to update the dispute with
let mut evidence = payup::stripe::Evidence::new();
evidence.billing_address = Some(format!(""));
evidence.cancellation_policy = Some(format!(""));
let mut dispute = payup::stripe::Dispute::new();
dispute.id = Some(format!("dp_"));
dispute.evidence = Some(evidence);
// Submit the evidence to the bank
dispute.submit = Some(true);
// Update the dispute
dispute = dispute.async_update(auth.clone())?;Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dispute
impl<'de> Deserialize<'de> for Dispute
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Dispute
impl RefUnwindSafe for Dispute
impl Send for Dispute
impl Sync for Dispute
impl Unpin for Dispute
impl UnsafeUnpin for Dispute
impl UnwindSafe for Dispute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more