Class: Maxipago::XmlBuilder::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/maxipago/xml_builder/builder.rb

Direct Known Subclasses

BuilderApi, BuilderRapi, BuilderTransaction

Constant Summary collapse

MAXIPAGO_COMMANDS =
%w(add_consumer delete_consumer update_consumer add_card_onfile delete_card_onfile sale void reversal recurring cancel_recurring bank_bill online_debit save_on_file one_transaction_report list_transactions_report transaction_paginate authorization authentication capture)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(maxipagoId, apiKey, apiVersion, opts) ⇒ Builder

Returns a new instance of Builder.



10
11
12
13
14
15
16
# File 'lib/maxipago/xml_builder/builder.rb', line 10

def initialize(maxipagoId, apiKey, apiVersion, opts)
  @maxipagoId = maxipagoId
  @apiKey = apiKey
  @apiVersion = apiVersion
  @command = opts[:command].downcase
  @options = opts
end

Instance Attribute Details

#apiKeyObject (readonly)

Returns the value of attribute apiKey.



6
7
8
# File 'lib/maxipago/xml_builder/builder.rb', line 6

def apiKey
  @apiKey
end

#apiVersionObject (readonly)

Returns the value of attribute apiVersion.



6
7
8
# File 'lib/maxipago/xml_builder/builder.rb', line 6

def apiVersion
  @apiVersion
end

#commandObject (readonly)

Returns the value of attribute command.



6
7
8
# File 'lib/maxipago/xml_builder/builder.rb', line 6

def command
  @command
end

#maxipagoIdObject (readonly)

Returns the value of attribute maxipagoId.



6
7
8
# File 'lib/maxipago/xml_builder/builder.rb', line 6

def maxipagoId
  @maxipagoId
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/maxipago/xml_builder/builder.rb', line 6

def options
  @options
end

Instance Method Details

#get_xml_dataObject



18
19
20
21
22
23
24
# File 'lib/maxipago/xml_builder/builder.rb', line 18

def get_xml_data
  if command_defined?
    build_xml_data
  else
    raise "Command not defined!"
  end
end