Class: Rubykassa::XmlInterface
- Inherits:
-
Object
- Object
- Rubykassa::XmlInterface
- Defined in:
- lib/rubykassa/xml_interface.rb
Constant Summary collapse
- BASE_URL =
'https://auth.robokassa.ru/Merchant/WebService/Service.asmx/'.freeze
- INVALID_RESPONSE_ERROR_MESSAGE =
'Invalid response from the service'.freeze
Instance Attribute Summary collapse
-
#invoice_id ⇒ Object
Returns the value of attribute invoice_id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
- #get_currencies ⇒ Object
- #get_payment_methods ⇒ Object
- #get_rates ⇒ Object
-
#initialize {|_self| ... } ⇒ XmlInterface
constructor
A new instance of XmlInterface.
- #op_state(additional_params = {}) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ XmlInterface
Returns a new instance of XmlInterface.
15 16 17 |
# File 'lib/rubykassa/xml_interface.rb', line 15 def initialize(&block) yield self if block_given? end |
Instance Attribute Details
#invoice_id ⇒ Object
Returns the value of attribute invoice_id.
13 14 15 |
# File 'lib/rubykassa/xml_interface.rb', line 13 def invoice_id @invoice_id end |
#language ⇒ Object
Returns the value of attribute language.
13 14 15 |
# File 'lib/rubykassa/xml_interface.rb', line 13 def language @language end |
#total ⇒ Object
Returns the value of attribute total.
13 14 15 |
# File 'lib/rubykassa/xml_interface.rb', line 13 def total @total end |
Instance Method Details
#get_currencies ⇒ Object
19 20 21 22 23 24 |
# File 'lib/rubykassa/xml_interface.rb', line 19 def get_currencies request transform_method_name(__method__), 'MerchantLogin' => Rubykassa.login, 'Language' => @language, 'isTest' => test_mode_param end |
#get_payment_methods ⇒ Object
26 27 28 29 30 31 |
# File 'lib/rubykassa/xml_interface.rb', line 26 def get_payment_methods request transform_method_name(__method__), 'MerchantLogin' => Rubykassa.login, 'Language' => @language, 'isTest' => test_mode_param end |
#get_rates ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/rubykassa/xml_interface.rb', line 33 def get_rates request transform_method_name(__method__), 'MerchantLogin' => Rubykassa.login, 'IncCurrLabel' => '', 'OutSum' => @total.to_s, 'Language' => @language, 'isTest' => test_mode_param end |
#op_state(additional_params = {}) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/rubykassa/xml_interface.rb', line 42 def op_state(additional_params = {}) params = { 'MerchantLogin' => Rubykassa.login, 'InvoiceID' => @invoice_id.to_s, 'Signature' => generate_signature, 'isTest' => test_mode_param } params.merge! additional_params if test_mode? request transform_method_name(__method__), params end |