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

#addressIngenico::Connect::SDK::Domain::Definitions::Address



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

def address
  @address
end

#channel_codeString



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

def channel_code
  @channel_code
end

#descriptionString



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

def description
  @description
end

#geocodeString



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

def geocode
  @geocode
end

#idString



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

def id
  @id
end

#invoice_numberString



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

def invoice_number
  @invoice_number
end

#mccString



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

def mcc
  @mcc
end

#nameString



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

def name
  @name
end

#typeString



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

def type
  @type
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
# File 'lib/ingenico/connect/sdk/domain/payment/seller.rb', line 56

def from_hash(hash)
  super
  if hash.has_key? 'address'
    raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash
    @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_hHash



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

def to_h
  hash = super
  hash['address'] = @address.to_h unless @address.nil?
  hash['channelCode'] = @channel_code unless @channel_code.nil?
  hash['description'] = @description unless @description.nil?
  hash['geocode'] = @geocode unless @geocode.nil?
  hash['id'] = @id unless @id.nil?
  hash['invoiceNumber'] = @invoice_number unless @invoice_number.nil?
  hash['mcc'] = @mcc unless @mcc.nil?
  hash['name'] = @name unless @name.nil?
  hash['type'] = @type unless @type.nil?
  hash
end