pub enum PaymentIntentStatus {
RequiresPaymentMethod,
RequiresAction,
RequiresConfirmation,
Processing,
RequiresCapture,
Succeeded,
Canceled,
}Expand description
The lifecycle state of a PaymentIntent.
Stripe advances a PaymentIntent through these states as the card
is authenticated. Only the Succeeded and Cancel states are
terminal.
Variants§
RequiresPaymentMethod
Stripe has created the intent and is waiting for a payment method.
RequiresAction
A payment method is attached and awaiting customer action.
RequiresConfirmation
The customer must confirm the payment on their own device.
Processing
The payment is processing and the result is not yet final.
RequiresCapture
Separate auth-and-capture flows park here until captured.
Succeeded
The payment completed and the funds are captured.
Canceled
The payment can no longer succeed without a new attempt.
Implementations§
Source§impl PaymentIntentStatus
impl PaymentIntentStatus
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Return the wire string Stripe uses for this state.
§Returns
&'static str- thestatusvalue in a Stripe response.
Sourcepub const fn is_terminal(&self) -> bool
pub const fn is_terminal(&self) -> bool
Return whether no further state change is possible.
§Returns
bool-trueforSucceededandCanceled, the two states Stripe never moves out of.
Sourcepub const fn can_transition_to(&self, next: &PaymentIntentStatus) -> bool
pub const fn can_transition_to(&self, next: &PaymentIntentStatus) -> bool
Return whether Stripe can move this state to next.
The table mirrors the PaymentIntent lifecycle Stripe documents:
a failed confirmation returns the intent to
RequiresPaymentMethod so the customer can retry, a manual
capture flow parks on RequiresCapture, and neither
Succeeded nor Canceled ever moves again.
§Arguments
&PaymentIntentStatus- the state Stripe would move into.
§Returns
bool-truewhen the transition is reachable.
Trait Implementations§
Source§impl Clone for PaymentIntentStatus
impl Clone for PaymentIntentStatus
Source§fn clone(&self) -> PaymentIntentStatus
fn clone(&self) -> PaymentIntentStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more