This function validates the goods and processes them according to the transaction type.
Array of goods to be processed
Transaction type (Buy or Sell)
This function validates the goods and processes them according to the transaction type.