Class: OnlinePayments::SDK::Domain::CurrencyConversionRequest
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::CurrencyConversionRequest
- Defined in:
- lib/onlinepayments/sdk/domain/currency_conversion_request.rb
Instance Attribute Summary collapse
-
#card_source ⇒ OnlinePayments::SDK::Domain::DccCardSource
The current value of card_source.
-
#transaction ⇒ OnlinePayments::SDK::Domain::Transaction
The current value of transaction.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#card_source ⇒ OnlinePayments::SDK::Domain::DccCardSource
Returns the current value of card_source.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_request.rb', line 13 def card_source @card_source end |
#transaction ⇒ OnlinePayments::SDK::Domain::Transaction
Returns the current value of transaction.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_request.rb', line 13 def transaction @transaction end |
Instance Method Details
#from_hash(hash) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_request.rb', line 25 def from_hash(hash) super if hash.key? 'cardSource' raise TypeError, "value '%s' is not a Hash" % [hash['cardSource']] unless hash['cardSource'].is_a? Hash @card_source = OnlinePayments::SDK::Domain::DccCardSource.new_from_hash(hash['cardSource']) end if hash.key? 'transaction' raise TypeError, "value '%s' is not a Hash" % [hash['transaction']] unless hash['transaction'].is_a? Hash @transaction = OnlinePayments::SDK::Domain::Transaction.new_from_hash(hash['transaction']) end end |
#to_h ⇒ Hash
18 19 20 21 22 23 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_request.rb', line 18 def to_h hash = super hash['cardSource'] = @card_source.to_h if @card_source hash['transaction'] = @transaction.to_h if @transaction hash end |