I had a similar experience in Mexico and learned a great defense is to take out a cell phone and tell the officers you are taking pictures of them, their car and the exchange of money to prove to your attorney that you paid the fine for the violation so the attorney can prove it to the court.
The police usually pass on everything or will give out a legitimate citation. Even taking a video levels the playing field. Also, don’t try to speak Spanish as them trying to explain anything frustrates them, and they’ll likely just give a warning.
Santo Domingo de Heredia