Skip to content

Commit

Permalink
Merge pull request #93 from Strapchay/master
Browse files Browse the repository at this point in the history
added optional args to transactions list method
  • Loading branch information
andela-sjames authored Jul 24, 2024
2 parents 1dbb8f3 + fb45580 commit 3b6e806
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions paystackapi/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,22 @@ def get(cls, transaction_id):
return cls().requests.get(f"transaction/{transaction_id}")

@classmethod
def list(cls):
def list(cls, **kwargs):
"""
List transactions.
Args:
No argument required.
optional:
customer_id: When used as a param, returns the transactions related to the customer
customer_email: When used as a param, does not return transactions related to the customer
perPage: Specify how many records you want to retrieve per page.
If not specify we use a default value of 50. (Integer)
Returns:
Json data from paystack API.
"""
return cls().requests.get('transaction')
return cls().requests.get('transaction', qs=kwargs,)

@classmethod
def totals(cls):
Expand Down

0 comments on commit 3b6e806

Please sign in to comment.