Struct CreateSetupIntent

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

Creates a SetupIntent object.

After you create the SetupIntent, attach a payment method and confirm. it to collect any required permissions to charge the payment method later.

Implementations§

Source§

impl CreateSetupIntent

Source

pub fn new() -> Self

Construct a new CreateSetupIntent.

Source

pub fn attach_to_self(self, attach_to_self: impl Into<bool>) -> Self

If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

Source

pub fn automatic_payment_methods( self, automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>, ) -> Self

When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.

Source

pub fn confirm(self, confirm: impl Into<bool>) -> Self

Set to true to attempt to confirm this SetupIntent immediately. This parameter defaults to false. If a card is the attached payment method, you can provide a return_url in case further authentication is necessary.

Source

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

ID of the ConfirmationToken used to confirm this SetupIntent.

If the provided ConfirmationToken contains properties that are also being provided in this request, such as payment_method, then the values in this request will take precedence.

Source

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

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

Source

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

An arbitrary string attached to the object. Often useful for displaying to users.

Source

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

Specifies which fields in the response should be expanded.

Source

pub fn flow_directions( self, flow_directions: impl Into<Vec<SetupIntentFlowDirections>>, ) -> Self

Indicates the directions of money movement for which this payment method is intended to be used.

Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

Source

pub fn mandate_data( self, mandate_data: impl Into<CreateSetupIntentMandateData>, ) -> Self

This hash contains details about the mandate to create. This parameter can only be used with confirm=true.

Source

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

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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Source

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

The Stripe account ID created for this SetupIntent.

Source

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

ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.

Source

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

The ID of the payment method configuration to use with this SetupIntent.

Source

pub fn payment_method_data( self, payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>, ) -> Self

When included, this hash creates a PaymentMethod that is set as the payment_method. value in the SetupIntent.

Source

pub fn payment_method_options( self, payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>, ) -> Self

Payment method-specific configuration for this SetupIntent.

Source

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

The list of payment method types (for example, card) that this SetupIntent can use. If you don’t provide this, Stripe will dynamically show relevant payment methods from your payment method settings.

Source

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

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with confirm=true.

Source

pub fn single_use( self, single_use: impl Into<CreateSetupIntentSingleUse>, ) -> Self

If you populate this hash, this SetupIntent generates a single_use mandate after successful completion.

Single-use mandates are only valid for the following payment methods: acss_debit, alipay, au_becs_debit, bacs_debit, bancontact, boleto, ideal, link, sepa_debit, and us_bank_account.

Source

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

Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to off_session.

Source

pub fn use_stripe_sdk(self, use_stripe_sdk: impl Into<bool>) -> Self

Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.

Source§

impl CreateSetupIntent

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 CreateSetupIntent

Source§

fn clone(&self) -> CreateSetupIntent

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 CreateSetupIntent

Source§

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

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

impl Default for CreateSetupIntent

Source§

fn default() -> Self

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

impl Serialize for CreateSetupIntent

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 CreateSetupIntent

Source§

type Output = SetupIntent

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