OnePay interview question

Read some code, it has failing test cases implement fix