From b3ad4f0f8cb9c77716b36f4c03bc806a3006d3ec Mon Sep 17 00:00:00 2001 From: Shawn O'Neill Date: Fri, 10 Mar 2017 17:13:28 +1100 Subject: [PATCH] Update the creation of cards to match new style --- lib/stripe/card.ex | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/stripe/card.ex b/lib/stripe/card.ex index 06dff667..bfc09474 100644 --- a/lib/stripe/card.ex +++ b/lib/stripe/card.ex @@ -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