diff --git a/rowers/fakturoid.py b/rowers/fakturoid.py index f50cb028..2fba2b31 100644 --- a/rowers/fakturoid.py +++ b/rowers/fakturoid.py @@ -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