Class: Worldline::Acquiring::SDK::V1::Domain::MerchantData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#address ⇒ String

Returns the current value of address.

Returns:

  • (String) —

    the current value of address



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def address
  @address
end

#city ⇒ String

Returns the current value of city.

Returns:

  • (String) —

    the current value of city



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def city
  @city
end

#country_code ⇒ String

Returns the current value of country_code.

Returns:

  • (String) —

    the current value of country_code



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def country_code
  @country_code
end

#customer_service_data ⇒ Worldline::Acquiring::SDK::V1::Domain::CustomerServiceData

Returns the current value of customer_service_data.

Returns:



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def customer_service_data
  @customer_service_data
end

#merchant_category_code ⇒ Integer

Returns the current value of merchant_category_code.

Returns:

  • (Integer) —

    the current value of merchant_category_code



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def merchant_category_code
  @merchant_category_code
end

#name ⇒ String

Returns the current value of name.

Returns:

  • (String) —

    the current value of name



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def name
  @name
end

#payment_facilitator_id ⇒ String

Returns the current value of payment_facilitator_id.

Returns:

  • (String) —

    the current value of payment_facilitator_id



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def payment_facilitator_id
  @payment_facilitator_id
end

#postal_code ⇒ String

Returns the current value of postal_code.

Returns:

  • (String) —

    the current value of postal_code



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def postal_code
  @postal_code
end

#state_code ⇒ String

Returns the current value of state_code.

Returns:

  • (String) —

    the current value of state_code



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def state_code
  @state_code
end

#sub_merchant_id ⇒ String

Returns the current value of sub_merchant_id.

Returns:

  • (String) —

    the current value of sub_merchant_id



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def sub_merchant_id
  @sub_merchant_id
end

#tax_id ⇒ String

Returns the current value of tax_id.

Returns:

  • (String) —

    the current value of tax_id



23
24
25
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 23

def tax_id
  @tax_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 64

def from_hash(hash)
  super
  if hash.has_key? 'address'
    @address = hash['address']
  end
  if hash.has_key? 'city'
    @city = hash['city']
  end
  if hash.has_key? 'countryCode'
    @country_code = hash['countryCode']
  end
  if hash.has_key? 'customerServiceData'
    raise TypeError, "value '%s' is not a Hash" % [hash['customerServiceData']] unless hash['customerServiceData'].is_a? Hash
    @customer_service_data = Worldline::Acquiring::SDK::V1::Domain::CustomerServiceData.new_from_hash(hash['customerServiceData'])
  end
  if hash.has_key? 'merchantCategoryCode'
    @merchant_category_code = hash['merchantCategoryCode']
  end
  if hash.has_key? 'name'
    @name = hash['name']
  end
  if hash.has_key? 'paymentFacilitatorId'
    @payment_facilitator_id = hash['paymentFacilitatorId']
  end
  if hash.has_key? 'postalCode'
    @postal_code = hash['postalCode']
  end
  if hash.has_key? 'stateCode'
    @state_code = hash['stateCode']
  end
  if hash.has_key? 'subMerchantId'
    @sub_merchant_id = hash['subMerchantId']
  end
  if hash.has_key? 'taxId'
    @tax_id = hash['taxId']
  end
end

#to_h ⇒ Hash

Returns:

  • (Hash)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb', line 48

def to_h
  hash = super
  hash['address'] = @address unless @address.nil?
  hash['city'] = @city unless @city.nil?
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['customerServiceData'] = @customer_service_data.to_h unless @customer_service_data.nil?
  hash['merchantCategoryCode'] = @merchant_category_code unless @merchant_category_code.nil?
  hash['name'] = @name unless @name.nil?
  hash['paymentFacilitatorId'] = @payment_facilitator_id unless @payment_facilitator_id.nil?
  hash['postalCode'] = @postal_code unless @postal_code.nil?
  hash['stateCode'] = @state_code unless @state_code.nil?
  hash['subMerchantId'] = @sub_merchant_id unless @sub_merchant_id.nil?
  hash['taxId'] = @tax_id unless @tax_id.nil?
  hash
end