Class: OnlinePayments::SDK::Domain::CancelPaymentBatchRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#cancelOnlinePayments::SDK::Domain::CancelPaymentRequest

Returns the current value of cancel.

Returns:



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

def cancel
  @cancel
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/cancel_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/cancel_payment_batch_request.rb', line 26

def from_hash(hash)
  super
  if hash.has_key? 'cancel'
    raise TypeError, "value '%s' is not a Hash" % [hash['cancel']] unless hash['cancel'].is_a? Hash
    @cancel = OnlinePayments::SDK::Domain::CancelPaymentRequest.new_from_hash(hash['cancel'])
  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/cancel_payment_batch_request.rb', line 19

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