If your student owes you money, you can refrain from recommending that student for the practical test. However, you do not have the option of failing to endorse the student's log or training record for the instruction you have provided. That is a requirement established by 14 CFR 61.189(a):
You always have the option of refusing to recommend for the practical test until you receive payment. If it were me and I felt strongly on the topic, I might contact the examiner involved and notify the examiner that you have not received payment, should the student attempt to proceed with the practical test using the services of a different instructor. An ethical examiner should be willing to work with you on that matter and refuse to conduct the test until you are payed. That is, of course, at the discretion of the examiner.
The fact that you haven't been paid suggests that you are providing independent instruction. While independent instruction is perfectly legitimate, remember that if you're instructing through a school or through a FBO's offering, you have some protection in that the student won't be allowed to rent unless the bill is paid. Often that means payment up front, often in a block amount. This is a benifit to you.
You are not under any obligation to ever recommend a student for a practical test, but you must always provide an endorsement for training received. Note that the regulation does not address financial arrangement or gain. This means for you that it doesn't matter what the student pays you; you give the instruction, you endorse the students logbook or training record for the instruction you have provided, or you may face enforcement action. The FAA couldn't care less if you get paid.§ 61.189 Flight instructor records.
(a) A flight instructor must sign the logbook of each person to whom that instructor has given flight training or ground training.
You always have the option of refusing to recommend for the practical test until you receive payment. If it were me and I felt strongly on the topic, I might contact the examiner involved and notify the examiner that you have not received payment, should the student attempt to proceed with the practical test using the services of a different instructor. An ethical examiner should be willing to work with you on that matter and refuse to conduct the test until you are payed. That is, of course, at the discretion of the examiner.
The fact that you haven't been paid suggests that you are providing independent instruction. While independent instruction is perfectly legitimate, remember that if you're instructing through a school or through a FBO's offering, you have some protection in that the student won't be allowed to rent unless the bill is paid. Often that means payment up front, often in a block amount. This is a benifit to you.