How can I override the Frappe Data Import to run some code during file import?

How can I make changes to a Payment Entry when importing a CSV file into my custom doctype? Should I override the frappe.handler.upload_file function in my custom app?