Skip to content

Commit c71605c

Browse files
authored
Merge pull request #3 from overcastsoftware/refund-payment-function-for-client
Add refund payment function to the client
2 parents 3d39c1d + b066978 commit c71605c

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

askell/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def import_payment_method(self, user, payment_method_data):
121121
response = requests.post(self._build_url(path), headers=self._auth, json=data)
122122

123123
return response.json()
124-
124+
125+
def refund_payment(self, uuid):
126+
path = '/payments/{}/refund/'.format(uuid)
127+
response = requests.post(self._build_url(path), headers=self._auth, json={})
128+
return response.json()
125129

126130
client = AskellClient(ASKELL_SECRET_KEY, endpoint=ASKELL_ENDPOINT)

askell/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,5 @@ def post(self, request):
247247
else:
248248
return Response({'status': 'error', 'message': response['error']}, status=r.status_code)
249249

250-
except Exception as e:
250+
except Exception:
251251
return Response({'status': 'error', 'message': _('Server error. Please try again later.')}, status=r.status_code)

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ services:
1818
ports:
1919
- "8001:8001"
2020
- 3001:3001
21+
env_file:
22+
- .env
2123
environment:
2224
DATABASE_URL: "postgres://test_project:changeme@db/test_project"
2325
PYTHONPATH: "/code/test_project:$PYTHONPATH"

0 commit comments

Comments
 (0)