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.



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

def http_headers
  @http_headers
end

#http_statusObject

The integer HTTP status code of the response.



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

def http_status
  @http_status
end

#request_idObject

The Stripe request ID of the response.



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

def request_id
  @request_id
end

Class Method Details

.populate_for_net_http(resp, http_resp) ⇒ Object



61
62
63
64
65
# File 'lib/stripe/stripe_response.rb', line 61

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