module ZipMoney::Request

Attributes

errors[RW]

Public Instance Methods

validate_item_details(order_items) click to toggle source
# File lib/zipMoney/request.rb, line 13
def validate_item_details(order_items)
  order_items.each_with_index do |item,index|
    @errors << "order.detail[#{index}].id must be provided" if item.id.nil? 
    @errors << "order.detail[#{index}].name must be provided" if item.name.nil? 
    @errors << "order.detail[#{index}].quantity must be provided" if item.quantity.nil? 
    @errors << "order.detail[#{index}].price must be provided" if item.price.nil? 
  end 
end