[][src]Struct stripe::PaymentIntent

pub struct PaymentIntent {
    pub id: PaymentIntentId,
    pub amount: i64,
    pub amount_capturable: Option<i64>,
    pub amount_received: Option<i64>,
    pub application: Option<Expandable<Application>>,
    pub application_fee_amount: Option<i64>,
    pub canceled_at: Option<Timestamp>,
    pub cancellation_reason: Option<PaymentIntentCancellationReason>,
    pub capture_method: PaymentIntentCaptureMethod,
    pub charges: List<Charge>,
    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<PaymentError>,
    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_types: Vec<String>,
    pub receipt_email: Option<String>,
    pub review: Option<Expandable<Review>>,
    pub shipping: Option<Shipping>,
    pub source: Option<Expandable<PaymentSource>>,
    pub statement_descriptor: Option<String>,
    pub status: PaymentIntentStatus,
    pub transfer_data: Option<TransferData>,
    pub transfer_group: Option<String>,
}

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.

amount_capturable: Option<i64>

Amount that can be captured from this PaymentIntent.

amount_received: Option<i64>

Amount that was collected by this PaymentIntent.

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) for the resulting payment.

See the PaymentIntents use case for connected accounts for details.

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

Capture method of this PaymentIntent, one of automatic or manual.

charges: List<Charge>

Charges that were created by this PaymentIntent, if any.

client_secret: Option<String>

The client secret of this PaymentIntent.

Used for client-side retrieval using a publishable key. Please refer to our automatic confirmation quickstart guide to learn about how client_secret should be handled.

confirmation_method: PaymentIntentConfirmationMethod

Confirmation method of this PaymentIntent, one of manual or automatic.

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 is for if one exists.

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<PaymentError>

The payment error encountered in the previous PaymentIntent confirmation.

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. For more information, see the documentation.

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_types: Vec<String>

The list of payment method types (e.g.

card) that this PaymentIntent is allowed to use.

receipt_email: Option<String>

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

review: Option<Expandable<Review>>

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

shipping: Option<Shipping>

Shipping information for this PaymentIntent.

source: Option<Expandable<PaymentSource>>

ID of the source used in this PaymentIntent.

statement_descriptor: Option<String>

Extra information about a PaymentIntent.

This will appear on your customer's statement when this PaymentIntent succeeds in creating a charge.

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 with which to automatically create a Transfer when the payment is finalized.

See the PaymentIntents use case for connected accounts for details.

transfer_group: Option<String>

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

See the PaymentIntents use case for connected accounts for details.

Methods

impl PaymentIntent[src]

pub fn create(
    client: &Client,
    params: PaymentIntentCreateParams
) -> Response<PaymentIntent>
[src]

Creates a new payment_intent.

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

pub fn retrieve(
    client: &Client,
    payment_intent_id: &str
) -> Response<PaymentIntent>
[src]

Retrieves the details of a payment_intent.

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

pub fn update(
    client: &Client,
    payment_intent_id: &str,
    params: PaymentIntentUpdateParams
) -> Response<PaymentIntent>
[src]

Updates a payment_intent's properties.

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

pub fn confirm(
    client: &Client,
    payment_intent_id: &str,
    params: PaymentIntentConfirmParams
) -> Response<PaymentIntent>
[src]

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.

pub fn capture(
    client: &Client,
    payment_intent_id: &str,
    params: PaymentIntentCaptureParams
) -> Response<PaymentIntent>
[src]

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.

pub fn cancel(
    client: &Client,
    payment_intent_id: &str,
    params: PaymentIntentCancelParams
) -> Response<PaymentIntent>
[src]

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.

pub fn list(
    client: &Client,
    params: PaymentIntentListParams
) -> Response<List<PaymentIntent>>
[src]

List all payment_intents.

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

Trait Implementations

impl Object for PaymentIntent[src]

type Id = PaymentIntentId

The canonical id type for this object.

impl Clone for PaymentIntent[src]

impl Debug for PaymentIntent[src]

impl Serialize for PaymentIntent[src]

impl<'de> Deserialize<'de> for PaymentIntent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

impl<T> Erased for T

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self