Class: OnlinePayments::SDK::Domain::PaymentStatusOutput
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PaymentStatusOutput
- Defined in:
- lib/onlinepayments/sdk/domain/payment_status_output.rb
Instance Attribute Summary collapse
-
#errors ⇒ Array<OnlinePayments::SDK::Domain::APIError>
The current value of errors.
-
#is_authorized ⇒ true/false
The current value of is_authorized.
-
#is_cancellable ⇒ true/false
The current value of is_cancellable.
-
#is_refundable ⇒ true/false
The current value of is_refundable.
-
#status_category ⇒ String
The current value of status_category.
-
#status_code ⇒ Integer
The current value of status_code.
-
#status_code_change_date_time ⇒ String
The current value of status_code_change_date_time.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#errors ⇒ Array<OnlinePayments::SDK::Domain::APIError>
Returns the current value of errors.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def errors @errors end |
#is_authorized ⇒ true/false
Returns the current value of is_authorized.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def @is_authorized end |
#is_cancellable ⇒ true/false
Returns the current value of is_cancellable.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def is_cancellable @is_cancellable end |
#is_refundable ⇒ true/false
Returns the current value of is_refundable.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def is_refundable @is_refundable end |
#status_category ⇒ String
Returns the current value of status_category.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def status_category @status_category end |
#status_code ⇒ Integer
Returns the current value of status_code.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def status_code @status_code end |
#status_code_change_date_time ⇒ String
Returns the current value of status_code_change_date_time.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 17 def status_code_change_date_time @status_code_change_date_time end |
Instance Method Details
#from_hash(hash) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 39 def from_hash(hash) super if hash.key? 'errors' raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array @errors = [] hash['errors'].each do |e| @errors << OnlinePayments::SDK::Domain::APIError.new_from_hash(e) end end @is_authorized = hash['isAuthorized'] if hash.key? 'isAuthorized' @is_cancellable = hash['isCancellable'] if hash.key? 'isCancellable' @is_refundable = hash['isRefundable'] if hash.key? 'isRefundable' @status_category = hash['statusCategory'] if hash.key? 'statusCategory' @status_code = hash['statusCode'] if hash.key? 'statusCode' @status_code_change_date_time = hash['statusCodeChangeDateTime'] if hash.key? 'statusCodeChangeDateTime' end |
#to_h ⇒ Hash
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/onlinepayments/sdk/domain/payment_status_output.rb', line 27 def to_h hash = super hash['errors'] = @errors.collect(&:to_h) if @errors hash['isAuthorized'] = @is_authorized unless @is_authorized.nil? hash['isCancellable'] = @is_cancellable unless @is_cancellable.nil? hash['isRefundable'] = @is_refundable unless @is_refundable.nil? hash['statusCategory'] = @status_category unless @status_category.nil? hash['statusCode'] = @status_code unless @status_code.nil? hash['statusCodeChangeDateTime'] = @status_code_change_date_time unless @status_code_change_date_time.nil? hash end |