Charge

Struct Charge 

Source
pub struct Charge {
Show 45 fields pub amount: i64, pub amount_captured: i64, pub amount_refunded: i64, pub application: Option<Value>, pub application_fee: Option<Value>, pub application_fee_amount: Option<i64>, pub balance_transaction: Option<Value>, pub billing_details: BillingDetails, pub calculated_statement_descriptor: Option<String>, pub captured: bool, pub created: i64, pub currency: String, pub customer: Option<Value>, pub description: Option<String>, pub disputed: bool, pub failure_balance_transaction: Option<Value>, pub failure_code: Option<String>, pub failure_message: Option<String>, pub fraud_details: Option<Value>, pub id: String, pub invoice: Option<Value>, pub livemode: bool, pub metadata: Value, pub object: String, pub on_behalf_of: Option<Value>, pub outcome: Option<Value>, pub paid: bool, pub payment_intent: Option<Value>, pub payment_method: Option<String>, pub payment_method_details: Option<Value>, pub radar_options: Option<RadarRadarOptions>, pub receipt_email: Option<String>, pub receipt_number: Option<String>, pub receipt_url: Option<String>, pub refunded: bool, pub refunds: Option<RefundList>, pub review: Option<Value>, pub shipping: Option<Value>, pub source_transfer: Option<Value>, pub statement_descriptor: Option<String>, pub statement_descriptor_suffix: Option<String>, pub status: String, pub transfer: Option<Value>, pub transfer_data: Option<Value>, pub transfer_group: Option<String>,
}
Expand description

The Charge object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but transferring money to a different Stripe account through Connect also creates Charges. Some legacy payment flows create Charges directly, which is not recommended for new integrations.

Fields§

§amount: i64

Amount intended to be collected by this payment. 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_captured: i64

Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made).

§amount_refunded: i64

Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued).

§application: Option<Value>

ID of the Connect application that created the charge.

§application_fee: Option<Value>

The application fee (if any) for the charge. See the Connect documentation for details.

§application_fee_amount: Option<i64>

The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.

§balance_transaction: Option<Value>

ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).

§billing_details: BillingDetails
§calculated_statement_descriptor: Option<String>

The full statement descriptor that is passed to card networks, and that is displayed on your customers’ credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.

§captured: bool

If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.

§created: i64

Time at which the object was created. Measured in seconds since the Unix epoch.

§currency: String

Three-letter ISO currency code, in lowercase. Must be a supported currency.

§customer: Option<Value>

ID of the customer this charge is for if one exists.

§description: Option<String>

An arbitrary string attached to the object. Often useful for displaying to users.

§disputed: bool

Whether the charge has been disputed.

§failure_balance_transaction: Option<Value>

ID of the balance transaction that describes the reversal of the balance on your account due to payment failure.

§failure_code: Option<String>

Error code explaining reason for charge failure if available (see the errors section for a list of codes).

§failure_message: Option<String>

Message to user further explaining reason for charge failure if available.

§fraud_details: Option<Value>

Information on fraud assessments for the charge.

§id: String

Unique identifier for the object.

§invoice: Option<Value>

ID of the invoice this charge is for if one exists.

§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: Value

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.

§object: String

String representing the object’s type. Objects of the same type share the same value.

§on_behalf_of: Option<Value>

The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details.

§outcome: Option<Value>

Details about whether the payment was accepted, and why. See understanding declines for details.

§paid: bool

true if the charge succeeded, or was successfully authorized for later capture.

§payment_intent: Option<Value>

ID of the PaymentIntent associated with this charge, if one exists.

§payment_method: Option<String>

ID of the payment method used in this charge.

§payment_method_details: Option<Value>

Details about the payment method at the time of the transaction.

§radar_options: Option<RadarRadarOptions>

Options to configure Radar. See Radar Session for more information.

§receipt_email: Option<String>

This is the email address that the receipt for this charge was sent to.

§receipt_number: Option<String>

This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent.

§receipt_url: Option<String>

This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.

§refunded: bool

Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.

§refunds: Option<RefundList>

A list of refunds that have been applied to the charge.

§review: Option<Value>

ID of the review associated with this charge if one exists.

§shipping: Option<Value>

Shipping information for the charge.

§source_transfer: Option<Value>

The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details.

§statement_descriptor: Option<String>

For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.

§statement_descriptor_suffix: Option<String>

Provides information about the charge 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: String

The status of the payment is either succeeded, pending, or failed.

§transfer: Option<Value>

ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter).

§transfer_data: Option<Value>

An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.

§transfer_group: Option<String>

A string that identifies this transaction as part of a group. See the Connect documentation for details.

Trait Implementations§

Source§

impl Clone for Charge

Source§

fn clone(&self) -> Charge

Returns a duplicate 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 Charge

Source§

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

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

impl Default for Charge

Source§

fn default() -> Charge

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

impl<'de> Deserialize<'de> for Charge

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 Display for Charge

Source§

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

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

impl Serialize for Charge

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§

§

impl Freeze for Charge

§

impl RefUnwindSafe for Charge

§

impl Send for Charge

§

impl Sync for Charge

§

impl Unpin for Charge

§

impl UnwindSafe for Charge

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> 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> 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 = 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>,

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