Skip to content

Commit

Permalink
fixed bug with idempotency key not being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Niosco committed Jan 17, 2019
1 parent 587aa45 commit 7a3e060
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7a3e060

Please sign in to comment.