[][src]Struct stripe::Charge

pub struct Charge {
    pub id: ChargeId,
    pub amount: i64,
    pub amount_refunded: i64,
    pub application: Option<Expandable<Application>>,
    pub application_fee: Option<Expandable<ApplicationFee>>,
    pub application_fee_amount: Option<i64>,
    pub balance_transaction: Option<Expandable<BalanceTransaction>>,
    pub billing_details: BillingDetails,
    pub captured: bool,
    pub created: Timestamp,
    pub currency: Currency,
    pub customer: Option<Expandable<Customer>>,
    pub description: Option<String>,
    pub dispute: Option<Expandable<Dispute>>,
    pub failure_code: Option<String>,
    pub failure_message: Option<String>,
    pub fraud_details: Option<FraudDetails>,
    pub invoice: Option<Expandable<Invoice>>,
    pub livemode: bool,
    pub metadata: Metadata,
    pub on_behalf_of: Option<Expandable<Account>>,
    pub order: Option<Expandable<Order>>,
    pub outcome: Option<ChargeOutcome>,
    pub paid: bool,
    pub payment_intent: Option<String>,
    pub payment_method: Option<String>,
    pub payment_method_details: Option<PaymentMethodDetails>,
    pub receipt_email: Option<String>,
    pub receipt_number: Option<String>,
    pub receipt_url: String,
    pub refunded: bool,
    pub refunds: List<Refund>,
    pub review: Option<Expandable<Review>>,
    pub shipping: Option<Shipping>,
    pub source: Option<PaymentSource>,
    pub source_transfer: Option<Expandable<Transfer>>,
    pub statement_descriptor: Option<String>,
    pub status: String,
    pub transfer: Option<Expandable<Transfer>>,
    pub transfer_data: Option<TransferData>,
    pub transfer_group: Option<String>,
}

The resource representing a Stripe "Charge".

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

Fields

id: ChargeId

Unique identifier for the object.

amount: i64

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.

amount_refunded: i64

Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).

application: Option<Expandable<Application>>

ID of the Connect application that created the charge.

application_fee: Option<Expandable<ApplicationFee>>

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

See the Connect documentation for details.

balance_transaction: Option<Expandable<BalanceTransaction>>

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

billing_details: BillingDetailscaptured: bool

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

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

description: Option<String>

An arbitrary string attached to the object.

Often useful for displaying to users.

dispute: Option<Expandable<Dispute>>

Details about the dispute if the charge has been disputed.

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

Information on fraud assessments for the charge.

invoice: Option<Expandable<Invoice>>

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

on_behalf_of: Option<Expandable<Account>>

The account (if any) the charge was made on behalf of without triggering an automatic transfer.

See the Connect documentation for details.

order: Option<Expandable<Order>>

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

outcome: Option<ChargeOutcome>

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

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

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

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: 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: List<Refund>

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

review: Option<Expandable<Review>>

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

shipping: Option<Shipping>

Shipping information for the charge.

source: Option<PaymentSource>

For most Stripe users, the source of every charge is a credit or debit card.

This hash is then the card object describing that card.

source_transfer: Option<Expandable<Transfer>>

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>

Extra information about a charge.

This will appear on your customer's credit card statement. It must contain at least one letter.

status: String

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

transfer: Option<Expandable<Transfer>>

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

transfer_data: Option<TransferData>

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.

Methods

impl Charge[src]

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

Returns a list of charges you’ve previously created.

The charges are returned in sorted order, with the most recent charges appearing first.

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

To charge a credit card or other payment source, you create a Charge object.

If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).

pub fn retrieve(
    client: &Client,
    id: &ChargeId,
    expand: &[&str]
) -> Response<Charge>
[src]

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

Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.

pub fn update(
    client: &Client,
    id: &ChargeId,
    params: UpdateCharge
) -> Response<Charge>
[src]

Updates the specified charge by setting the values of the parameters passed.

Any parameters not provided will be left unchanged.

impl Charge[src]

pub fn capture(
    client: &Client,
    charge_id: &ChargeId,
    params: CaptureCharge
) -> Response<Charge>
[src]

Capture captures a previously created charge with capture set to false.

For more details see https://stripe.com/docs/api#charge_capture.

Trait Implementations

impl Object for Charge[src]

type Id = ChargeId

The canonical id type for this object.

impl Clone for Charge[src]

impl Debug for Charge[src]

impl Serialize for Charge[src]

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

Auto Trait Implementations

impl Unpin for Charge

impl Sync for Charge

impl Send for Charge

impl UnwindSafe for Charge

impl RefUnwindSafe for Charge

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