So it looks like your submit_debit and submit_credit are coming back None. You should log those out and see why.