Bitcoin Forum
November 15, 2024, 04:43:34 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to receive and manipulate a bip 70 payment object in django python?  (Read 512 times)
derrend (OP)
Hero Member
*****
Offline Offline

Activity: 707
Merit: 505



View Profile WWW
June 10, 2014, 11:50:54 AM
 #1

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!