diff --git a/stripe.go b/stripe.go index 59af0d7a0c..896360ec17 100644 --- a/stripe.go +++ b/stripe.go @@ -505,13 +505,10 @@ func (s *BackendImplementation) Do(req *http.Request, body *bytes.Buffer, v Last s.LeveledLogger.Debugf("Response: %s", string(resBody)) + err = s.UnmarshalJSONVerbose(res.StatusCode, resBody, v) v.SetLastResponse(newAPIResponse(res, resBody)) - if v != nil { - return s.UnmarshalJSONVerbose(res.StatusCode, resBody, v) - } - - return nil + return err } // ResponseToError converts a stripe response to an Error.