Class: Ingenico::Direct::SDK::Domain::Card
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::Card
- Defined in:
- lib/ingenico/direct/sdk/domain/card.rb
Instance Attribute Summary collapse
-
#card_number ⇒ String
The current value of card_number.
-
#cardholder_name ⇒ String
The current value of cardholder_name.
-
#cvv ⇒ String
The current value of cvv.
-
#expiry_date ⇒ String
The current value of expiry_date.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#card_number ⇒ String
Returns the current value of card_number.
14 15 16 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 14 def card_number @card_number end |
#cardholder_name ⇒ String
Returns the current value of cardholder_name.
14 15 16 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 14 def cardholder_name @cardholder_name end |
#cvv ⇒ String
Returns the current value of cvv.
14 15 16 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 14 def cvv @cvv end |
#expiry_date ⇒ String
Returns the current value of expiry_date.
14 15 16 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 14 def expiry_date @expiry_date end |
Instance Method Details
#from_hash(hash) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 30 def from_hash(hash) super @card_number = hash['cardNumber'] if hash.key? 'cardNumber' @cardholder_name = hash['cardholderName'] if hash.key? 'cardholderName' @cvv = hash['cvv'] if hash.key? 'cvv' @expiry_date = hash['expiryDate'] if hash.key? 'expiryDate' end |
#to_h ⇒ Hash
21 22 23 24 25 26 27 28 |
# File 'lib/ingenico/direct/sdk/domain/card.rb', line 21 def to_h hash = super hash['cardNumber'] = @card_number unless @card_number.nil? hash['cardholderName'] = @cardholder_name unless @cardholder_name.nil? hash['cvv'] = @cvv unless @cvv.nil? hash['expiryDate'] = @expiry_date unless @expiry_date.nil? hash end |