Bitcoin Forum
April 26, 2024, 05:30:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   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 485 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!