Class: Transbank::Webpay::Client
- Inherits:
-
Object
- Object
- Transbank::Webpay::Client
- Defined in:
- lib/transbank/webpay/client.rb
Constant Summary collapse
- HEADER =
{ 'Content-Type' => 'application/soap+xml; charset=utf-8' }.freeze
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(wsdl_url) ⇒ Client
constructor
A new instance of Client.
- #post(xml) ⇒ Object
Constructor Details
#initialize(wsdl_url) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/transbank/webpay/client.rb', line 8 def initialize(wsdl_url) opt = Transbank::Webpay.configuration. self.uri = URI.parse wsdl_url self.http = Net::HTTP.new uri.host, uri.port # load options (opt) # default options http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end |
Instance Attribute Details
#http ⇒ Object
Returns the value of attribute http.
4 5 6 |
# File 'lib/transbank/webpay/client.rb', line 4 def http @http end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'lib/transbank/webpay/client.rb', line 4 def uri @uri end |
Instance Method Details
#post(xml) ⇒ Object
21 22 23 |
# File 'lib/transbank/webpay/client.rb', line 21 def post(xml) http.post(uri.path, xml, HEADER) end |