Struct stripe::SetupIntent
source · [−]pub struct SetupIntent {Show 22 fields
pub id: SetupIntentId,
pub application: Option<Expandable<Application>>,
pub attach_to_self: Option<bool>,
pub cancellation_reason: Option<SetupIntentCancellationReason>,
pub client_secret: Option<String>,
pub created: Timestamp,
pub customer: Option<Expandable<Customer>>,
pub description: Option<String>,
pub flow_directions: Option<Vec<SetupIntentFlowDirections>>,
pub last_setup_error: Option<Box<ApiErrors>>,
pub latest_attempt: Option<Expandable<SetupAttempt>>,
pub livemode: bool,
pub mandate: Option<Expandable<Mandate>>,
pub metadata: Metadata,
pub next_action: Option<SetupIntentNextAction>,
pub on_behalf_of: Option<Expandable<Account>>,
pub payment_method: Option<Expandable<PaymentMethod>>,
pub payment_method_options: Option<SetupIntentPaymentMethodOptions>,
pub payment_method_types: Vec<String>,
pub single_use_mandate: Option<Expandable<Mandate>>,
pub status: SetupIntentStatus,
pub usage: String,
}
Expand description
The resource representing a Stripe “SetupIntent”.
For more details see https://stripe.com/docs/api/setup_intents/object
Fields
id: SetupIntentId
Unique identifier for the object.
application: Option<Expandable<Application>>
ID of the Connect application that created the SetupIntent.
attach_to_self: Option<bool>
If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.
It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
cancellation_reason: Option<SetupIntentCancellationReason>
Reason for cancellation of this SetupIntent, one of abandoned
, requested_by_customer
, or duplicate
.
client_secret: Option<String>
The client secret of this SetupIntent.
Used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
created: Timestamp
Time at which the object was created.
Measured in seconds since the Unix epoch.
customer: Option<Expandable<Customer>>
ID of the Customer this SetupIntent belongs to, if one exists.
If present, the SetupIntent’s payment method will be attached to the Customer on successful setup.
Payment methods attached to other Customers cannot be used with this SetupIntent.
description: Option<String>
An arbitrary string attached to the object.
Often useful for displaying to users.
flow_directions: Option<Vec<SetupIntentFlowDirections>>
Indicates the directions of money movement for which this payment method is intended to be used.
Include inbound
if you intend to use the payment method as the origin to pull funds from.
Include outbound
if you intend to use the payment method as the destination to send funds to.
You can include both if you intend to use the payment method for both purposes.
last_setup_error: Option<Box<ApiErrors>>
The error encountered in the previous SetupIntent confirmation.
latest_attempt: Option<Expandable<SetupAttempt>>
The most recent SetupAttempt for this SetupIntent.
livemode: bool
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
mandate: Option<Expandable<Mandate>>
ID of the multi use Mandate generated by the SetupIntent.
metadata: Metadata
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
next_action: Option<SetupIntentNextAction>
If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
on_behalf_of: Option<Expandable<Account>>
The account (if any) for which the setup is intended.
payment_method: Option<Expandable<PaymentMethod>>
ID of the payment method used with this SetupIntent.
payment_method_options: Option<SetupIntentPaymentMethodOptions>
Payment-method-specific configuration for this SetupIntent.
payment_method_types: Vec<String>
The list of payment method types (e.g.
card) that this SetupIntent is allowed to set up.
single_use_mandate: Option<Expandable<Mandate>>
ID of the single_use Mandate generated by the SetupIntent.
status: SetupIntentStatus
Status of this SetupIntent, one of requires_payment_method
, requires_confirmation
, requires_action
, processing
, canceled
, or succeeded
.
usage: String
Indicates how the payment method is intended to be used in the future.
Use on_session
if you intend to only reuse the payment method when the customer is in your checkout flow.
Use off_session
if your customer may or may not be in your checkout flow.
If not provided, this value defaults to off_session
.
Implementations
sourceimpl SetupIntent
impl SetupIntent
sourcepub fn list(
client: &Client,
params: &ListSetupIntents<'_>
) -> Response<List<SetupIntent>>
pub fn list(
client: &Client,
params: &ListSetupIntents<'_>
) -> Response<List<SetupIntent>>
Returns a list of SetupIntents.
sourcepub fn create(
client: &Client,
params: CreateSetupIntent<'_>
) -> Response<SetupIntent>
pub fn create(
client: &Client,
params: CreateSetupIntent<'_>
) -> Response<SetupIntent>
Creates a SetupIntent object.
After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
sourcepub fn retrieve(
client: &Client,
id: &SetupIntentId,
expand: &[&str]
) -> Response<SetupIntent>
pub fn retrieve(
client: &Client,
id: &SetupIntentId,
expand: &[&str]
) -> Response<SetupIntent>
Retrieves the details of a SetupIntent that has previously been created.
Client-side retrieval using a publishable key is allowed when the client_secret
is provided in the query string.
When retrieved with a publishable key, only a subset of properties will be returned.
Please refer to the SetupIntent object reference for more details.
sourcepub fn update(
client: &Client,
id: &SetupIntentId,
params: UpdateSetupIntent<'_>
) -> Response<SetupIntent>
pub fn update(
client: &Client,
id: &SetupIntentId,
params: UpdateSetupIntent<'_>
) -> Response<SetupIntent>
Updates a SetupIntent object.
sourceimpl SetupIntent
impl SetupIntent
pub fn confirm(
client: &Client,
setup_id: &SetupIntentId,
params: ConfirmSetupIntent
) -> Response<SetupIntent>
Trait Implementations
sourceimpl Clone for SetupIntent
impl Clone for SetupIntent
sourcefn clone(&self) -> SetupIntent
fn clone(&self) -> SetupIntent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SetupIntent
impl Debug for SetupIntent
sourceimpl Default for SetupIntent
impl Default for SetupIntent
sourcefn default() -> SetupIntent
fn default() -> SetupIntent
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for SetupIntent
impl<'de> Deserialize<'de> for SetupIntent
sourcefn 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
sourceimpl Object for SetupIntent
impl Object for SetupIntent
sourceimpl Serialize for SetupIntent
impl Serialize for SetupIntent
Auto Trait Implementations
impl RefUnwindSafe for SetupIntent
impl Send for SetupIntent
impl Sync for SetupIntent
impl Unpin for SetupIntent
impl UnwindSafe for SetupIntent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more