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