Class: Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResource

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#brandString

Returns the current value of brand.

Returns:

  • (String)

    the current value of brand



14
15
16
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb', line 14

def brand
  @brand
end

#point_of_sale_dataWorldline::Acquiring::SDK::V1::Domain::PointOfSaleData

Returns the current value of point_of_sale_data.

Returns:



14
15
16
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb', line 14

def point_of_sale_data
  @point_of_sale_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb', line 28

def from_hash(hash)
  super
  if hash.has_key? 'brand'
    @brand = hash['brand']
  end
  if hash.has_key? 'pointOfSaleData'
    raise TypeError, "value '%s' is not a Hash" % [hash['pointOfSaleData']] unless hash['pointOfSaleData'].is_a? Hash
    @point_of_sale_data = Worldline::Acquiring::SDK::V1::Domain::PointOfSaleData.new_from_hash(hash['pointOfSaleData'])
  end
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb', line 21

def to_h
  hash = super
  hash['brand'] = @brand unless @brand.nil?
  hash['pointOfSaleData'] = @point_of_sale_data.to_h unless @point_of_sale_data.nil?
  hash
end