Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: derrend on June 10, 2014, 11:50:54 AM



Title: How to receive and manipulate a bip 70 payment object in django python?
Post by: derrend on June 10, 2014, 11:50:54 AM
I'm trying to check to see if the variables are being set correctly by the client and being received correctly by me.
I'm new to proto buffs and django and my code below doesn't seem to be working.
I'm using bitcoin 0.9
I'm trying to capture a refund address.

In views:
Code:
    from project import payments_pb2
    def protoresponse(request):
        xpo = payments_pb2.Payment.ParseFromString(request)
        returnaddress = xpo.refund_to
        transactions = xpo.transactions
        memo = xpo.memo
    
        xpa = payments_pb2.PaymentACK
        xpa.payment = xpo.SerializeToString()
        xpa.memo = 'success'
        return HttpResponse(xpa.SerializeToString(), content_type="application/octet-stream")
Any pointers would be greatly appreciated :)