I'm not certain if this is limited to Costa Rica or if it applies elsewhere. The government allows you to put the exit fee on a Visa or Mastercard. However, they don't mention that it will be processed as a cash advance.
When I received my Visa bill this month I saw the charge for $54.70. However, I was also assessed a $10 minimum cash advance fee and a $1.50 minimum interest charge. I was able to get these charges removed after a lengthy wait.
Next time I ask and/or pay cash.