Add test for process/getPayment and fix bugs