Skip to content

Commit 0b0ecd1

Browse files
committed
Merge pull request #33 from blockchain/remove-receive
Removed RP1 references and updated RP2 references
2 parents a0f5f56 + b119e09 commit 0b0ecd1

File tree

5 files changed

+49
-48
lines changed

5 files changed

+49
-48
lines changed

MANIFEST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ blockchain/createwallet.py
66
blockchain/exceptions.py
77
blockchain/exchangerates.py
88
blockchain/pushtx.py
9-
blockchain/receive.py
109
blockchain/statistics.py
1110
blockchain/util.py
1211
blockchain/wallet.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The module consists of the following sub-modules:
2323
* `createwallet` ([docs](docs/createwallet.md)) ([api/create_wallet][api2])
2424
* `exchangerates` ([docs](docs/exchangerates.md)) ([api/exchange\_rates\_api][api3])
2525
* `pushtx` ([docs](docs/pushtx.md)) ([pushtx][api7])
26-
* `receive` ([docs](docs/receive.md)) ([api/api_receive][api4])
26+
* `v2.receive` ([docs](docs/receive.md)) ([api/api_receive][api4])
2727
* `statistics` ([docs](docs/statistics.md)) ([api/charts_api][api5])
2828
* `wallet` ([docs](docs/wallet.md)) ([api/blockchain\_wallet\_api][api6])
2929

blockchain/receive.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

blockchain/v2/receive.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, callback_url, called_at, raw_response, response_code):
2424

2525

2626
def receive(xpub, callback, api_key):
27-
"""Call the 'api/receive' endpoint and create a forwarding address.
27+
"""Call the '/v2/receive' endpoint and create a forwarding address.
2828
2929
:param str xpub: extended public key to generate payment address
3030
:param str callback: callback URI that will be called upon payment
@@ -43,6 +43,12 @@ def receive(xpub, callback, api_key):
4343

4444

4545
def callback_log(callback, api_key):
46+
"""Call the 'v2/receive/callback_log' endpoint and returns the callback log
47+
for a given callback URI with parameters.
48+
:param callback: callback URI
49+
:param api_key: Blockchain.info API V2 key
50+
:return: a list of :class:`LogEntry` objects
51+
"""
4652
params = {'key': api_key, 'callback': callback}
4753
resource = 'v2/receive/callback_log?' + util.urlencode(params)
4854
resp = util.call_api(resource, base_url='https://api.blockchain.info/')

docs/receive.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,62 @@
1-
##`receive` module
1+
##`v2.receive` module
22

33
####`receive`
4-
Call the 'api/receive' endpoint and create a forwarding address. Returns a `ReceiveResponse` object.
4+
Call the 'api.blockchain.info/v2/receive' endpoint and create a forwarding address. Returns a `ReceiveResponse` object.
55

66
Params:
77
```
8-
dest_addr : str
8+
xpub : str
99
callback : str
10-
api_code : str (optional)
10+
api_code : str
1111
```
1212

1313
Usage:
1414
```python
15-
from blockchain import receive
15+
from blockchain.v2 import receive
1616

17-
resp = receive.receive('1hNapz1CuH4DhnV1DFHH7hafwDE8FJRheA', 'http://your.url.com')
17+
resp = receive.receive('1hNapz1CuH4DhnV1DFHH7hafwDE8FJRheA', 'http://your.url.com?invoice=1234465', 'your api key')
1818

1919
```
2020

21+
2122
###Response object field definitions
2223

2324
####`ReceiveResponse`
2425

2526
```
26-
fee_percent : int
27-
destination_address : str
28-
input_address : str
27+
address : str
28+
index : int
2929
callback_url : str
3030
```
31+
32+
####`callback_log`
33+
Call the 'api.blockchain.info/v2/receive/callback_log' endpoint and returns the list of callbacks performed for a given
34+
callback URI.
35+
Returns a list of `LogEntry` objects.
36+
37+
Params:
38+
```
39+
callback : str
40+
api_code : str
41+
```
42+
43+
Usage:
44+
```python
45+
from blockchain.v2 import receive
46+
47+
logs = receive.callback_log('http://your.url.com?invoice_id=1234465', 'your api key')
48+
49+
```
50+
51+
###Log entry object field definitions
52+
53+
####`LogEntry`
54+
55+
```
56+
callback_url : str
57+
callback_at : str
58+
raw_response : str
59+
response_code : int
60+
61+
```
62+

0 commit comments

Comments
 (0)