Skip to content

Commit e841fdc

Browse files
Merge pull request #94 from andela-sjames/develop
Update docs and test
2 parents 0be092e + 7257fef commit e841fdc

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

docs/transactions.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## Transactions
2+
`https://paystack.com/docs/api/transaction/`
3+
24

35
##### `Transaction.initialize(reference, amount, email, plan)` - Initialize a transaction.
46

@@ -77,16 +79,18 @@ response = Transaction.get(transaction_id=23)
7779

7880
JSON data from paystack API.
7981

80-
##### `Transaction.list()` - List transactions.
82+
##### `Transaction.list(**kwargs)` - List transactions.
8183

8284
```python
8385
from paystackapi.transaction import Transaction
84-
response = Transaction.list()
86+
response = Transaction.list(perPage=3,page=1)
8587
```
8688

87-
*Arguments*
89+
*Arguments*
8890

89-
No argument required.
91+
- `customer`: Specify an ID for the customer whose transactions you want to retrieve (optional)
92+
- `status`: Filter transactions by status ('failed', 'success', 'abandoned') (optional)
93+
- ...
9094

9195
*Returns*
9296

paystackapi/tests/test_transaction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def test_list(self):
7777
status=201,
7878
)
7979

80-
response = Transaction.list()
80+
response = Transaction.list(
81+
perPage=3,
82+
page=1
83+
)
8184
self.assertTrue(response['status'])
8285

8386
@httpretty.activate

paystackapi/transaction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ def list(cls, **kwargs):
7777
Args:
7878
No argument required.
7979
optional:
80-
customer_id: When used as a param, returns the transactions related to the customer
81-
customer_email: When used as a param, does not return transactions related to the customer
80+
customer: When used as a param, returns the transactions related to the customer
81+
status: Filter transactions by status ('failed', 'success', 'abandoned')
8282
perPage: Specify how many records you want to retrieve per page.
8383
If not specify we use a default value of 50. (Integer)
84+
page: Specify exactly what page you want to retrieve.
85+
If not specify we use a default value of 1. (Integer)
8486
8587
Returns:
8688
Json data from paystack API.

0 commit comments

Comments
 (0)