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

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/card_essentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#binString

Returns the current value of bin.

Returns:

  • (String)

    the current value of bin



14
15
16
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 14

def bin
  @bin
end

#card_numberString

Returns the current value of card_number.

Returns:

  • (String)

    the current value of card_number



14
15
16
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 14

def card_number
  @card_number
end

#card_typeString

Returns the current value of card_type.

Returns:

  • (String)

    the current value of card_type



14
15
16
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 14

def card_type
  @card_type
end

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



14
15
16
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 14

def country_code
  @country_code
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



14
15
16
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 14

def expiry_date
  @expiry_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 32

def from_hash(hash)
  super
  @bin = hash['bin'] if hash.key? 'bin'
  @card_number = hash['cardNumber'] if hash.key? 'cardNumber'
  @card_type = hash['cardType'] if hash.key? 'cardType'
  @country_code = hash['countryCode'] if hash.key? 'countryCode'
  @expiry_date = hash['expiryDate'] if hash.key? 'expiryDate'
end

#to_hHash

Returns:

  • (Hash)


22
23
24
25
26
27
28
29
30
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 22

def to_h
  hash = super
  hash['bin'] = @bin unless @bin.nil?
  hash['cardNumber'] = @card_number unless @card_number.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
end