Class: Privat24Api::Request
- Inherits:
-
Object
- Object
- Privat24Api::Request
- Defined in:
- lib/privat24_api/request/request.rb
Instance Attribute Summary collapse
-
#card_num ⇒ Object
readonly
Returns the value of attribute card_num.
-
#data_value ⇒ Object
readonly
Returns the value of attribute data_value.
-
#merchant_id ⇒ Object
readonly
Returns the value of attribute merchant_id.
-
#merchant_password ⇒ Object
readonly
Returns the value of attribute merchant_password.
Instance Method Summary collapse
-
#initialize(**card_args) ⇒ Request
constructor
A new instance of Request.
- #send_data_for(mod, met) ⇒ Object
Constructor Details
#initialize(**card_args) ⇒ Request
Returns a new instance of Request.
9 10 11 12 13 |
# File 'lib/privat24_api/request/request.rb', line 9 def initialize(**card_args) @card_num = card_args[:card_num] @merchant_id = card_args[:merchant_id] @merchant_password = card_args[:merchant_password] end |
Instance Attribute Details
#card_num ⇒ Object (readonly)
Returns the value of attribute card_num.
7 8 9 |
# File 'lib/privat24_api/request/request.rb', line 7 def card_num @card_num end |
#data_value ⇒ Object (readonly)
Returns the value of attribute data_value.
7 8 9 |
# File 'lib/privat24_api/request/request.rb', line 7 def data_value @data_value end |
#merchant_id ⇒ Object (readonly)
Returns the value of attribute merchant_id.
7 8 9 |
# File 'lib/privat24_api/request/request.rb', line 7 def merchant_id @merchant_id end |
#merchant_password ⇒ Object (readonly)
Returns the value of attribute merchant_password.
7 8 9 |
# File 'lib/privat24_api/request/request.rb', line 7 def merchant_password @merchant_password end |
Instance Method Details
#send_data_for(mod, met) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/privat24_api/request/request.rb', line 15 def send_data_for(mod, met) builder = Nokogiri::XML::DocumentFragment.parse "" Nokogiri::XML::Builder.with(builder) do |xml| yield xml end @data_value = builder.to_xml Response.new( send(mod, met) ) end |