Skip to content

Commit

Permalink
And fix them again
Browse files Browse the repository at this point in the history
  • Loading branch information
PSzczepanski1996 committed Jan 22, 2024
1 parent ffa9bf1 commit 45afb4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions tpay_module/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test APIs file."""
import inspect
# Standard Library
import random
from datetime import datetime
Expand Down Expand Up @@ -34,6 +35,8 @@ class NopeStringObject(object):
"""Nope string object."""

def __str__(self): # noqa: D102
if inspect.isclass(self):
return
raise NotImplementedError('You shall not pass!')

self.nope_string_class = NopeStringObject
Expand Down
14 changes: 9 additions & 5 deletions tpay_module/tpay_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@ def pay_by_saved_card(self, transaction_id, card_token):

def get_transaction(self, transaction_id):
"""Get certain transaction via transactionId field."""
response_data = requests.get(
f'{self.api_url}/transactions/{transaction_id}',
json={}, headers=self.get_headers(),
).json()
return response_data
try:
response_data = requests.get(
f'{self.api_url}/transactions/{transaction_id}',
json={}, headers=self.get_headers(),
).json()
return response_data
except BaseException:
pass
return {}

def get_all_transactions(self, limit=None, from_dt=None, to_dt=None):
"""FOR NOW dummy method to get list of all transactions."""
Expand Down

0 comments on commit 45afb4f

Please sign in to comment.