class Geti::Client
Public Class Methods
new(auth, terminal_opts={}, env='test')
click to toggle source
# File lib/geti/client.rb, line 5 def initialize(auth, terminal_opts={}, env='test') @user = auth['user'] @pass = auth['pass'] @env = env end
Public Instance Methods
certification?()
click to toggle source
# File lib/geti/client.rb, line 39 def certification? @env != 'production' end
data_packet() { |xml| ... }
click to toggle source
# File lib/geti/client.rb, line 15 def data_packet xml = Builder::XmlMarkup.new xml.instruct! yield xml content = xml.target! {"DataPacket" => content} end
domain()
click to toggle source
# File lib/geti/client.rb, line 43 def domain if certification? 'demo.eftchecks.com' else 'getigateway.eftchecks.com' end end
soap_client()
click to toggle source
# File lib/geti/client.rb, line 11 def soap_client @soap_client ||= Savon.client(service_address) end
soap_request(operation, op_key=nil) { || ... }
click to toggle source
# File lib/geti/client.rb, line 23 def soap_request(operation, op_key=nil) operation.sub!('Certification','') unless certification? response = soap_client.request operation do http.headers.delete('SOAPAction') config.soap_header = soap_header soap.body = (yield if block_given?) end op_key ||= operation.gsub(/(.)([A-Z])/, '\1_\2').downcase op_key.sub!('_certification','') unless certification? response_key = (op_key+'_response').to_sym result_key = (op_key+'_result').to_sym xml_parser.parse(response.body[response_key][result_key]) end
xml_parser()
click to toggle source
# File lib/geti/client.rb, line 51 def xml_parser @xml_parser or Nori end