Class: OnlinePayments::SDK::Domain::CardEssentials
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CardEssentials
- Defined in:
- lib/onlinepayments/sdk/domain/card_essentials.rb
Instance Attribute Summary collapse
-
#bin ⇒ String
The current value of bin.
-
#card_number ⇒ String
The current value of card_number.
-
#country_code ⇒ String
The current value of country_code.
-
#expiry_date ⇒ String
The current value of expiry_date.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#bin ⇒ String
Returns the current value of bin.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 13 def bin @bin end |
#card_number ⇒ String
Returns the current value of card_number.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 13 def card_number @card_number end |
#country_code ⇒ String
Returns the current value of country_code.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 13 def country_code @country_code end |
#expiry_date ⇒ String
Returns the current value of expiry_date.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 13 def expiry_date @expiry_date end |
Instance Method Details
#from_hash(hash) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 33 def from_hash(hash) super if hash.has_key? 'bin' @bin = hash['bin'] end if hash.has_key? 'cardNumber' @card_number = hash['cardNumber'] end if hash.has_key? 'countryCode' @country_code = hash['countryCode'] end if hash.has_key? 'expiryDate' @expiry_date = hash['expiryDate'] end end |
#to_h ⇒ Hash
24 25 26 27 28 29 30 31 |
# File 'lib/onlinepayments/sdk/domain/card_essentials.rb', line 24 def to_h hash = super hash['bin'] = @bin unless @bin.nil? hash['cardNumber'] = @card_number unless @card_number.nil? hash['countryCode'] = @country_code unless @country_code.nil? hash['expiryDate'] = @expiry_date unless @expiry_date.nil? hash end |