Class: ProcessOut::GatewayRequest
- Inherits:
-
Object
- Object
- ProcessOut::GatewayRequest
- Defined in:
- lib/processout/gateway_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#gateway_configuration_id ⇒ Object
Returns the value of attribute gateway_configuration_id.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(gateway_configuration_id, data = {}) ⇒ GatewayRequest
constructor
A new instance of GatewayRequest.
- #to_s ⇒ Object
Constructor Details
#initialize(gateway_configuration_id, data = {}) ⇒ GatewayRequest
Returns a new instance of GatewayRequest.
8 9 10 11 12 13 14 |
# File 'lib/processout/gateway_request.rb', line 8 def initialize(gateway_configuration_id, data = {}) self.gateway_configuration_id = gateway_configuration_id self.method = data.fetch(:method, nil) self.url = data.fetch(:url, nil) self.headers = data.fetch(:headers, {}) self.body = data.fetch(:body, nil) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/processout/gateway_request.rb', line 6 def body @body end |
#gateway_configuration_id ⇒ Object
Returns the value of attribute gateway_configuration_id.
6 7 8 |
# File 'lib/processout/gateway_request.rb', line 6 def gateway_configuration_id @gateway_configuration_id end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/processout/gateway_request.rb', line 6 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
6 7 8 |
# File 'lib/processout/gateway_request.rb', line 6 def method @method end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/processout/gateway_request.rb', line 6 def url @url end |
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/processout/gateway_request.rb', line 16 def to_s "gway_req_" + Base64.strict_encode64(JSON.generate({ gateway_configuration_id: self.gateway_configuration_id, method: self.method, url: self.url, headers: self.headers, body: self.body })) end |