From a17af76838b03adbe3be1eba732a7927f7d6dc21 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 5 Aug 2019 20:11:01 +0200 Subject: [PATCH] adding address to transactions --- rowers/braintreestuff.py | 9 ++++++++- rowers/tests/testdata/testdata.csv.gz | Bin 12523 -> 12523 bytes rowers/views/statements.py | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py index 9182a94d..45f08c85 100644 --- a/rowers/braintreestuff.py +++ b/rowers/braintreestuff.py @@ -385,6 +385,7 @@ def get_transactions(start_date,end_date): amounts = [] countries = [] + addresses = [] card_countries = [] names = [] emails = [] @@ -408,6 +409,10 @@ def get_transactions(start_date,end_date): if rs: r = rs[0] countries.append(r.country) + addresses.append('{street}, {city}, {postal_code}'.format( + street = r.street_address, + city = r.city, + postal_code = r.postal_code)) ownids.append(r.id) usernames.append(r.user.username) @@ -416,6 +421,7 @@ def get_transactions(start_date,end_date): transaction.credit_card_details.country_of_issuance) ownids.append('unknown') usernames.append('unknown') + addresses.append('') emails.append(transaction.customer_details.email) @@ -448,7 +454,8 @@ def get_transactions(start_date,end_date): 'user_id':ownids, 'customer_id':customerids, 'transaction_id':transactionids, - 'subscription_id':subscriptionids + 'subscription_id':subscriptionids, + 'address':addresses } ) diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index d895a3f1ed4fa7cb140386b2b40458189df874ad..4c5a20d0a8820791b4ff5c5c1dc0ec5fa01bccea 100644 GIT binary patch delta 16 XcmaEz_&SkYzMF$XxzJ-H`x65IH>m~! delta 16 XcmaEz_&SkYzMF&Nq`vb;_9q4aI*tZm diff --git a/rowers/views/statements.py b/rowers/views/statements.py index 5dd22c60..b3a0745f 100644 --- a/rowers/views/statements.py +++ b/rowers/views/statements.py @@ -101,7 +101,9 @@ from rowers.models import ( RowerPowerZonesForm,AccountRowerForm,UserForm,StrokeData, Team,TeamForm,TeamInviteForm,TeamInvite,TeamRequest, WorkoutComment,WorkoutCommentForm,RowerExportForm, - CalcAgePerformance,PowerTimeFitnessMetric,PlannedSessionForm, + CalcAgePerformance, + PowerTimeFitnessMetric, + PlannedSessionForm, PlannedSessionFormSmall,GeoCourseEditForm,VirtualRace, VirtualRaceForm,VirtualRaceResultForm,RowerImportExportForm, IndoorVirtualRaceResultForm,IndoorVirtualRaceResult,