Struct Source

Source
pub struct Source {
Show 38 fields pub ach_credit_transfer: Option<SourceTypeAchCreditTransfer>, pub ach_debit: Option<SourceTypeAchDebit>, pub acss_debit: Option<SourceTypeAcssDebit>, pub alipay: Option<SourceTypeAlipay>, pub allow_redisplay: Option<SourceAllowRedisplay>, pub amount: Option<i64>, pub au_becs_debit: Option<SourceTypeAuBecsDebit>, pub bancontact: Option<SourceTypeBancontact>, pub card: Option<SourceTypeCard>, pub card_present: Option<SourceTypeCardPresent>, pub client_secret: String, pub code_verification: Option<SourceCodeVerificationFlow>, pub created: Timestamp, pub currency: Option<Currency>, pub customer: Option<String>, pub eps: Option<SourceTypeEps>, pub flow: String, pub giropay: Option<SourceTypeGiropay>, pub id: SourceId, pub ideal: Option<SourceTypeIdeal>, pub klarna: Option<SourceTypeKlarna>, pub livemode: bool, pub metadata: Option<HashMap<String, String>>, pub multibanco: Option<SourceTypeMultibanco>, pub owner: Option<SourceOwner>, pub p24: Option<SourceTypeP24>, pub receiver: Option<SourceReceiverFlow>, pub redirect: Option<SourceRedirectFlow>, pub sepa_credit_transfer: Option<SourceTypeSepaCreditTransfer>, pub sepa_debit: Option<SourceTypeSepaDebit>, pub sofort: Option<SourceTypeSofort>, pub source_order: Option<SourceOrder>, pub statement_descriptor: Option<String>, pub status: String, pub three_d_secure: Option<SourceTypeThreeDSecure>, pub type_: SourceType, pub usage: Option<String>, pub wechat: Option<SourceTypeWechat>,
}
Expand description

Source objects allow you to accept a variety of payment methods. They represent a customer’s payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn’t recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

For more details see <https://stripe.com/docs/api/sources/object>.

Fields§

§ach_credit_transfer: Option<SourceTypeAchCreditTransfer>§ach_debit: Option<SourceTypeAchDebit>§acss_debit: Option<SourceTypeAcssDebit>§alipay: Option<SourceTypeAlipay>§allow_redisplay: Option<SourceAllowRedisplay>

This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.

§amount: Option<i64>

A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources.

§au_becs_debit: Option<SourceTypeAuBecsDebit>§bancontact: Option<SourceTypeBancontact>§card: Option<SourceTypeCard>§card_present: Option<SourceTypeCardPresent>§client_secret: String

The client secret of the source. Used for client-side retrieval using a publishable key.

§code_verification: Option<SourceCodeVerificationFlow>§created: Timestamp

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

§currency: Option<Currency>

Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources.

§customer: Option<String>

The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.

§eps: Option<SourceTypeEps>§flow: String

The authentication flow of the source. flow is one of redirect, receiver, code_verification, none.

§giropay: Option<SourceTypeGiropay>§id: SourceId

Unique identifier for the object.

§ideal: Option<SourceTypeIdeal>§klarna: Option<SourceTypeKlarna>§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: Option<HashMap<String, String>>

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.

§multibanco: Option<SourceTypeMultibanco>§owner: Option<SourceOwner>

Information about the owner of the payment instrument that may be used or required by particular source types.

§p24: Option<SourceTypeP24>§receiver: Option<SourceReceiverFlow>§redirect: Option<SourceRedirectFlow>§sepa_credit_transfer: Option<SourceTypeSepaCreditTransfer>§sepa_debit: Option<SourceTypeSepaDebit>§sofort: Option<SourceTypeSofort>§source_order: Option<SourceOrder>§statement_descriptor: Option<String>

Extra information about a source. This will appear on your customer’s statement every time you charge the source.

§status: String

The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.

§three_d_secure: Option<SourceTypeThreeDSecure>§type_: SourceType

The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.

§usage: Option<String>

Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.

§wechat: Option<SourceTypeWechat>

Trait Implementations§

Source§

impl Clone for Source

Source§

fn clone(&self) -> Source

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 Source

Source§

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

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

impl Deserialize for Source

Source§

fn begin(out: &mut Option<Self>) -> &mut dyn Visitor

The only correct implementation of this method is: Read more
Source§

impl FromValueOpt for Source

Source§

impl Object for Source

Source§

type Id = SourceId

The canonical id type for this object.
Source§

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

The id of the object.
Source§

fn into_id(self) -> Self::Id

The owned id of the object.
Source§

impl ObjectDeser for Source

Auto Trait Implementations§

§

impl Freeze for Source

§

impl RefUnwindSafe for Source

§

impl Send for Source

§

impl Sync for Source

§

impl Unpin for Source

§

impl UnwindSafe for Source

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