Skip to content

Commit

Permalink
Merge pull request #221 from shawnonthenet/2.0
Browse files Browse the repository at this point in the history
Update Card.create to use Stripe.Request.create
  • Loading branch information
shawnonthenet authored Mar 10, 2017
2 parents 36f99c9 + b3ad4f0 commit 1e9b87d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/stripe/card.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,8 @@ defmodule Stripe.Card do
@spec create(source, String.t, String.t, Keyword.t) :: {:ok, t} | {:error, Stripe.api_error_struct}
def create(owner_type, owner_id, token, opts \\ []) do
endpoint = endpoint_for_owner(owner_type, owner_id)

to_create_body(owner_type, token)
|> Util.map_keys_to_atoms()
|> Stripe.request(:post, endpoint, %{}, opts)
|> Stripe.Request.handle_result(__MODULE__)
changes = to_create_body(owner_type, token)
Stripe.Request.create(endpoint, changes, @schema, opts)
end

@spec to_create_body(source, String.t) :: map
Expand Down

0 comments on commit 1e9b87d

Please sign in to comment.