Class: OnlinePayments::SDK::Domain::CapturePaymentBatchRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#captureOnlinePayments::SDK::Domain::CapturePaymentRequest

Returns the current value of capture.

Returns:



12
13
14
# File 'lib/onlinepayments/sdk/domain/capture_payment_batch_request.rb', line 12

def capture
  @capture
end

#payment_idString

Returns the current value of payment_id.

Returns:

  • (String)

    the current value of payment_id



12
13
14
# File 'lib/onlinepayments/sdk/domain/capture_payment_batch_request.rb', line 12

def payment_id
  @payment_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.has_key? 'capture'
    raise TypeError, "value '%s' is not a Hash" % [hash['capture']] unless hash['capture'].is_a? Hash
    @capture = OnlinePayments::SDK::Domain::CapturePaymentRequest.new_from_hash(hash['capture'])
  end
  if hash.has_key? 'paymentId'
    @payment_id = hash['paymentId']
  end
end

#to_hHash

Returns:

  • (Hash)


19
20
21
22
23
24
# File 'lib/onlinepayments/sdk/domain/capture_payment_batch_request.rb', line 19

def to_h
  hash = super
  hash['capture'] = @capture.to_h unless @capture.nil?
  hash['paymentId'] = @payment_id unless @payment_id.nil?
  hash
end