Class: OnlinePayments::SDK::Domain::CancelPaymentBatchRequest
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CancelPaymentBatchRequest
- Defined in:
- lib/onlinepayments/sdk/domain/cancel_payment_batch_request.rb
Instance Attribute Summary collapse
-
#cancel ⇒ OnlinePayments::SDK::Domain::CancelPaymentRequest
The current value of cancel.
-
#payment_id ⇒ String
The current value of payment_id.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#cancel ⇒ OnlinePayments::SDK::Domain::CancelPaymentRequest
Returns the current value of cancel.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_batch_request.rb', line 12 def cancel @cancel end |
#payment_id ⇒ String
Returns 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_h ⇒ 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 |