forked from go-packages/paypal
Vault delete shouldn’t expect a response
Vault DELETE returns empty content. Trying to retreive a response was causing an EOF error.
This commit is contained in:
parent
541052cf48
commit
9e6f08db11
11
vault.go
11
vault.go
|
@ -23,19 +23,18 @@ func (c *Client) StoreCreditCard(cc CreditCard) (*CreditCard, error) {
|
||||||
|
|
||||||
// DeleteCreditCard func
|
// DeleteCreditCard func
|
||||||
// Endpoint: DELETE /v1/vault/credit-cards/credit_card_id
|
// 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)
|
req, err := c.NewRequest("DELETE", fmt.Sprintf("%s/v1/vault/credit-cards/%s", c.APIBase, id), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
response := CreditCard{}
|
err = c.SendWithAuth(req, nil)
|
||||||
err = c.SendWithAuth(req, &response)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &response, nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCreditCard func
|
// GetCreditCard func
|
||||||
|
|
Loading…
Reference in New Issue
Block a user