Class: Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.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



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb', line 16

def brand
  @brand
end

#ecommerce_dataWorldline::Acquiring::SDK::V1::Domain::ECommerceDataForResponse

Returns the current value of ecommerce_data.

Returns:



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb', line 16

def ecommerce_data
  @ecommerce_data
end

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

Returns the current value of point_of_sale_data.

Returns:



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb', line 16

def point_of_sale_data
  @point_of_sale_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'brand'
    @brand = hash['brand']
  end
  if hash.has_key? 'ecommerceData'
    raise TypeError, "value '%s' is not a Hash" % [hash['ecommerceData']] unless hash['ecommerceData'].is_a? Hash
    @ecommerce_data = Worldline::Acquiring::SDK::V1::Domain::ECommerceDataForResponse.new_from_hash(hash['ecommerceData'])
  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)


25
26
27
28
29
30
31
# File 'lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb', line 25

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