Class: OnlinePayments::SDK::Domain::SubsequentPaymentBatchRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#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/subsequent_payment_batch_request.rb', line 12

def payment_id
  @payment_id
end

#subsequentOnlinePayments::SDK::Domain::SubsequentPaymentRequest

Returns the current value of subsequent.

Returns:



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

def subsequent
  @subsequent
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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

#to_hHash

Returns:

  • (Hash)


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

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