Class: Rubykassa::XmlInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/rubykassa/xml_interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ XmlInterface

Returns a new instance of XmlInterface.



12
13
14
# File 'lib/rubykassa/xml_interface.rb', line 12

def initialize &block
  instance_eval &block if block_given?
end

Instance Attribute Details

#invoice_idObject

Returns the value of attribute invoice_id.



10
11
12
# File 'lib/rubykassa/xml_interface.rb', line 10

def invoice_id
  @invoice_id
end

#languageObject

Returns the value of attribute language.



10
11
12
# File 'lib/rubykassa/xml_interface.rb', line 10

def language
  @language
end

#totalObject

Returns the value of attribute total.



10
11
12
# File 'lib/rubykassa/xml_interface.rb', line 10

def total
  @total
end

Instance Method Details

#base_urlObject



32
33
34
# File 'lib/rubykassa/xml_interface.rb', line 32

def base_url
  "https://merchant.roboxchange.com/WebService/Service.asmx/"
end

#get_currenciesObject



16
17
18
# File 'lib/rubykassa/xml_interface.rb', line 16

def get_currencies
  request(base_url + transform_method_name(__method__), Hash["MerchantLogin", Rubykassa., "Language", @language])
end

#get_payment_methodsObject



20
21
22
# File 'lib/rubykassa/xml_interface.rb', line 20

def get_payment_methods
  request(base_url + transform_method_name(__method__), Hash["MerchantLogin", Rubykassa., "Language", @language])
end

#get_ratesObject



24
25
26
# File 'lib/rubykassa/xml_interface.rb', line 24

def get_rates
  request(base_url + transform_method_name(__method__), Hash["MerchantLogin", Rubykassa., "IncCurrLabel", "", "OutSum", @total.to_s, "Language", @language])
end

#op_stateObject



28
29
30
# File 'lib/rubykassa/xml_interface.rb', line 28

def op_state
  request(base_url + transform_method_name(__method__), Hash["MerchantLogin", Rubykassa., "InvoiceID", @invoice_id.to_s, "Signature", generate_signature])
end