Skip to content

Commit

Permalink
adds method for capturing a charge
Browse files Browse the repository at this point in the history
  • Loading branch information
poops committed Mar 23, 2017
1 parent 1e9b87d commit 0d5be20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/stripe/charge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule Stripe.Charge do
You can:
- Capture a charge
- Retrieve a charge
Stripe API reference: https://stripe.com/docs/api#charge
Expand Down Expand Up @@ -77,6 +78,15 @@ defmodule Stripe.Charge do
transfer: [:retrieve]
}

@doc """
Capture a charge.
"""
@spec capture(binary, Keyword.t) :: {:ok, t} | {:error, Stripe.api_error_struct}
def capture(id, opts \\ []) do
endpoint = @plural_endpoint <> "/" <> id <> "/capture"
Stripe.Request.create(endpoint, %{}, @schema, opts)
end

@doc """
Create a charge.
"""
Expand Down

0 comments on commit 0d5be20

Please sign in to comment.