#NEWLINE# def receive( xpub , callback , api_key ) : #NEWLINE# #INDENT# "Call the 'api/receive' endpoint and create a forwarding address.\n    \n    :param str xpub: extended public key to generate payment address\n    :param str callback: callback URI that will be called upon payment\n    :param str api_key: Blockchain.info API V2 key\n    :return: an instance of :class:`ReceiveResponse` class\n    " #NEWLINE# params = { #NEWLINE# #INDENT# 'xpub' : xpub , #NEWLINE# 'key' : api_key , #NEWLINE# 'callback' : callback , #NEWLINE# #UNINDENT# } #NEWLINE# resource = ( 'v2/receive?' + util . urlencode ( params ) ) #NEWLINE# resp = util . call_api ( resource , base_url = 'https://api.blockchain.info/' ) #NEWLINE# json_resp = json . loads ( resp ) #NEWLINE# payment_response = ReceiveResponse ( xpub [ 'address' ] , json_resp [ 'index' ] , json_resp [ 'callback' ] ) #NEWLINE# return payment_response