Module: Stripe::StripeResponseBase

Included in:
StripeHeadersOnlyResponse, StripeResponse
Defined in:
lib/stripe/stripe_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#http_headersObject

A Hash of the HTTP headers of the response.



51
52
53
# File 'lib/stripe/stripe_response.rb', line 51

def http_headers
  @http_headers
end

#http_statusObject

The integer HTTP status code of the response.



54
55
56
# File 'lib/stripe/stripe_response.rb', line 54

def http_status
  @http_status
end

#request_idObject

The Stripe request ID of the response.



57
58
59
# File 'lib/stripe/stripe_response.rb', line 57

def request_id
  @request_id
end

Class Method Details

.populate_for_net_http(resp, http_resp) ⇒ Object



59
60
61
62
63
# File 'lib/stripe/stripe_response.rb', line 59

def self.populate_for_net_http(resp, http_resp)
  resp.http_headers = StripeResponseHeaders.from_net_http(http_resp)
  resp.http_status = http_resp.code.to_i
  resp.request_id = http_resp["request-id"]
end