The SkullSpace anti-social is only 2 weeks away! If you need a ticket,
talk to me, Brittany, Courtney, or Ian; or just email discuss@ and we'll
take care of you!

I've just finished putting up bitcoin support as promised:
http://antisocialbitcoins.vmsrv.skullspace.ca/

Probably a big waste of my time. I didn't even use a proper transaction system that uses unique addresses, though I've left two options for buyers to mitigate the dispute risk that creates.

Somewhat nifty is the half-assed api for quickbt.com that I've linked up to. If someone wants to pay electronically, but doesn't have any bitcoin, they can pay us through that website which goes through Interac online . You're required to have a cell phone and online banking with BMO, Scotia Bank, RBC, or TD.

I haven't even tested that out to the fullest as I'm not with any of those banks.

Attached are my three underlying python code files for anyone's interest. I wonders if that unsanitized input into the smtp library can cause any greater havoc than spamming, patch welcome...
#!/usr/bin/env python

from cgi import FieldStorage
from smtplib import SMTP
from random import SystemRandom
from datetime import datetime

from log import log_stuff

def send_invoice_email(invoice_id, email, pay_url):
    import smtplib

    fromaddr = "Mark Jenkins <[email protected]>"
    toaddrs  = email

    # Add the From: and To: headers at the start!
    msg = ("From: %s\r\nTo: %s\r\n\r\n"
       % (fromaddr, ", ".join(toaddrs)))

    server = SMTP('localhost')
    server.sendmail(
        fromaddr, toaddrs,
        ("From: %s\r\n"
         "To: %s\r\n"
         "Subject: Anti-Social bitcoins\r\n\r\n"
         "Your purchase order number is %s.\r\n"
         "Pay at %s") % (fromaddr, toaddrs, invoice_id, pay_url)
        )
    server.quit()

print 'Content-type: text/html\n\n'
print """<html>
<head><title>Anti-Social tickets by bitcoin</title></head>
<body>
"""

fs = FieldStorage()
if 'email' in fs:
    email = fs['email'].value
    r = SystemRandom()
    invoice_id = r.randrange(1, 2**16)

    log_stuff("assigned %s to %s at %s\n" % (
            invoice_id, email, str(datetime.now()) ) )
    quickbt_url = (
        "https://quickbt.com/?";
        "btcto=1D2BCsMNpv3fiCMbLUzAeV8wmPovL8XokR&"
        "btcamount=0.1&"
        "passed_id=%s&"
        "redir=http://antisocialbitcoins.vmsrv.skullspace.ca/";
        "cgi-bin/thanks.cgi"
        ) % invoice_id

    send_invoice_email(invoice_id, email, quickbt_url)

    print """<p>Your unique invoice id is <strong>%s</strong>.
Save it. You need it to claim your ticket at the door.
</p>
<p>
Complete the transaction by following the <a href="%s">buy now</a> link.
</p>
<p>
<a href="%s"><img src="/buynow.gif" /></a>
</p>

<p>
All of this info has also been sent as well your email address. 
Email will come from Mark Jenkins <[email protected]>.
</p>
""" % (invoice_id, quickbt_url, quickbt_url)


print """
</body>
</html>
"""
def log_stuff(msg):
    log_file = file("antisocialbtc.log", 'a')
    log_file.write(msg)
    log_file.close()
#!/usr/bin/env python

from cgi import FieldStorage
from datetime import datetime
from log import log_stuff

print 'Content-type: text/html\n\n'
print """<html>
<head><title>Anti-Social tickets by bitcoin</title></head>
<body>
"""

fs = FieldStorage()
if 'tx' in fs and 'passed_id' in fs:
    tx = fs['tx'].value
    passed_id = fs['passed_id'].value
    log_stuff("thanks hit tx %s passed_id %s %s\n"
              % (tx, passed_id, str(datetime.now()) ) )
    print """
<p><strong>Thank you!</strong></p>
<p>Transaction %s with this unique invoice id <strong>%s</strong> paid for.
""" % (tx, passed_id)
else:
    print """Oops, the tx or passed_id field is missing in the url.
    Report this full URL to Mark Jenkins <[email protected]> .
    """

print """
</body>
</html>
"""

_______________________________________________
SkullSpace Discuss Mailing List
Help: http://www.skullspace.ca/wiki/index.php/Mailing_List#Discuss
Archive: https://groups.google.com/group/skullspace-discuss-archive/

Reply via email to