Class: OnlinePayments::SDK::Domain::CardEssentials

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/card_essentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#binString

Returns the current value of bin.

Returns:

  • (String)

    the current value of bin



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def bin
  @bin
end

#card_corporate_indicatortrue/false

Returns the current value of card_corporate_indicator.

Returns:

  • (true/false)

    the current value of card_corporate_indicator



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_corporate_indicator
  @card_corporate_indicator
end

#card_effective_dateDate

Returns the current value of card_effective_date.

Returns:

  • (Date)

    the current value of card_effective_date



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_effective_date
  @card_effective_date
end

#card_effective_date_indicatortrue/false

Returns the current value of card_effective_date_indicator.

Returns:

  • (true/false)

    the current value of card_effective_date_indicator



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_effective_date_indicator
  @card_effective_date_indicator
end

#card_numberString

Returns the current value of card_number.

Returns:

  • (String)

    the current value of card_number



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_number
  @card_number
end

#card_pan_typeString

Returns the current value of card_pan_type.

Returns:

  • (String)

    the current value of card_pan_type



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_pan_type
  @card_pan_type
end

#card_product_codeString

Returns the current value of card_product_code.

Returns:

  • (String)

    the current value of card_product_code



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_product_code
  @card_product_code
end

#card_product_nameString

Returns the current value of card_product_name.

Returns:

  • (String)

    the current value of card_product_name



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_product_name
  @card_product_name
end

#card_product_usage_labelString

Returns the current value of card_product_usage_label.

Returns:

  • (String)

    the current value of card_product_usage_label



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_product_usage_label
  @card_product_usage_label
end

#card_schemeString

Returns the current value of card_scheme.

Returns:

  • (String)

    the current value of card_scheme



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_scheme
  @card_scheme
end

#card_typeString

Returns the current value of card_type.

Returns:

  • (String)

    the current value of card_type



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def card_type
  @card_type
end

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def country_code
  @country_code
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def expiry_date
  @expiry_date
end

#issuer_codeString

Returns the current value of issuer_code.

Returns:

  • (String)

    the current value of issuer_code



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def issuer_code
  @issuer_code
end

#issuer_nameString

Returns the current value of issuer_name.

Returns:

  • (String)

    the current value of issuer_name



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def issuer_name
  @issuer_name
end

#issuer_region_codeString

Returns the current value of issuer_region_code.

Returns:

  • (String)

    the current value of issuer_region_code



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def issuer_region_code
  @issuer_region_code
end

#issuing_country_codeString

Returns the current value of issuing_country_code.

Returns:

  • (String)

    the current value of issuing_country_code



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def issuing_country_code
  @issuing_country_code
end

#pan_length_maxInteger

Returns the current value of pan_length_max.

Returns:

  • (Integer)

    the current value of pan_length_max



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def pan_length_max
  @pan_length_max
end

#pan_length_minInteger

Returns the current value of pan_length_min.

Returns:

  • (Integer)

    the current value of pan_length_min



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def pan_length_min
  @pan_length_min
end

#pan_luhn_checktrue/false

Returns the current value of pan_luhn_check.

Returns:

  • (true/false)

    the current value of pan_luhn_check



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def pan_luhn_check
  @pan_luhn_check
end

#virtual_card_indicatortrue/false

Returns the current value of virtual_card_indicator.

Returns:

  • (true/false)

    the current value of virtual_card_indicator



32
33
34
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def virtual_card_indicator
  @virtual_card_indicator
end

Instance Method Details

#from_hash(hash) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 103

def from_hash(hash)
  super
  if hash.has_key? 'bin'
    @bin = hash['bin']
  end
  if hash.has_key? 'cardCorporateIndicator'
    @card_corporate_indicator = hash['cardCorporateIndicator']
  end
  if hash.has_key? 'cardEffectiveDate'
    @card_effective_date = Date.parse(hash['cardEffectiveDate'])
  end
  if hash.has_key? 'cardEffectiveDateIndicator'
    @card_effective_date_indicator = hash['cardEffectiveDateIndicator']
  end
  if hash.has_key? 'cardNumber'
    @card_number = hash['cardNumber']
  end
  if hash.has_key? 'cardPanType'
    @card_pan_type = hash['cardPanType']
  end
  if hash.has_key? 'cardProductCode'
    @card_product_code = hash['cardProductCode']
  end
  if hash.has_key? 'cardProductName'
    @card_product_name = hash['cardProductName']
  end
  if hash.has_key? 'cardProductUsageLabel'
    @card_product_usage_label = hash['cardProductUsageLabel']
  end
  if hash.has_key? 'cardScheme'
    @card_scheme = hash['cardScheme']
  end
  if hash.has_key? 'cardType'
    @card_type = hash['cardType']
  end
  if hash.has_key? 'countryCode'
    @country_code = hash['countryCode']
  end
  if hash.has_key? 'expiryDate'
    @expiry_date = hash['expiryDate']
  end
  if hash.has_key? 'issuerCode'
    @issuer_code = hash['issuerCode']
  end
  if hash.has_key? 'issuerName'
    @issuer_name = hash['issuerName']
  end
  if hash.has_key? 'issuerRegionCode'
    @issuer_region_code = hash['issuerRegionCode']
  end
  if hash.has_key? 'issuingCountryCode'
    @issuing_country_code = hash['issuingCountryCode']
  end
  if hash.has_key? 'panLengthMax'
    @pan_length_max = hash['panLengthMax']
  end
  if hash.has_key? 'panLengthMin'
    @pan_length_min = hash['panLengthMin']
  end
  if hash.has_key? 'panLuhnCheck'
    @pan_luhn_check = hash['panLuhnCheck']
  end
  if hash.has_key? 'virtualCardIndicator'
    @virtual_card_indicator = hash['virtualCardIndicator']
  end
end

#to_hHash

Returns:

  • (Hash)


77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 77

def to_h
  hash = super
  hash['bin'] = @bin unless @bin.nil?
  hash['cardCorporateIndicator'] = @card_corporate_indicator unless @card_corporate_indicator.nil?
  hash['cardEffectiveDate'] = @card_effective_date.iso8601 unless @card_effective_date.nil?
  hash['cardEffectiveDateIndicator'] = @card_effective_date_indicator unless @card_effective_date_indicator.nil?
  hash['cardNumber'] = @card_number unless @card_number.nil?
  hash['cardPanType'] = @card_pan_type unless @card_pan_type.nil?
  hash['cardProductCode'] = @card_product_code unless @card_product_code.nil?
  hash['cardProductName'] = @card_product_name unless @card_product_name.nil?
  hash['cardProductUsageLabel'] = @card_product_usage_label unless @card_product_usage_label.nil?
  hash['cardScheme'] = @card_scheme unless @card_scheme.nil?
  hash['cardType'] = @card_type unless @card_type.nil?
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
  hash['issuerCode'] = @issuer_code unless @issuer_code.nil?
  hash['issuerName'] = @issuer_name unless @issuer_name.nil?
  hash['issuerRegionCode'] = @issuer_region_code unless @issuer_region_code.nil?
  hash['issuingCountryCode'] = @issuing_country_code unless @issuing_country_code.nil?
  hash['panLengthMax'] = @pan_length_max unless @pan_length_max.nil?
  hash['panLengthMin'] = @pan_length_min unless @pan_length_min.nil?
  hash['panLuhnCheck'] = @pan_luhn_check unless @pan_luhn_check.nil?
  hash['virtualCardIndicator'] = @virtual_card_indicator unless @virtual_card_indicator.nil?
  hash
end