You need to go this link and click on your province. A form will come up, with the province you chose printed at the bottom. NOTE: THESE FORMS CAN ONLY BE USED FOR PRESENTATION AT GOVERNMENT FOREIGNERS OFFICES, NOT AT NATIONAL POLICE STATONS.
Fill out the top part of the form with your personal data, tick the relevant document you want to pay for.
For a Residency Certificate, or a duplicate of that, you tick no. 5. The relevant amount to pay, will now appear in the field at the bottom of the form. Once all data completed, press ´Obtener Documento´, this will generate a document ´Código 052´ in triplicate, with a unique number and barcode (top of the form) that you can print out and take to your bank to pay the ´tasa´.
Bring all three copies to bank, they will stamp all, keep one, you need to take the other two to the Foreigners Office as proof of pay. They will keep one and the third one is for your own administration.
You can also pay online, if you have a digital certificate installed on your computer. Info on how to do that here (in English):
If you need to pay ´tasa´ for a residency certificate or other at Policia Nacional, you need to use Modelo 790/012 and tick the 5th box under ´certificados registro residentes comunitarios´.