From 7a3e060162ab96fb771deef2af0b1d8beb9e6821 Mon Sep 17 00:00:00 2001 From: Nathaniel Niosco Date: Thu, 17 Jan 2019 11:31:36 -0800 Subject: [PATCH] fixed bug with idempotency key not being sent --- client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index ebdf5a5..768a7f0 100644 --- a/client.go +++ b/client.go @@ -212,7 +212,7 @@ func (c *Client) GetSubscription(subscriptionID string) (map[string]interface{}, // CreateSubscription creates a subscription and returns the subscription data func (c *Client) CreateSubscription(data string, idempotencyKey ...string) (map[string]interface{}, error) { - buildURL := path["subscriptions"] + url := path["subscriptions"] return c.do("POST", url, data, idempotencyKey) } @@ -267,7 +267,9 @@ func (c *Client) GetUser(UserID string, fullDehydrate bool) (*User, error) { func (c *Client) CreateUser(data string, idempotencyKey ...string) (*User, error) { var user User - res, err := c.do("POST", path["users"], data, nil) + url := buildURL(path["users"]) + + res, err := c.do("POST", url, data, idempotencyKey) mapstructure.Decode(res, &user)