Author

Topic: How to receive and manipulate a bip 70 payment object in django python? (Read 512 times)

hero member
Activity: 707
Merit: 505
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 Smiley
Jump to: