Skip to content

Commit f0a992d

Browse files
committed
Update bip-0070-payment-protocol.py
1 parent e7b6300 commit f0a992d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

examples/bip-0070-payment-protocol.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
"""Bip-0070-related functionality
1010
11-
Handles incoming serialized string data in the form of a http request
12-
and returns an appropriate response using googles protocol buffers.
11+
Creates http response objects suitable for use with
12+
the bitcoin bip 70 using googles protocol buffers.
1313
"""
1414

1515
import urllib2
@@ -26,8 +26,8 @@
2626

2727
from time import time
2828

29-
def payment_request(request):
30-
"""Generates a PaymentRequest object"""
29+
def payment_request():
30+
"""Generates a http PaymentRequest object"""
3131

3232
bc = Proxy()
3333
btc = bc.getnewaddress()
@@ -54,16 +54,16 @@ def payment_request(request):
5454

5555
open('sds_pr_blob', 'wb').write(sds_pr)
5656
headers = {'Content-Type' : 'application/bitcoin-payment', 'Accept' : 'application/bitcoin-paymentrequest'}
57-
response = urllib2.Request('file:sds_pr_blob', None, headers)
57+
http_response_object = urllib2.Request('file:sds_pr_blob', None, headers)
5858

59-
return response
59+
return http_response_object
6060

6161

62-
def payment_ack(request):
62+
def payment_ack(serialized_Payment_message):
6363
"""Generates a PaymentACK object, captures client refund address and returns a message"""
6464

6565
pao = o.PaymentACK()
66-
pao.payment.ParseFromString(request.body)
66+
pao.payment.ParseFromString(serialized_Payment_message)
6767
pao.memo = 'String shown to user after payment confirmation'
6868

6969
refund_address = CBitcoinAddress.from_scriptPubKey(CScript(pao.payment.refund_to[0].script))
@@ -72,6 +72,6 @@ def payment_ack(request):
7272

7373
open('sds_pa_blob', 'wb').write(sds_pa)
7474
headers = {'Content-Type' : 'application/bitcoin-payment', 'Accept' : 'application/bitcoin-paymentack'}
75-
response = urllib2.Request('file:sds_pa_blob', None, headers)
75+
http_response_object = urllib2.Request('file:sds_pa_blob', None, headers)
7676

77-
return response
77+
return http_response_object

0 commit comments

Comments
 (0)