Skip to main content

CreateSource

Struct CreateSource 

Source
pub struct CreateSource { /* private fields */ }
Expand description

Creates a new source object.

Implementations§

Source§

impl CreateSource

Source

pub fn new() -> Self

Construct a new CreateSource.

Source

pub fn amount(self, amount: impl Into<i64>) -> Self

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.

Source

pub fn currency(self, currency: impl Into<Currency>) -> Self

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

Source

pub fn customer(self, customer: impl Into<String>) -> Self

The Customer to whom the original source is attached to. Must be set when the original source is not a Source (e.g., Card).

Source

pub fn expand(self, expand: impl Into<Vec<String>>) -> Self

Specifies which fields in the response should be expanded.

Source

pub fn flow(self, flow: impl Into<CreateSourceFlow>) -> Self

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.

Source

pub fn mandate(self, mandate: impl Into<CreateSourceMandate>) -> Self

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

Source

pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self

Source

pub fn original_source(self, original_source: impl Into<String>) -> Self

The source to share.

Source

pub fn owner(self, owner: impl Into<Owner>) -> Self

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

Source

pub fn receiver(self, receiver: impl Into<CreateSourceReceiver>) -> Self

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

Source

pub fn redirect(self, redirect: impl Into<CreateSourceRedirect>) -> Self

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

Source

pub fn source_order( self, source_order: impl Into<CreateSourceSourceOrder>, ) -> Self

Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.

Source

pub fn statement_descriptor( self, statement_descriptor: impl Into<String>, ) -> Self

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.

Source

pub fn token(self, token: impl Into<String>) -> Self

An optional token used to create the source. When passed, token properties will override source parameters.

Source

pub fn type_(self, type_: impl Into<String>) -> Self

The type of the source to create. Required unless customer and original_source are specified (see the Cloning card Sources guide).

Source

pub fn usage(self, usage: impl Into<CreateSourceUsage>) -> Self

Source§

impl CreateSource

Source

pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>

Send the request and return the deserialized response.

Source

pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>

Send the request and return the deserialized response, blocking until completion.

Trait Implementations§

Source§

impl Clone for CreateSource

Source§

fn clone(&self) -> CreateSource

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 CreateSource

Source§

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

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

impl Default for CreateSource

Source§

fn default() -> Self

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

impl Serialize for CreateSource

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

impl StripeRequest for CreateSource

Source§

type Output = Source

The data returned from the eventual API call.
Source§

fn build(&self) -> RequestBuilder

Convert the struct into library-agnostic data that can be used by compatible clients to make API calls.
Source§

fn customize(&self) -> CustomizableStripeRequest<Self::Output>

Convert to a builder allowing per-request customization.

Auto Trait Implementations§

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