Class: Iyzi::PkiBuilders::SubMerchant

Inherits:
Iyzi::PkiBuilder show all
Defined in:
lib/iyzi/pki_builders/sub_merchant.rb

Constant Summary collapse

CREATE_ATTRIBUTES_ORDER =
%w{
  locale
  conversationId
  name
  email
  gsmNumber
  address
  iban
  taxOffice
  contactName
  contactSurname
  legalCompanyTitle
  subMerchantExternalId
  identityNumber
  taxNumber
  subMerchantType
}.freeze
UPDATE_ATTRIBUTE_ORDER =
%w{
  locale
  conversationId
  name
  email
  gsmNumber
  address
  iban
  taxOffice
  contactName
  contactSurname
  legalCompanyTitle
  subMerchantKey
  identityNumber
  taxNumber
}
RETREIVE_ATTRIBUTE_ORDER =
%w{
  locale
  conversationId
  subMerchantExternalId
}

Constants inherited from Iyzi::PkiBuilder

Iyzi::PkiBuilder::DEFAULT_ADD_METHOD

Instance Attribute Summary

Attributes inherited from Iyzi::PkiBuilder

#ordered_keys, #params

Instance Method Summary collapse

Methods inherited from Iyzi::PkiBuilder

#add, #add_address, #add_array, #add_basket_items, #add_buyer, #add_date, #add_payment_card, #add_price, #add_store_card, #convert_str, #ordered_params, #parse_date, #prepare_request_string, #request_string

Constructor Details

#initialize(type, values = {}) ⇒ SubMerchant



45
46
47
# File 'lib/iyzi/pki_builders/sub_merchant.rb', line 45

def initialize(type, values = {})
  super(values, order_for(type))
end

Instance Method Details

#order_for(type) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/iyzi/pki_builders/sub_merchant.rb', line 49

def order_for(type)
  case type
  when :create
    CREATE_ATTRIBUTES_ORDER
  when :update
    UPDATE_ATTRIBUTE_ORDER
  when :retreive
    RETREIVE_ATTRIBUTE_ORDER
  else
    raise "no attribute order for #{type}"
  end
end