Class: Ingenico::Connect::SDK::Domain::Payment::Seller

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/seller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#addressObject



15
16
17
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 15

def address
  @address
end

#channel_codeObject

String



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 18

def channel_code
  @channel_code
end

#descriptionObject

String



21
22
23
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 21

def description
  @description
end

#geocodeObject

String



24
25
26
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 24

def geocode
  @geocode
end

#idObject

String



27
28
29
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 27

def id
  @id
end

#invoice_numberObject

String



30
31
32
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 30

def invoice_number
  @invoice_number
end

#mccObject

String



33
34
35
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 33

def mcc
  @mcc
end

#nameObject

String



36
37
38
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 36

def name
  @name
end

#typeObject

String



39
40
41
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 39

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 55

def from_hash(hash)
  super
  if hash.has_key?('address')
    if !(hash['address'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['address']]
    end
    @address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['address'])
  end
  if hash.has_key?('channelCode')
    @channel_code = hash['channelCode']
  end
  if hash.has_key?('description')
    @description = hash['description']
  end
  if hash.has_key?('geocode')
    @geocode = hash['geocode']
  end
  if hash.has_key?('id')
    @id = hash['id']
  end
  if hash.has_key?('invoiceNumber')
    @invoice_number = hash['invoiceNumber']
  end
  if hash.has_key?('mcc')
    @mcc = hash['mcc']
  end
  if hash.has_key?('name')
    @name = hash['name']
  end
  if hash.has_key?('type')
    @type = hash['type']
  end
end

#to_hObject



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 41

def to_h
  hash = super
  add_to_hash(hash, 'address', @address)
  add_to_hash(hash, 'channelCode', @channel_code)
  add_to_hash(hash, 'description', @description)
  add_to_hash(hash, 'geocode', @geocode)
  add_to_hash(hash, 'id', @id)
  add_to_hash(hash, 'invoiceNumber', @invoice_number)
  add_to_hash(hash, 'mcc', @mcc)
  add_to_hash(hash, 'name', @name)
  add_to_hash(hash, 'type', @type)
  hash
end