Class: Transbank::Webpay::Request
- Inherits:
-
Object
- Object
- Transbank::Webpay::Request
- Defined in:
- lib/transbank/webpay/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#client ⇒ Object
Returns the value of attribute client.
-
#document ⇒ Object
Returns the value of attribute document.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(wsdl_url, action, params = {}) ⇒ Request
constructor
A new instance of Request.
- #response ⇒ Object
Constructor Details
#initialize(wsdl_url, action, params = {}) ⇒ Request
Returns a new instance of Request.
6 7 8 9 10 11 |
# File 'lib/transbank/webpay/request.rb', line 6 def initialize(wsdl_url, action, params = {}) @params = params @action = action @document = Document.new(action, params) @client = Client.new wsdl_url end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
4 5 6 |
# File 'lib/transbank/webpay/request.rb', line 4 def action @action end |
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/transbank/webpay/request.rb', line 4 def client @client end |
#document ⇒ Object
Returns the value of attribute document.
4 5 6 |
# File 'lib/transbank/webpay/request.rb', line 4 def document @document end |
#params ⇒ Object
Returns the value of attribute params.
4 5 6 |
# File 'lib/transbank/webpay/request.rb', line 4 def params @params end |
Instance Method Details
#response ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/transbank/webpay/request.rb', line 13 def response rescue_exceptions = Transbank::Webpay.configuration.rescue_exceptions @response ||= begin Response.new client.post(document.to_xml), action, params rescue match_class(rescue_exceptions) => error ExceptionResponse.new error, action, params end end |