logging for contact creating
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user