Class: TresDelta::Client
- Inherits:
-
Object
- Object
- TresDelta::Client
- Defined in:
- lib/tres_delta/client.rb
Class Attribute Summary collapse
-
.wsdl ⇒ Object
Returns the value of attribute wsdl.
Class Method Summary collapse
- .client ⇒ Object
- .client_credentials ⇒ Object
- .config ⇒ Object
- .default_savon_options ⇒ Object
- .location_identifier ⇒ Object
- .request(action, soap_body) ⇒ Object
- .savon_options ⇒ Object
- .savon_overrides ⇒ Object
Class Attribute Details
.wsdl ⇒ Object
Returns the value of attribute wsdl.
6 7 8 |
# File 'lib/tres_delta/client.rb', line 6 def wsdl @wsdl end |
Class Method Details
.client ⇒ Object
27 28 29 30 |
# File 'lib/tres_delta/client.rb', line 27 def client # TODO: Make this configurable via file. Because right now this ain't secure. -_- @client ||= ::Savon.client() end |
.client_credentials ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/tres_delta/client.rb', line 12 def client_credentials { "ClientCode" => config["client_code"], "Password" => config["password"], "UserName" => config["user_name"] } end |
.default_savon_options ⇒ Object
36 37 38 |
# File 'lib/tres_delta/client.rb', line 36 def { wsdl: wsdl, ssl_verify_mode: :none, log: false, open_timeout: 120, read_timeout: 120 } end |
.location_identifier ⇒ Object
20 21 22 23 24 25 |
# File 'lib/tres_delta/client.rb', line 20 def location_identifier { 'LocationCode' => config["location_code"], 'MerchantCode' => config["merchant_code"] } end |
.request(action, soap_body) ⇒ Object
8 9 10 |
# File 'lib/tres_delta/client.rb', line 8 def request(action, soap_body) Response.create_from_action(action, client.call(action, message: soap_body)) end |
.savon_options ⇒ Object
32 33 34 |
# File 'lib/tres_delta/client.rb', line 32 def .merge(savon_overrides || {}) end |
.savon_overrides ⇒ Object
40 |
# File 'lib/tres_delta/client.rb', line 40 def savon_overrides; end |