Just curious, what value would that have to the user?
Any financial computation should be done on the server, for security's sake. Doing this in Javascript to alter the target URL seems very strange.
I don't see why the URL must contain the results of a calculation at all. If the server computes the total, then requiring a redirect to get the total into the browser's URL will add complication and reduce portability for different browsers. It'll break the "Back" button, too. If the client calculates it, you need a client capable of doing the calculation (javascript might not be available, or may have been turned off), and as mentioned above, it's exposed for meddling.
The client should only know the transaction ID and some authentication token. The server should not trust anything the client gives it. The server can offer any information the user must read, and can accept input from the user, but must double-check the validity of anything the client sends.
-- [ e d @ h a l l e y . c c ]
|