Class: Ingenico::Connect::SDK::Domain::Token::TokenCardData
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Token::TokenCardData
- Defined in:
- lib/ingenico/connect/sdk/domain/token/token_card_data.rb
Instance Attribute Summary collapse
- #card_without_cvv ⇒ Object
-
#first_transaction_date ⇒ Object
String.
-
#provider_reference ⇒ Object
String.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#card_without_cvv ⇒ Object
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 15 def card_without_cvv @card_without_cvv end |
#first_transaction_date ⇒ Object
String
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 18 def first_transaction_date @first_transaction_date end |
#provider_reference ⇒ Object
String
21 22 23 |
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 21 def provider_reference @provider_reference end |
Instance Method Details
#from_hash(hash) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 31 def from_hash(hash) super if hash.has_key?('cardWithoutCvv') if !(hash['cardWithoutCvv'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['cardWithoutCvv']] end @card_without_cvv = Ingenico::Connect::SDK::Domain::Definitions::CardWithoutCvv.new_from_hash(hash['cardWithoutCvv']) end if hash.has_key?('firstTransactionDate') @first_transaction_date = hash['firstTransactionDate'] end if hash.has_key?('providerReference') @provider_reference = hash['providerReference'] end end |
#to_h ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 23 def to_h hash = super add_to_hash(hash, 'cardWithoutCvv', @card_without_cvv) add_to_hash(hash, 'firstTransactionDate', @first_transaction_date) add_to_hash(hash, 'providerReference', @provider_reference) hash end |