Class: OnlinePayments::SDK::Domain::CapturePaymentRequest
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CapturePaymentRequest
- Defined in:
- lib/onlinepayments/sdk/domain/capture_payment_request.rb
Instance Attribute Summary collapse
-
#amount ⇒ Integer
The current value of amount.
-
#is_final ⇒ true/false
The current value of is_final.
-
#line_item_details ⇒ Array<OnlinePayments::SDK::Domain::LineItemDetail>
The current value of line_item_details.
-
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences
The current value of operation_references.
-
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
The current value of references.
-
#shipping ⇒ OnlinePayments::SDK::Domain::ShippingDetail
The current value of shipping.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#amount ⇒ Integer
Returns the current value of amount.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def amount @amount end |
#is_final ⇒ true/false
Returns the current value of is_final.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def is_final @is_final end |
#line_item_details ⇒ Array<OnlinePayments::SDK::Domain::LineItemDetail>
Returns the current value of line_item_details.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def line_item_details @line_item_details end |
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences
Returns the current value of operation_references.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def operation_references @operation_references end |
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
Returns the current value of references.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def references @references end |
#shipping ⇒ OnlinePayments::SDK::Domain::ShippingDetail
Returns the current value of shipping.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 19 def shipping @shipping end |
Instance Method Details
#from_hash(hash) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 45 def from_hash(hash) super if hash.has_key? 'amount' @amount = hash['amount'] end if hash.has_key? 'isFinal' @is_final = hash['isFinal'] end if hash.has_key? 'lineItemDetails' raise TypeError, "value '%s' is not an Array" % [hash['lineItemDetails']] unless hash['lineItemDetails'].is_a? Array @line_item_details = [] hash['lineItemDetails'].each do |e| @line_item_details << OnlinePayments::SDK::Domain::LineItemDetail.new_from_hash(e) end end if hash.has_key? 'operationReferences' raise TypeError, "value '%s' is not a Hash" % [hash['operationReferences']] unless hash['operationReferences'].is_a? Hash @operation_references = OnlinePayments::SDK::Domain::OperationPaymentReferences.new_from_hash(hash['operationReferences']) 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? 'shipping' raise TypeError, "value '%s' is not a Hash" % [hash['shipping']] unless hash['shipping'].is_a? Hash @shipping = OnlinePayments::SDK::Domain::ShippingDetail.new_from_hash(hash['shipping']) end end |
#to_h ⇒ Hash
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 34 def to_h hash = super hash['amount'] = @amount unless @amount.nil? hash['isFinal'] = @is_final unless @is_final.nil? hash['lineItemDetails'] = @line_item_details.collect{|val| val.to_h} unless @line_item_details.nil? hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil? hash['references'] = @references.to_h unless @references.nil? hash['shipping'] = @shipping.to_h unless @shipping.nil? hash end |