Struct stripe::PaymentIntent

source ·
pub struct PaymentIntent {
Show 39 fields pub id: PaymentIntentId, pub amount: i64, pub amount_capturable: i64, pub amount_details: Option<PaymentFlowsAmountDetails>, pub amount_received: i64, pub application: Option<Expandable<Application>>, pub application_fee_amount: Option<i64>, pub automatic_payment_methods: Option<PaymentFlowsAutomaticPaymentMethodsPaymentIntent>, pub canceled_at: Option<Timestamp>, pub cancellation_reason: Option<PaymentIntentCancellationReason>, pub capture_method: PaymentIntentCaptureMethod, pub client_secret: Option<String>, pub confirmation_method: PaymentIntentConfirmationMethod, pub created: Timestamp, pub currency: Currency, pub customer: Option<Expandable<Customer>>, pub description: Option<String>, pub invoice: Option<Expandable<Invoice>>, pub last_payment_error: Option<Box<ApiErrors>>, pub latest_charge: Option<Expandable<Charge>>, pub livemode: bool, pub metadata: Metadata, pub next_action: Option<PaymentIntentNextAction>, pub on_behalf_of: Option<Expandable<Account>>, pub payment_method: Option<Expandable<PaymentMethod>>, pub payment_method_configuration_details: Option<PaymentMethodConfigBizPaymentMethodConfigurationDetails>, pub payment_method_options: Option<PaymentIntentPaymentMethodOptions>, pub payment_method_types: Vec<String>, pub processing: Option<PaymentIntentProcessing>, pub receipt_email: Option<String>, pub review: Option<Expandable<Review>>, pub setup_future_usage: Option<PaymentIntentSetupFutureUsage>, pub shipping: Option<Shipping>, pub source: Option<Expandable<PaymentSource>>, pub statement_descriptor: Option<String>, pub statement_descriptor_suffix: Option<String>, pub status: PaymentIntentStatus, pub transfer_data: Option<TransferData>, pub transfer_group: Option<String>,
}
Expand description

The resource representing a Stripe “PaymentIntent”.

For more details see https://stripe.com/docs/api/payment_intents/object

Fields§

§id: PaymentIntentId

Unique identifier for the object.

§amount: i64

Amount intended to be collected by this PaymentIntent.

A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

§amount_capturable: i64

Amount that can be captured from this PaymentIntent.

§amount_details: Option<PaymentFlowsAmountDetails>§amount_received: i64

Amount that this PaymentIntent collects.

§application: Option<Expandable<Application>>

ID of the Connect application that created the PaymentIntent.

§application_fee_amount: Option<i64>

The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account.

The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts.

§automatic_payment_methods: Option<PaymentFlowsAutomaticPaymentMethodsPaymentIntent>

Settings to configure compatible payment methods from the Stripe Dashboard.

§canceled_at: Option<Timestamp>

Populated when status is canceled, this is the time at which the PaymentIntent was canceled.

Measured in seconds since the Unix epoch.

§cancellation_reason: Option<PaymentIntentCancellationReason>

Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic).

§capture_method: PaymentIntentCaptureMethod

Controls when the funds will be captured from the customer’s account.

§client_secret: Option<String>

The client secret of this PaymentIntent.

Used for client-side retrieval using a publishable key. The client secret can be used to complete a payment 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. Refer to our docs to accept a payment and learn about how client_secret should be handled.

§confirmation_method: PaymentIntentConfirmationMethod

Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.

§created: Timestamp

Time at which the object was created.

Measured in seconds since the Unix epoch.

§currency: Currency

Three-letter ISO currency code, in lowercase.

Must be a supported currency.

§customer: Option<Expandable<Customer>>

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

§description: Option<String>

An arbitrary string attached to the object.

Often useful for displaying to users.

§invoice: Option<Expandable<Invoice>>

ID of the invoice that created this PaymentIntent, if it exists.

§last_payment_error: Option<Box<ApiErrors>>

The payment error encountered in the previous PaymentIntent confirmation.

It will be cleared if the PaymentIntent is later updated for any reason.

§latest_charge: Option<Expandable<Charge>>

The latest charge created by this PaymentIntent.

§livemode: bool

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

§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. Learn more about storing information in metadata.

§next_action: Option<PaymentIntentNextAction>

If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.

§on_behalf_of: Option<Expandable<Account>>

The account (if any) for which the funds of the PaymentIntent are intended.

See the PaymentIntents use case for connected accounts for details.

§payment_method: Option<Expandable<PaymentMethod>>

ID of the payment method used in this PaymentIntent.

§payment_method_configuration_details: Option<PaymentMethodConfigBizPaymentMethodConfigurationDetails>

Information about the payment method configuration used for this PaymentIntent.

§payment_method_options: Option<PaymentIntentPaymentMethodOptions>

Payment-method-specific configuration for this PaymentIntent.

§payment_method_types: Vec<String>

The list of payment method types (e.g.

card) that this PaymentIntent is allowed to use.

§processing: Option<PaymentIntentProcessing>

If present, this property tells you about the processing state of the payment.

§receipt_email: Option<String>

Email address that the receipt for the resulting payment will be sent to.

If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings.

§review: Option<Expandable<Review>>

ID of the review associated with this PaymentIntent, if any.

§setup_future_usage: Option<PaymentIntentSetupFutureUsage>

Indicates that you intend to make future payments with this PaymentIntent’s payment method.

Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes. When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.

§shipping: Option<Shipping>

Shipping information for this PaymentIntent.

§source: Option<Expandable<PaymentSource>>

This is a legacy field that will be removed in the future.

It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.

§statement_descriptor: Option<String>

For card charges, use statement_descriptor_suffix.

Otherwise, you can use this value as the complete description of a charge on your customers’ statements. It must contain at least one letter and be 1–22 characters long.

§statement_descriptor_suffix: Option<String>

Provides information about a card payment that customers see on their statements.

Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.

§status: PaymentIntentStatus

Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded.

Read more about each PaymentIntent status.

§transfer_data: Option<TransferData>

The data that automatically creates a Transfer after the payment finalizes.

Learn more about the use case for connected accounts.

§transfer_group: Option<String>

A string that identifies the resulting payment as part of a group.

Learn more about the use case for connected accounts.

Implementations§

source§

impl PaymentIntent

source

pub fn list( client: &Client, params: &ListPaymentIntents<'_> ) -> Response<List<PaymentIntent>>

Returns a list of PaymentIntents.

source

pub fn create( client: &Client, params: CreatePaymentIntent<'_> ) -> Response<PaymentIntent>

Creates a PaymentIntent object.

After the PaymentIntent is created, attach a payment method and confirm to continue the payment.

Learn more about the available payment flows with the Payment Intents API. When you use confirm=true during creation, it’s equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the confirm API when you supply confirm=true.

source

pub fn retrieve( client: &Client, id: &PaymentIntentId, expand: &[&str] ) -> Response<PaymentIntent>

Retrieves the details of a PaymentIntent that has previously been created.

You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the payment intent object reference for more details.

source

pub fn update( client: &Client, id: &PaymentIntentId, params: UpdatePaymentIntent<'_> ) -> Response<PaymentIntent>

Updates properties on a PaymentIntent object without confirming.

Depending on which properties you update, you might need to confirm the PaymentIntent again.

For example, updating the payment_method always requires you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties through the confirm API instead.

source§

impl PaymentIntent

source

pub fn confirm( client: &Client, payment_intent_id: &str, params: PaymentIntentConfirmParams<'_> ) -> Response<PaymentIntent>

Confirm that customer intends to pay with current or provided source. Upon confirmation, the PaymentIntent will attempt to initiate a payment.

For more details see https://stripe.com/docs/api/payment_intents/confirm.

source

pub fn capture( client: &Client, payment_intent_id: &str, params: CapturePaymentIntent ) -> Response<PaymentIntent>

Capture the funds of an existing uncaptured PaymentIntent where required_action=“requires_capture”.

For more details see https://stripe.com/docs/api/payment_intents/capture.

source

pub fn cancel( client: &Client, payment_intent_id: &str, params: CancelPaymentIntent ) -> Response<PaymentIntent>

A PaymentIntent object can be canceled when it is in one of these statuses: requires_source, requires_capture, requires_confirmation, requires_source_action.

For more details see https://stripe.com/docs/api/payment_intents/cancel.

source

pub fn search( client: &Client, params: PaymentIntentSearchParams<'_> ) -> Response<SearchList<PaymentIntent>>

Searches for a payment intent.

For more details see https://stripe.com/docs/api/payment_intents/search.

Trait Implementations§

source§

impl Clone for PaymentIntent

source§

fn clone(&self) -> PaymentIntent

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for PaymentIntent

source§

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

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

impl Default for PaymentIntent

source§

fn default() -> PaymentIntent

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

impl<'de> Deserialize<'de> for PaymentIntent

source§

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

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

impl Object for PaymentIntent

§

type Id = PaymentIntentId

The canonical id type for this object.
source§

fn id(&self) -> Self::Id

The id of the object.
source§

fn object(&self) -> &'static str

The object’s type, typically represented in wire format as the object property.
source§

impl Serialize for PaymentIntent

source§

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

Serialize this value into the given Serde serializer. Read more

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

§

type Output = T

Should always be Self
source§

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

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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