Class: OnlinePayments::SDK::Domain::Capture
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::Capture
- Defined in:
- lib/onlinepayments/sdk/domain/capture.rb
Instance Attribute Summary collapse
-
#capture_output ⇒ OnlinePayments::SDK::Domain::CaptureOutput
The current value of capture_output.
-
#id ⇒ String
The current value of id.
-
#status ⇒ String
The current value of status.
-
#status_output ⇒ OnlinePayments::SDK::Domain::CaptureStatusOutput
The current value of status_output.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#capture_output ⇒ OnlinePayments::SDK::Domain::CaptureOutput
Returns the current value of capture_output.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 15 def capture_output @capture_output end |
#id ⇒ String
Returns the current value of id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 15 def id @id end |
#status ⇒ String
Returns the current value of status.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 15 def status @status end |
#status_output ⇒ OnlinePayments::SDK::Domain::CaptureStatusOutput
Returns the current value of status_output.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 15 def status_output @status_output end |
Instance Method Details
#from_hash(hash) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 31 def from_hash(hash) super if hash.key? 'captureOutput' raise TypeError, "value '%s' is not a Hash" % [hash['captureOutput']] unless hash['captureOutput'].is_a? Hash @capture_output = OnlinePayments::SDK::Domain::CaptureOutput.new_from_hash(hash['captureOutput']) end @id = hash['id'] if hash.key? 'id' @status = hash['status'] if hash.key? 'status' if hash.key? 'statusOutput' raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash @status_output = OnlinePayments::SDK::Domain::CaptureStatusOutput.new_from_hash(hash['statusOutput']) end end |
#to_h ⇒ Hash
22 23 24 25 26 27 28 29 |
# File 'lib/onlinepayments/sdk/domain/capture.rb', line 22 def to_h hash = super hash['captureOutput'] = @capture_output.to_h if @capture_output hash['id'] = @id unless @id.nil? hash['status'] = @status unless @status.nil? hash['statusOutput'] = @status_output.to_h if @status_output hash end |