Private
Public Access
1
0

logging for contact creating

This commit is contained in:
Sander Roosendaal
2021-02-03 18:14:15 +01:00
parent 1f8dfc190c
commit 5d251be783

View File

@@ -55,12 +55,21 @@ def create_contact(rower):
"web": ""
}
with open('braintreewebhooks.log','a') as f:
f.write('Creating fakturoid contact for '+str(rower.user.email)+'\n')
res = requests.post(contacts_url, data=json.dumps(post_data), auth=auth,headers=headers)
with open('braintreewebhooks.log','a') as f:
f.write('Status Code '+str(res.status_code)+'\n')
if res.status_code not in [200,201]:
return 0
with open('braintreewebhooks.log','a') as f:
f.write('Contact ID'+str(res.json()['id'])+'\n')
return res.json()['id']
# this should be triggered by a Braintree webhook