Class: GlobalCollect::Responses::GetOrderStatus::V2ResponseMethods::OrderStatus

Inherits:
Struct
  • Object
show all
Defined in:
lib/global_collect/responses/get_order_status/v2_response_methods.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject

NOTE: these error fields correspond to the potential errors on the order or payment, not on this response. Those can be found in the #error object of the response.



58
59
60
61
62
# File 'lib/global_collect/responses/get_order_status/v2_response_methods.rb', line 58

def errors
  return [] unless status_hash['ERRORS']
  errs = status_hash['ERRORS']['ERROR'].is_a?(Array) ? status_hash['ERRORS']['ERROR'] : [status_hash['ERRORS']['ERROR']]
  errs.map{|err| OrderStatusError.new(err['CODE'].to_i, err['MESSAGE']) }
end

#payment_productObject



51
52
53
# File 'lib/global_collect/responses/get_order_status/v2_response_methods.rb', line 51

def payment_product
  GlobalCollect::Const::PaymentProduct.from_code(payment_product_id)
end

#payment_statusObject



47
48
49
# File 'lib/global_collect/responses/get_order_status/v2_response_methods.rb', line 47

def payment_status
  GlobalCollect::Const::PaymentStatus.from_code(status_id)
end