two-step payment process with atrocious HTML form

This commit is contained in:
Seth Schoen
2012-11-15 15:03:57 -08:00
parent b3be68ba67
commit adc2a62735
+22 -1
View File
@@ -8,11 +8,32 @@
import web, redis
urls = (
'/(.*)', 'payment'
'/([a-f0-9]{64})', 'form',
'/submit=([a-f0-9]{64})', 'payment'
)
r = redis.Redis()
class form(object):
def GET(self, what):
web.header("Content-type", "text/html")
return """
<html>
<h1>Payment</h1>
Issuing this certificate requires a payment of 17 simoleons.
<p>
In order to process this payment, please pretend to enter a 16-digit credit-card
number below, and then click the Submit Payment button.
<p>
<form name="ignored">
<input type="text" name="cc"><br>
</form>
<form action="/payment.py/submit=%s" method="GET" name="other">
<input type="submit" value="Submit Payment">
</form>
</html>
""" % what
def hexdigit(s):
return s in "0123456789abcdef"