fixed bugs and tested payment.py