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

# `t`

```elixir
@type t() :: %Stripe.PaymentSource{}
```

The `payment_source` type.

# `create`

```elixir
@spec create(
  customer :: binary(),
  params :: %{
    optional(:expand) =&gt; [binary()],
    optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()},
    optional(:source) =&gt; binary(),
    optional(:validate) =&gt; boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>When you create a new credit card, you must specify a customer or recipient on which to create it.</p>

<p>If the card’s owner has no default card, then the new card will become the default.
However, if the owner already has a default, then it will not change.
To change the default, you should <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source</code>.</p>

#### Details

 * Method: `post`
 * Path: `/v1/customers/{customer}/sources`

# `list`

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

<p>List sources for a specified customer.</p>

#### Details

 * Method: `get`
 * Path: `/v1/customers/{customer}/sources`

# `retrieve`

```elixir
@spec retrieve(
  customer :: binary(),
  id :: binary(),
  params :: %{optional(:expand) =&gt; [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Retrieve a specified source for a given customer.</p>

#### Details

 * Method: `get`
 * Path: `/v1/customers/{customer}/sources/{id}`

---

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