pub struct CreateSource { /* private fields */ }Expand description
Creates a new source object.
Implementations§
Source§impl CreateSource
impl CreateSource
Sourcepub fn amount(self, amount: impl Into<i64>) -> Self
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.
Sourcepub fn currency(self, currency: impl Into<Currency>) -> Self
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.
Sourcepub fn customer(self, customer: impl Into<String>) -> Self
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).
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn flow(self, flow: impl Into<CreateSourceFlow>) -> Self
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.
Sourcepub fn mandate(self, mandate: impl Into<CreateSourceMandate>) -> Self
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.
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
Sourcepub fn original_source(self, original_source: impl Into<String>) -> Self
pub fn original_source(self, original_source: impl Into<String>) -> Self
The source to share.
Sourcepub fn owner(self, owner: impl Into<Owner>) -> Self
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.
Sourcepub fn receiver(self, receiver: impl Into<CreateSourceReceiver>) -> Self
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).
Sourcepub fn redirect(self, redirect: impl Into<CreateSourceRedirect>) -> Self
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).
Sourcepub fn source_order(
self,
source_order: impl Into<CreateSourceSourceOrder>,
) -> Self
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.
Sourcepub fn statement_descriptor(
self,
statement_descriptor: impl Into<String>,
) -> Self
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.
Sourcepub fn token(self, token: impl Into<String>) -> Self
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.
Sourcepub fn type_(self, type_: impl Into<String>) -> Self
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).
pub fn usage(self, usage: impl Into<CreateSourceUsage>) -> Self
Source§impl CreateSource
impl CreateSource
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
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
impl Clone for CreateSource
Source§fn clone(&self) -> CreateSource
fn clone(&self) -> CreateSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more