don't add bip70 suffixes

This commit is contained in:
ThomasV 2015-07-22 16:00:08 +02:00
parent 6d54512627
commit 41d9c94821
1 changed files with 4 additions and 4 deletions

View File

@ -1228,13 +1228,13 @@ class Abstract_Wallet(object):
rdir = config.get('requests_dir') rdir = config.get('requests_dir')
if rdir: if rdir:
key = out.get('id', addr) key = out.get('id', addr)
path = os.path.join(rdir, key + '.bip70') path = os.path.join(rdir, key)
if os.path.exists(path): if os.path.exists(path):
baseurl = 'file://' + rdir baseurl = 'file://' + rdir
rewrite = config.get('url_rewrite') rewrite = config.get('url_rewrite')
if rewrite: if rewrite:
baseurl = baseurl.replace(*rewrite) baseurl = baseurl.replace(*rewrite)
out['request_url'] = os.path.join(baseurl, key + '.bip70') out['request_url'] = os.path.join(baseurl, key)
out['URI'] += '&r=' + out['request_url'] out['URI'] += '&r=' + out['request_url']
out['index_url'] = os.path.join(baseurl, 'index.html') + '?id=' + key out['index_url'] = os.path.join(baseurl, 'index.html') + '?id=' + key
return out return out
@ -1297,7 +1297,7 @@ class Abstract_Wallet(object):
shutil.copy(src, index) shutil.copy(src, index)
key = req.get('id', addr) key = req.get('id', addr)
pr = paymentrequest.make_request(config, req) pr = paymentrequest.make_request(config, req)
path = os.path.join(rdir, key + '.bip70') path = os.path.join(rdir, key)
with open(path, 'w') as f: with open(path, 'w') as f:
f.write(pr.SerializeToString()) f.write(pr.SerializeToString())
# reload # reload
@ -1313,7 +1313,7 @@ class Abstract_Wallet(object):
rdir = config.get('requests_dir') rdir = config.get('requests_dir')
if rdir: if rdir:
key = r.get('id', addr) key = r.get('id', addr)
for s in ['.json', '.bip70']: for s in ['.json', '']:
n = os.path.join(rdir, key + s) n = os.path.join(rdir, key + s)
if os.path.exists(n): if os.path.exists(n):
os.unlink(n) os.unlink(n)