I'm sure that using php or cgi you could manipulate the squid usernames file as outlined
here. You could even setup php to create the password using
htpasswd then you'd just have to pipe it to your passwd file. Of course that would be dependent on the successful integration of your payment gateway's API so that it redirects after a successful payment to the page that adds the info to your squid passwd file. THEN you'd have to protect your page so that people couldnt just type in the url
http://www.yourdomain.com/api?=succe...&passwd=hacked!