### Stripe SetupIntent API: Core Operations Source: https://docs.rs/async-stripe/latest/stripe/struct.SetupIntent Provides documentation for key Stripe SetupIntent operations including listing, creating, retrieving, and updating. ```APIDOC Stripe SetupIntent API: List SetupIntents: pub fn list(client: &Client, params: &ListSetupIntents) - Returns a list of SetupIntents. - Parameters: - client: A reference to the Stripe Client. - params: Parameters for listing SetupIntents. - Returns: A Response containing a List of SetupIntents. Create SetupIntent: pub fn create(client: &Client, params: CreateSetupIntent) - Creates a SetupIntent object. - After creation, attach a payment method and confirm it to collect permissions. - Parameters: - client: A reference to the Stripe Client. - params: Parameters for creating a SetupIntent. - Returns: A Response containing the created SetupIntent. Retrieve SetupIntent: pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) - Retrieves the details of a previously created SetupIntent. - Client-side retrieval with a publishable key is allowed if client_secret is provided. - Parameters: - client: A reference to the Stripe Client. - id: The ID of the SetupIntent to retrieve. - expand: Optional array of fields to expand. - Returns: A Response containing the SetupIntent. Update SetupIntent: pub fn update(client: &Client, id: &SetupIntentId, params: UpdateSetupIntent) - Updates a SetupIntent object. - Parameters: - client: A reference to the Stripe Client. - id: The ID of the SetupIntent to update. - params: Parameters for updating the SetupIntent. - Returns: A Response containing the updated SetupIntent. ``` -------------------------------- ### Rust Stripe Coupon Retrieval Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/coupon.rs Example of retrieving a specific Stripe coupon by its ID using the Rust client. This function makes a GET request to the Stripe API. ```Rust pub fn retrieve(client: &Client, id: &CouponId, expand: &[&str]) -> Response { client.get_query(&format!("/coupons/{}", id), Expand { expand }) } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.RefundId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Stripe SetupIntent Object and Methods Source: https://docs.rs/async-stripe/latest/stripe/struct.SetupIntent Provides comprehensive details on the Stripe SetupIntent object, including its fields and the methods available for managing its lifecycle. This includes creating, retrieving, updating, confirming, canceling, and listing SetupIntents. ```APIDOC SetupIntent: Description: Represents a Stripe SetupIntent object. Used to set up and confirm payment methods for future payments. Fields: application: ID of the application associated with the SetupIntent. attach_to_self: Whether the SetupIntent should be attached to the customer. automatic_payment_methods: Configuration for automatic payment methods. cancellation_reason: Reason for cancellation. client_secret: Client secret for client-side confirmation. created: Timestamp of creation. customer: ID of the Customer object. description: An arbitrary string attached to the object. flow_directions: The direction of the flow. id: Unique identifier for the SetupIntent. last_setup_error: The last error encountered. latest_attempt: The latest attempt for the SetupIntent. livemode: Has the value true if the object exists in live mode, false otherwise. mandate: ID of the Mandate associated with the SetupIntent. metadata: Set of key-value pairs that you can attach to an object. next_action: Describes the next action that the customer needs to take. on_behalf_of: The account on behalf of which the SetupIntent is being created. payment_method: ID of the PaymentMethod associated with this SetupIntent. payment_method_configuration_details: Payment method configuration details. payment_method_options: Options for the payment method. payment_method_types: Array of payment method types. single_use_mandate: Whether the mandate is single use. status: Status of the SetupIntent. usage: Indicates how the payment method is intended to be used. Methods: create(customer: str, payment_method_types: list[str], ...): Creates a SetupIntent object. Parameters: customer: The ID of the customer to set up the payment method for. payment_method_types: An array of the desired payment method types. ...: Other optional parameters like description, metadata, etc. Returns: A new SetupIntent object. retrieve(id: str): Retrieves a SetupIntent object. Parameters: id: The ID of the SetupIntent to retrieve. Returns: The requested SetupIntent object. update(id: str, ...): Updates a SetupIntent object. Parameters: id: The ID of the SetupIntent to update. ...: Fields to update (e.g., description, metadata). Returns: The updated SetupIntent object. list(customer: str, ...): Returns a list of SetupIntent objects. Parameters: customer: Filter by customer ID. ...: Other optional parameters like limit, starting_after, etc. Returns: A list of SetupIntent objects. confirm(id: str, ...): Confirms a SetupIntent object. Parameters: id: The ID of the SetupIntent to confirm. ...: Optional parameters like payment_method, return_url, etc. Returns: The confirmed SetupIntent object. cancel(id: str, ...): Cancels a SetupIntent object. Parameters: id: The ID of the SetupIntent to cancel. cancellation_reason: The reason for cancellation. Returns: The canceled SetupIntent object. verify_micro_deposits(id: str, ...): Verifies micro-deposits for a SetupIntent. Parameters: id: The ID of the SetupIntent to verify. ...: Required parameters for micro-deposit verification. Returns: The SetupIntent object with verified micro-deposits. Trait Implementations: Clone: Allows cloning SetupIntent objects. Debug: Enables debugging output for SetupIntent objects. Default: Provides default values for SetupIntent fields. Deserialize<'de>: Enables deserialization of SetupIntent objects from various formats. Object: Represents a generic object interface. Serialize: Enables serialization of SetupIntent objects. Auto Trait Implementations: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe: Standard Rust safety and concurrency traits. Blanket Implementations: Any, Borrow, BorrowMut, CloneToUninit, DeserializeOwned, ErasedDestructor, From, Instrument, Into, Same, ToOwned, TryFrom, TryInto, VZip, WithSubscriber: Generic implementations providing broader functionality. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.RecipientId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Rust SetupIntent Confirmation Parameters Source: https://docs.rs/async-stripe/latest/src/stripe/resources/setup_intent_ext.rs Defines the structure for parameters used when confirming a Stripe SetupIntent. Includes options for payment method, mandate data, return URL, and SDK usage. ```Rust use serde::Serialize; use crate::client::{Client, Response}; use crate::params::Expand; use crate::resources::SetupIntent; use crate::{PaymentMethodId, SetupIntentCancellationReason, SetupIntentId}; /// The set of parameters that can be used when confirming a setup_intent object. /// /// For more details see #[derive(Clone, Debug, Serialize)] pub struct ConfirmSetupIntent { /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method: Option, /// This hash contains details about the mandate to create #[serde(skip_serializing_if = "Option::is_none")] pub mandate_data: Option, /// When included, this hash creates a PaymentMethod that is set as the payment_method value in the SetupIntent. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_data: Option, /// Payment method-specific configuration for this SetupIntent. #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_options: Option, /// The URL to redirect your customer back to after they authenticate on the payment method’s app or site. #[serde(skip_serializing_if = "Option::is_none")] pub return_url: Option, /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. pub use_stripe_sdk: bool, } #[derive(Clone, Debug, Default, Serialize)] pub struct MandateData { pub customer_acceptance: crate::CustomerAcceptance, } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.OrderReturnId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Stripe SetupIntent Object Fields Source: https://docs.rs/async-stripe/latest/stripe/struct.UpdateSetupIntent Documentation detailing the various fields available for configuring and managing Stripe SetupIntents. This includes parameters for attaching payment methods, customer association, metadata, and flow directions. ```APIDOC Stripe SetupIntent Fields: - attach_to_self: [Option] 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. - customer: [Option] 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. - description: [Option<&'a str>] An arbitrary string attached to the object. Often useful for displaying to users. - expand: &'a [&'a str] Specifies which fields in the response should be expanded. - flow_directions: [Option>] 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. - metadata: [Option] Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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`. - payment_method: [Option] ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - payment_method_configuration: [Option] The ID of the payment method configuration to use with this SetupIntent. - payment_method_data: [Option] When included, this hash creates a PaymentMethod that is set as the `payment_method` value in the SetupIntent. - payment_method_options: [Option] Payment method-specific configuration for this SetupIntent. - payment_method_types: [Option>] The list of payment method types (for example, card) that this SetupIntent can set up. If you don’t provide this array, it defaults to [“card”]. ``` -------------------------------- ### Rust SetupIntent API Client Methods Source: https://docs.rs/async-stripe/latest/src/stripe/resources/setup_intent_ext.rs Provides client-side methods for interacting with Stripe SetupIntents. These methods abstract the API calls for confirming, verifying microdeposits, and canceling SetupIntents. ```Rust use crate::client::{Client, Response}; use crate::resources::SetupIntent; use crate::{PaymentMethodId, SetupIntentCancellationReason, SetupIntentId}; // Assuming ConfirmSetupIntent, MandateData, CancelSetupIntent, VerifyMicrodeposits structs are defined elsewhere in the crate. impl SetupIntent { /// Confirms a SetupIntent object. pub fn confirm( client: &Client, setup_id: &SetupIntentId, params: ConfirmSetupIntent, ) -> Response { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/setup_intents/{}/confirm", setup_id), ¶ms) } /// Verifies microdeposits on a SetupIntent object. pub fn verify_micro_deposits( client: &Client, setup_id: &SetupIntentId, params: VerifyMicrodeposits, ) -> Response { #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/setup_intents/{}/verify_microdeposits", setup_id), ¶ms) } /// Cancels a SetupIntent object. /// A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. /// /// For more details see . pub fn cancel( client: &Client, setup_id: &SetupIntentId, params: CancelSetupIntent, ) -> Response { client.post_form(&format!("/setup_intents/{}/cancel", setup_id), params) } } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.IssuingDisputeId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Stripe SetupIntent API: Action Operations Source: https://docs.rs/async-stripe/latest/stripe/struct.SetupIntent Details on performing actions like confirming, verifying micro-deposits, and canceling Stripe SetupIntents. ```APIDOC Stripe SetupIntent API: Confirm SetupIntent: pub fn confirm(client: &Client, setup_id: &SetupIntentId, params: ConfirmSetupIntent) - Confirms a SetupIntent. - Parameters: - client: A reference to the Stripe Client. - setup_id: The ID of the SetupIntent to confirm. - params: Parameters for confirming the SetupIntent. - Returns: A Response containing the confirmed SetupIntent. Verify Micro-deposits: pub fn verify_micro_deposits(client: &Client, setup_id: &SetupIntentId, params: VerifyMicrodeposits) - Verifies micro-deposits for a SetupIntent. - Parameters: - client: A reference to the Stripe Client. - setup_id: The ID of the SetupIntent. - params: Parameters for verifying micro-deposits. - Returns: A Response containing the updated SetupIntent. Cancel SetupIntent: pub fn cancel(client: &Client, setup_id: &SetupIntentId, params: CancelSetupIntent) - Cancels a SetupIntent object. - A SetupIntent can be canceled if it is in 'requires_payment_method', 'requires_confirmation', or 'requires_action' status. - Parameters: - client: A reference to the Stripe Client. - setup_id: The ID of the SetupIntent to cancel. - params: Parameters for canceling the SetupIntent. - Returns: A Response containing the canceled SetupIntent. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.CheckoutSessionItemId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Stripe Rust SDK: Ideal Payment Method Details Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_attempt.rs Details the structure for iDEAL payment method information within Stripe setup attempts, including bank, BIC, IBAN, and verification details. ```rust #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupAttemptPaymentMethodDetailsIdeal { /// The customer's bank. /// /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank. pub bic: Option, /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. pub generated_sepa_debit: Option>, /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. pub generated_sepa_debit_mandate: Option>, /// Last four characters of the IBAN. pub iban_last4: Option, /// Owner's verified full name. /// /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. /// They cannot be set or mutated. pub verified_name: Option, } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.BillingPortalConfigurationId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### SetupAttempt Structure and Methods Source: https://docs.rs/async-stripe/latest/stripe/struct.SetupAttempt Documentation for the SetupAttempt struct in the async-stripe crate. Includes fields like customer, payment_method, and status, along with available methods such as list. ```APIDOC stripe::SetupAttempt Represents a Stripe SetupAttempt object. Fields: - application: The application associated with the SetupAttempt. - attach_to_self: Indicates if the payment method should be attached to the customer. - created: Timestamp of when the SetupAttempt was created. - customer: The Customer ID associated with the SetupAttempt. - flow_directions: The direction of the flow. - id: Unique identifier for the SetupAttempt. - livemode: Whether the SetupAttempt is in live mode. - on_behalf_of: The ID of the connected account. - payment_method: The PaymentMethod ID associated with the SetupAttempt. - payment_method_details: Details about the payment method. - setup_error: Information about any setup error. - setup_intent: The SetupIntent ID associated with the SetupAttempt. - status: The current status of the SetupAttempt. - usage: Indicates the intended usage of the payment method. Methods: - list: Retrieves a list of SetupAttempts. - Parameters: - client: An HTTP client instance (e.g., surf::Client). - params: Optional parameters for filtering the list (e.g., Customer, PaymentMethod, Status). - Returns: A Result containing a list of SetupAttempt objects or an error. - Example: ```rust // Assuming 'client' is an initialized surf::Client and 'customer_id' is a valid Stripe Customer ID use async_stripe::stripe::{Client, SetupAttemptListParams}; async fn get_setup_attempts(client: &Client, customer_id: &str) -> Result, async_stripe::Error> { let params = SetupAttemptListParams::new() .customer(customer_id); let setup_attempts = client.list_setup_attempts(¶ms).await?; Ok(setup_attempts.data) } ``` ``` -------------------------------- ### Rust Method to Get String Representation of Konbini Setup Usage Source: https://docs.rs/async-stripe/latest/stripe/generated/core/payment_intent/enum.UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage Provides a method to convert the `UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage` enum variants into their static string representations. This is useful for API communication where string values are required. ```Rust pub fn as_str(self) -> &'static str ``` -------------------------------- ### ListSetupIntents Parameters (Rust) Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_intent.rs Defines the parameters for listing Stripe SetupIntents. Supports filtering by customer, payment method, creation date, and pagination. ```APIDOC ListSetupIntents: __struct__ attach_to_self: Option If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. created: Option> A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. customer: Option Only return SetupIntents for the customer specified by this customer ID. ending_before: Option A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. expand: Vec<&str> Specifies which fields in the response should be expanded. limit: Option A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. payment_method: Option Only return SetupIntents that associate with the specified payment method. starting_after: Option A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.WebhookEndpointId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.UsageRecordSummaryId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### CreateSetupIntent Parameters (Rust) Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_intent.rs Defines the parameters required to create a Stripe SetupIntent. It includes fields for payment method configuration, customer association, return URLs, and metadata. ```APIDOC CreateSetupIntent: __struct__ attach_to_self: Option Optional. If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. automatic_payment_methods: Option If provided, Stripe will automatically create and attach a payment method to the SetupIntent. confirm: Option Set to true to attempt to confirm the SetupIntent immediately. customer: Option The ID of the Customer to attach the SetupIntent to. description: Option An arbitrary string that you can attach to a SetupIntent object. expand: Vec<&str> Specifies which fields in the response should be expanded. flow_directions: Vec The direction of the payment flow. mandate_data: Option Information about the Mandate for direct debit. metadata: Option A set of key-value pairs that you can attach to a SetupIntent object. on_behalf_of: Option The Stripe account to create the SetupIntent on behalf of. payment_method: Option The ID of the PaymentMethod to attach to the SetupIntent. payment_method_configuration: Option The ID of the PaymentMethodConfiguration to use. payment_method_data: Option Payment method-specific configuration. payment_method_options: Option Options for the payment method. payment_method_types: Vec A list of Stripe payment method types that the SetupIntent is allowed to use. return_url: Option The URL to redirect the customer to after the SetupIntent is confirmed. single_use: Option Configuration for single-use SetupIntents. use_stripe_sdk: Option If true, the SetupIntent will be created with the `use_stripe_sdk` parameter set to true. ``` -------------------------------- ### Stripe SetupIntent Create Payment Method Options Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_intent.rs Defines the payment method options for creating a Stripe SetupIntent. This includes configurations for Card, Link, PayPal, SEPA Debit, and US Bank Account. ```APIDOC CreateSetupIntentPaymentMethodOptions: Represents the payment method options for creating a SetupIntent. Fields: card: Options for Card payment methods. - moto: Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. - network: Selected network to process this SetupIntent on. - request_three_d_secure: Controls the 3D Secure authentication flow. Defaults to 'automatic'. - three_d_secure: Authentication details if 3D Secure was performed with a third-party provider. link: Options for Link payment methods. - persistent_token: [Deprecated] This is a legacy parameter that no longer has any function. paypal: Options for PayPal payment methods. - billing_agreement_id: The PayPal Billing Agreement ID (BAID). Represents the mandate between the merchant and the customer. sepa_debit: Options for SEPA Debit payment methods. - mandate_options: Additional fields for Mandate creation. us_bank_account: Options for US Bank Account payment methods. - financial_connections: Additional fields for Financial Connections Session creation. - mandate_options: Additional fields for Mandate creation. - networks: Additional fields for network related functions. - verification_method: Bank account verification method. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TransferReversalId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Define SetupIntentNextActionRedirectToUrl Structure Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_intent.rs Defines the structure for redirecting customers to a URL for authentication during the SetupIntent process. Includes the return URL and the authentication URL. ```rust #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SetupIntentNextActionRedirectToUrl { /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. pub return_url: Option, /// The URL you must redirect your customer to in order to authenticate. pub url: Option, } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TopupId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Stripe SetupAttempt List API Method (Rust) Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_attempt.rs Provides the Rust client method for listing Stripe SetupAttempts. This method allows fetching a paginated list of setup attempts associated with a given SetupIntent, using query parameters for filtering and sorting. ```rust impl SetupAttempt { /// Returns a list of SetupAttempts that associate with a provided SetupIntent. pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response> { client.get_query("/setup_attempts", params) } } ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TestHelpersTestClockId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### SetupIntent API Methods (Rust) Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_intent.rs Provides methods for interacting with the Stripe SetupIntent API. These methods allow listing, creating, retrieving, and updating SetupIntent objects. ```APIDOC SetupIntent: // Methods for managing SetupIntents list(client: &Client, params: &ListSetupIntents<'_>) -> Response> Description: Returns a list of SetupIntents. Parameters: client: A reference to the Stripe API client. params: Query parameters for filtering and pagination (e.g., customer, limit, starting_after). Returns: A Response containing a List of SetupIntent objects. create(client: &Client, params: CreateSetupIntent<'_>) -> Response Description: Creates a SetupIntent object. After creation, attach a payment method and confirm it to collect permissions for future charges. Parameters: client: A reference to the Stripe API client. params: Parameters for creating the SetupIntent (e.g., usage, payment_method_types, customer). Returns: A Response containing the created SetupIntent object. retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response Description: Retrieves the details of a SetupIntent by its ID. Client-side retrieval with a publishable key is allowed when providing the client_secret. Parameters: client: A reference to the Stripe API client. id: The unique identifier of the SetupIntent. expand: An array of strings specifying which nested resources should be expanded. Returns: A Response containing the requested SetupIntent object. update(client: &Client, id: &SetupIntentId, params: UpdateSetupIntent<'_>) -> Response Description: Updates a SetupIntent object. This can include modifying parameters like description or metadata. Parameters: client: A reference to the Stripe API client. id: The unique identifier of the SetupIntent to update. params: Parameters for updating the SetupIntent. Returns: A Response containing the updated SetupIntent object. Object Implementation: impl Object for SetupIntent type Id = SetupIntentId fn id(&self) -> Self::Id Returns the ID of the SetupIntent. fn object(&self) -> &'static str Returns the object type string, which is "setup_intent". ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TerminalReaderId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### SetupAttempt Clone Implementation Source: https://docs.rs/async-stripe/latest/stripe/generated/core/setup_attempt/struct.SetupAttempt Provides methods for creating copies of SetupAttempt objects. Includes `clone` for duplication and `clone_from` for copy-assignment. ```APIDOC fn clone(&self) -> [SetupAttempt] Returns a duplicate of the value. fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TerminalLocationId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Empty Payment Method Detail Structs Source: https://docs.rs/async-stripe/latest/src/stripe/resources/generated/setup_attempt.rs Provides definitions for various payment method detail structs that are currently empty. These serve as placeholders for future or less common payment method types. ```rust pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} pub struct SetupAttemptPaymentMethodDetailsBacsDebit {} pub struct SetupAttemptPaymentMethodDetailsBoleto {} ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TerminalConfigurationId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TaxRateId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### SetupIntentNextActionRedirectToUrl Methods Source: https://docs.rs/async-stripe/latest/stripe/struct.SetupIntentNextActionRedirectToUrl API documentation for methods associated with the SetupIntentNextActionRedirectToUrl struct, including cloning and formatting capabilities. ```APIDOC impl Clone for SetupIntentNextActionRedirectToUrl clone(&self) -> SetupIntentNextActionRedirectToUrl Returns a duplicate of the value. clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. impl Debug for SetupIntentNextActionRedirectToUrl fmt(&self, f: &mut Formatter) -> Result Formats the value using the given formatter. ``` -------------------------------- ### Stripe SetupIntent Creation API Source: https://docs.rs/async-stripe/latest/stripe/struct.CreateSetupIntent Parameters for creating a Stripe SetupIntent. This includes specifying the customer, payment method types, confirmation details, and other optional configurations. ```APIDOC SetupIntent::create(params) Parameters for creating a SetupIntent: - `attach_to_self`: (Optional) If `true`, the SetupIntent will attach the returned PaymentMethod to the Customer. - `automatic_payment_methods`: (Optional) Configuration for automatic payment methods. - `confirm`: (Optional) If `true`, the SetupIntent will attempt to confirm the PaymentMethod immediately. - `customer`: (Optional) The ID of the Customer to attach the SetupIntent to. - `description`: (Optional) An arbitrary string that you can attach to a SetupIntent object. - `expand`: (Required) Specifies which fields in the response should be expanded. - `flow_directions`: (Optional) The flow directions for the SetupIntent. - `mandate_data`: (Optional) Additional details about the mandate. - `metadata`: (Optional) Set of key-value pairs that you can attach to an object. - `on_behalf_of`: (Optional) The ID of the connected account that the SetupIntent was created on behalf of. - `payment_method`: (Optional) The ID of the PaymentMethod to attach to the SetupIntent. - `payment_method_configuration`: (Optional) The ID of the PaymentMethodConfiguration to use. - `payment_method_data`: (Optional) Data for the PaymentMethod. - `payment_method_options`: (Optional) Options for the PaymentMethod. - `payment_method_types`: (Optional) An array of strings representing the payment method types to attempt. - `return_url`: (Optional) The URL to redirect the user to after the SetupIntent is complete. - `single_use`: (Optional) Configuration for single-use payment methods. - `use_stripe_sdk`: (Optional) If `true`, the SetupIntent will be created with `use_stripe_sdk` set to `true`. Returns: A SetupIntent object if successful. ``` -------------------------------- ### Rust: Find Substring Indices (Forward) Source: https://docs.rs/async-stripe/latest/stripe/struct.TaxIdId Demonstrates using `str::match_indices` to find all occurrences of a pattern in a string, returning their start indices and the matched substring. It explains iterator behavior and provides examples. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ```