Class: OnlinePayments::SDK::Domain::PaymentOutput
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PaymentOutput
- Defined in:
- lib/onlinepayments/sdk/domain/payment_output.rb
Instance Attribute Summary collapse
-
#acquired_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of acquired_amount.
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#amount_paid ⇒ Long
The current value of amount_paid.
-
#card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutput
The current value of card_payment_method_specific_output.
-
#customer ⇒ OnlinePayments::SDK::Domain::CustomerOutput
The current value of customer.
-
#discount ⇒ OnlinePayments::SDK::Domain::Discount
The current value of discount.
-
#merchant_parameters ⇒ String
The current value of merchant_parameters.
-
#mobile_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::MobilePaymentMethodSpecificOutput
The current value of mobile_payment_method_specific_output.
-
#payment_method ⇒ String
The current value of payment_method.
-
#redirect_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificOutput
The current value of redirect_payment_method_specific_output.
-
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
The current value of references.
-
#sepa_direct_debit_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificOutput
The current value of sepa_direct_debit_payment_method_specific_output.
-
#surcharge_specific_output ⇒ OnlinePayments::SDK::Domain::SurchargeSpecificOutput
The current value of surcharge_specific_output.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#acquired_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of acquired_amount.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def acquired_amount @acquired_amount end |
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def amount_of_money @amount_of_money end |
#amount_paid ⇒ Long
Returns the current value of amount_paid.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def amount_paid @amount_paid end |
#card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutput
Returns the current value of card_payment_method_specific_output.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def card_payment_method_specific_output @card_payment_method_specific_output end |
#customer ⇒ OnlinePayments::SDK::Domain::CustomerOutput
Returns the current value of customer.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def customer @customer end |
#discount ⇒ OnlinePayments::SDK::Domain::Discount
Returns the current value of discount.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def discount @discount end |
#merchant_parameters ⇒ String
Returns the current value of merchant_parameters.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def merchant_parameters @merchant_parameters end |
#mobile_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::MobilePaymentMethodSpecificOutput
Returns the current value of mobile_payment_method_specific_output.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def mobile_payment_method_specific_output @mobile_payment_method_specific_output end |
#payment_method ⇒ String
Returns the current value of payment_method.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def payment_method @payment_method end |
#redirect_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificOutput
Returns the current value of redirect_payment_method_specific_output.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def redirect_payment_method_specific_output @redirect_payment_method_specific_output end |
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
Returns the current value of references.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def references @references end |
#sepa_direct_debit_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificOutput
Returns the current value of sepa_direct_debit_payment_method_specific_output.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def sepa_direct_debit_payment_method_specific_output @sepa_direct_debit_payment_method_specific_output end |
#surcharge_specific_output ⇒ OnlinePayments::SDK::Domain::SurchargeSpecificOutput
Returns the current value of surcharge_specific_output.
31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 31 def surcharge_specific_output @surcharge_specific_output end |
Instance Method Details
#from_hash(hash) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 65 def from_hash(hash) super if hash.key? 'acquiredAmount' raise TypeError, "value '%s' is not a Hash" % [hash['acquiredAmount']] unless hash['acquiredAmount'].is_a? Hash @acquired_amount = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['acquiredAmount']) end if hash.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 @amount_paid = hash['amountPaid'] if hash.key? 'amountPaid' if hash.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::CardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput']) end if hash.key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = OnlinePayments::SDK::Domain::CustomerOutput.new_from_hash(hash['customer']) end if hash.key? 'discount' raise TypeError, "value '%s' is not a Hash" % [hash['discount']] unless hash['discount'].is_a? Hash @discount = OnlinePayments::SDK::Domain::Discount.new_from_hash(hash['discount']) end @merchant_parameters = hash['merchantParameters'] if hash.key? 'merchantParameters' if hash.key? 'mobilePaymentMethodSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash @mobile_payment_method_specific_output = OnlinePayments::SDK::Domain::MobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput']) end @payment_method = hash['paymentMethod'] if hash.key? 'paymentMethod' if hash.key? 'redirectPaymentMethodSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificOutput']] unless hash['redirectPaymentMethodSpecificOutput'].is_a? Hash @redirect_payment_method_specific_output = OnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificOutput.new_from_hash(hash['redirectPaymentMethodSpecificOutput']) end if hash.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.key? 'sepaDirectDebitPaymentMethodSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificOutput']] unless hash['sepaDirectDebitPaymentMethodSpecificOutput'].is_a? Hash @sepa_direct_debit_payment_method_specific_output = OnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificOutput.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificOutput']) end if hash.key? 'surchargeSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['surchargeSpecificOutput']] unless hash['surchargeSpecificOutput'].is_a? Hash @surcharge_specific_output = OnlinePayments::SDK::Domain::SurchargeSpecificOutput.new_from_hash(hash['surchargeSpecificOutput']) end end |
#to_h ⇒ Hash
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/onlinepayments/sdk/domain/payment_output.rb', line 47 def to_h hash = super hash['acquiredAmount'] = @acquired_amount.to_h if @acquired_amount hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money hash['amountPaid'] = @amount_paid unless @amount_paid.nil? hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h if @card_payment_method_specific_output hash['customer'] = @customer.to_h if @customer hash['discount'] = @discount.to_h if @discount hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil? hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h if @mobile_payment_method_specific_output hash['paymentMethod'] = @payment_method unless @payment_method.nil? hash['redirectPaymentMethodSpecificOutput'] = @redirect_payment_method_specific_output.to_h if @redirect_payment_method_specific_output hash['references'] = @references.to_h if @references hash['sepaDirectDebitPaymentMethodSpecificOutput'] = @sepa_direct_debit_payment_method_specific_output.to_h if @sepa_direct_debit_payment_method_specific_output hash['surchargeSpecificOutput'] = @surcharge_specific_output.to_h if @surcharge_specific_output hash end |