Class: OnlinePayments::SDK::Domain::PaymentOutputSummary
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentOutputSummary
- Defined in:
- lib/onlinepayments/sdk/domain/payment_output_summary.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummary
The current value of card_payment_method_specific_output.
-
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
The current value of references.
-
#transaction_date ⇒ DateTime
The current value of transaction_date.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
18 19 20 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 18 def amount_of_money @amount_of_money end |
#card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummary
Returns the current value of card_payment_method_specific_output.
18 19 20 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 18 def card_payment_method_specific_output @card_payment_method_specific_output end |
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
Returns the current value of references.
18 19 20 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 18 def references @references end |
#transaction_date ⇒ DateTime
Returns the current value of transaction_date.
18 19 20 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 18 def transaction_date @transaction_date end |
Instance Method Details
#from_hash(hash) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 38 def from_hash(hash) super if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'cardPaymentMethodSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash @card_payment_method_specific_output = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummary.new_from_hash(hash['cardPaymentMethodSpecificOutput']) end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = OnlinePayments::SDK::Domain::PaymentReferences.new_from_hash(hash['references']) end if hash.has_key? 'transactionDate' @transaction_date = DateTime.parse(hash['transactionDate']) end end |
#to_h ⇒ Hash
29 30 31 32 33 34 35 36 |
# File 'lib/onlinepayments/sdk/domain/payment_output_summary.rb', line 29 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil? hash['references'] = @references.to_h unless @references.nil? hash['transactionDate'] = @transaction_date.iso8601(3) unless @transaction_date.nil? hash end |