From 9e6f08db116a109a0da38018c029acf66b76ebb0 Mon Sep 17 00:00:00 2001 From: ssherriff Date: Tue, 21 Mar 2017 21:29:57 +1100 Subject: [PATCH] =?UTF-8?q?Vault=20delete=20shouldn=E2=80=99t=20expect=20a?= =?UTF-8?q?=20response?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vault DELETE returns empty content. Trying to retreive a response was causing an EOF error. --- vault.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vault.go b/vault.go index c7a924e..1ddc6b7 100644 --- a/vault.go +++ b/vault.go @@ -23,19 +23,18 @@ func (c *Client) StoreCreditCard(cc CreditCard) (*CreditCard, error) { // DeleteCreditCard func // Endpoint: DELETE /v1/vault/credit-cards/credit_card_id -func (c *Client) DeleteCreditCard(id string) (*CreditCard, error) { +func (c *Client) DeleteCreditCard(id string) error { req, err := c.NewRequest("DELETE", fmt.Sprintf("%s/v1/vault/credit-cards/%s", c.APIBase, id), nil) if err != nil { - return nil, err + return err } - response := CreditCard{} - err = c.SendWithAuth(req, &response) + err = c.SendWithAuth(req, nil) if err != nil { - return nil, err + return err } - return &response, nil + return nil } // GetCreditCard func