Class: OnlinePayments::SDK::Domain::CapturePaymentRequest

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/capture_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#amountInteger

Returns the current value of amount.

Returns:

  • (Integer)

    the current value of amount



15
16
17
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 15

def amount
  @amount
end

#is_finaltrue/false

Returns the current value of is_final.

Returns:

  • (true/false)

    the current value of is_final



15
16
17
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 15

def is_final
  @is_final
end

#operation_referencesOnlinePayments::SDK::Domain::OperationPaymentReferences

Returns the current value of operation_references.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 15

def operation_references
  @operation_references
end

#referencesOnlinePayments::SDK::Domain::PaymentReferences

Returns the current value of references.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 15

def references
  @references
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 35

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? '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
end

#to_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/capture_payment_request.rb', line 26

def to_h
  hash = super
  hash['amount'] = @amount unless @amount.nil?
  hash['isFinal'] = @is_final unless @is_final.nil?
  hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash
end