Skip to main content

ChargeStatus

Enum ChargeStatus 

Source
pub enum ChargeStatus {
    Pending,
    Succeeded,
    Authorized,
    Failed,
}
Expand description

Whether the charge actually took the customer’s money.

Stripe distinguishes a charge that captured funds from one that was authorised but not captured, and from one that failed outright.

Variants§

§

Pending

Stripe has the customer’s details but has not taken money yet.

§

Succeeded

The charge succeeded and the funds are captured.

§

Authorized

The charge was authorised but not captured.

§

Failed

The charge failed and no money moved.

Implementations§

Source§

impl ChargeStatus

Source

pub const fn as_str(&self) -> &'static str

Return the wire string Stripe uses for this status.

§Returns
  • &'static str - the status value in a Stripe response.
Source

pub const fn is_captured(&self) -> bool

Return whether the charge moved money.

An authorised charge has reserved funds but not taken them, so it is deliberately not counted as captured.

§Returns
  • bool - true only for a succeeded charge.

Trait Implementations§

Source§

impl Clone for ChargeStatus

Source§

fn clone(&self) -> ChargeStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ChargeStatus

Source§

impl Debug for ChargeStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ChargeStatus

Source§

fn default() -> ChargeStatus

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ChargeStatus

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ChargeStatus, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ChargeStatus

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Render the wire string.

§Arguments
  • &mut Formatter<'_> - the formatter to write the value into.
§Returns

A Formatter writing the status as Stripe spells it.

Source§

impl Eq for ChargeStatus

Source§

impl Hash for ChargeStatus

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ChargeStatus

Source§

fn eq(&self, other: &ChargeStatus) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ChargeStatus

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ChargeStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.