With Payment Service Providers (PSPs), the general communication setup typically goes something like:
1) Your server contacts the PSP and sets up the transaction, specifying the amount required and your PSP account details.
2) The PSP responds with a transaction identifier, which you then add to the form. This transaction identifier holds no information about the prices involved - it's simply an identifier to the transaction record your server set up with the PSP.
3) Visitor fills out form which is sent off to the PSP. They then redirect the visitor back to your site.
4) Your server queries the PSP server and checks that the transaction succeeded (ie. the visitors payment method OK'd the transaction with the PSP, etc)
The server-to-PSP communication is typically done using a library such as curl.
Google provide a number of libraries / examples on how to correctly process transactions (and most other PSPs do the same, in my experience):
http://code.google.com/apis/checkout/samplecode.html
The exact communication details may vary depending on the PSP, but basically there should not be any need to have the "total amount" ever go through the form displayed to the visitor. It's all done server-to-server so that the visitor cannot possibly change the details.