From fb455808494d4efbdd1dbb098d7836fd0601b44e Mon Sep 17 00:00:00 2001 From: Strapchay Date: Sat, 13 Apr 2024 17:43:25 -0400 Subject: [PATCH] added optional args to transactions list method --- paystackapi/transaction.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/paystackapi/transaction.py b/paystackapi/transaction.py index 9a051b5..a757df8 100644 --- a/paystackapi/transaction.py +++ b/paystackapi/transaction.py @@ -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):