created newPayment and newTransaction functions to handle different submissions