Improve payment handling and logging