Struct stripe::CreateSource

source ·
pub struct CreateSource<'a> {
Show 15 fields pub amount: Option<i64>, pub currency: Option<Currency>, pub customer: Option<CustomerId>, pub expand: &'a [&'a str], pub flow: Option<SourceFlow>, pub mandate: Option<SourceMandateParams>, pub metadata: Option<Metadata>, pub original_source: Option<&'a str>, pub owner: Option<BillingDetails>, pub receiver: Option<CreateSourceReceiver>, pub redirect: Option<CreateSourceRedirect>, pub source_order: Option<CreateSourceSourceOrder>, pub statement_descriptor: Option<&'a str>, pub token: Option<TokenId>, pub type_: Option<&'a str>,
}
Expand description

The parameters for Source::create.

Fields§

§amount: Option<i64>

Amount associated with the source.

This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land.

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

§customer: Option<CustomerId>

The Customer to whom the original source is attached to.

Must be set when the original source is not a Source (e.g., Card).

§expand: &'a [&'a str]

Specifies which fields in the response should be expanded.

§flow: Option<SourceFlow>

The authentication flow of the source to create.

flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows.

§mandate: Option<SourceMandateParams>

Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.

§metadata: Option<Metadata>§original_source: Option<&'a str>

The source to share.

§owner: Option<BillingDetails>

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

§receiver: Option<CreateSourceReceiver>

Optional parameters for the receiver flow.

Can be set only if the source is a receiver (flow is receiver).

§redirect: Option<CreateSourceRedirect>

Parameters required for the redirect flow.

Required if the source is authenticated by a redirect (flow is redirect).

§source_order: Option<CreateSourceSourceOrder>

Information about the items and shipping associated with the source.

Required for transactional credit (for example Klarna) sources before you can charge it.

§statement_descriptor: Option<&'a str>

An arbitrary string to be displayed on your customer’s statement.

As an example, if your website is RunClub and the item you’re charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all.

§token: Option<TokenId>

An optional token used to create the source.

When passed, token properties will override source parameters.

§type_: Option<&'a str>

The type of the source to create.

Required unless customer and original_source are specified (see the Cloning card Sources guide).

Implementations§

source§

impl<'a> CreateSource<'a>

source

pub fn new() -> Self

Trait Implementations§

source§

impl<'a> Clone for CreateSource<'a>

source§

fn clone(&self) -> CreateSource<'a>

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<'a> Debug for CreateSource<'a>

source§

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

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

impl<'a> Default for CreateSource<'a>

source§

fn default() -> CreateSource<'a>

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

impl<'a> Serialize for CreateSource<'a>

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<'a> Freeze for CreateSource<'a>

§

impl<'a> RefUnwindSafe for CreateSource<'a>

§

impl<'a> Send for CreateSource<'a>

§

impl<'a> Sync for CreateSource<'a>

§

impl<'a> Unpin for CreateSource<'a>

§

impl<'a> UnwindSafe for CreateSource<'a>

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

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

source§

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