# `Stripe.SetupAttempt`
[🔗](https://github.com/code-corps/stripity_stripe/blob/v3.3.3/lib/generated/setup_attempt.ex#L1)

A SetupAttempt describes one attempted confirmation of a SetupIntent,
whether that confirmation is successful or unsuccessful. You can use
SetupAttempts to inspect details of a specific attempt at setting up a
payment method using a SetupIntent.

# `created`

```elixir
@type created() :: %{
  optional(:gt) =&gt; integer(),
  optional(:gte) =&gt; integer(),
  optional(:lt) =&gt; integer(),
  optional(:lte) =&gt; integer()
}
```

# `t`

```elixir
@type t() :: %Stripe.SetupAttempt{
  application: (binary() | term()) | nil,
  attach_to_self: boolean(),
  created: integer(),
  customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil,
  flow_directions: term() | nil,
  id: binary(),
  livemode: boolean(),
  object: binary(),
  on_behalf_of: (binary() | Stripe.Account.t()) | nil,
  payment_method: binary() | Stripe.PaymentMethod.t(),
  payment_method_details: term(),
  setup_error: Stripe.ApiErrors.t() | nil,
  setup_intent: binary() | Stripe.SetupIntent.t(),
  status: binary(),
  usage: binary()
}
```

The `setup_attempt` type.

  * `application` The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation.
  * `attach_to_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.
  * `created` Time at which the object was created. Measured in seconds since the Unix epoch.
  * `customer` The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation.
  * `flow_directions` 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.
  * `id` Unique identifier for the object.
  * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
  * `object` String representing the object's type. Objects of the same type share the same value.
  * `on_behalf_of` The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation.
  * `payment_method` ID of the payment method used with this SetupAttempt.
  * `payment_method_details` 
  * `setup_error` The error encountered during this attempt to confirm the SetupIntent, if any.
  * `setup_intent` ID of the SetupIntent that this attempt belongs to.
  * `status` Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`.
  * `usage` The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`.

# `list`

```elixir
@spec list(
  params :: %{
    optional(:created) =&gt; created() | integer(),
    optional(:ending_before) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:limit) =&gt; integer(),
    optional(:setup_intent) =&gt; binary(),
    optional(:starting_after) =&gt; binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Returns a list of SetupAttempts that associate with a provided SetupIntent.</p>

#### Details

 * Method: `get`
 * Path: `/v1/setup_attempts`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
