diff --git a/docs/miscellaneous.md b/docs/miscellaneous.md index 4a52321..3962924 100644 --- a/docs/miscellaneous.md +++ b/docs/miscellaneous.md @@ -8,6 +8,19 @@ Miscellaneous from paystackapi.misc import Misc response = Misc.list_banks() ``` + +Or with keyword args - the args are query params on the Paystack API. + +```python + from paystackapi.misc import Misc + response = Misc.list_banks(country="ghana", currency="NGN") +``` +*Optional Arguments* + +- `country`: Country to return its banks +- `currency`: Currency +- `gateway`: Gateway type of banks + *Returns* JSON data from paystack API. diff --git a/paystackapi/misc.py b/paystackapi/misc.py index f00956f..1779002 100644 --- a/paystackapi/misc.py +++ b/paystackapi/misc.py @@ -6,11 +6,20 @@ class Misc(PayStackBase): @classmethod - def list_banks(cls): - """Static method defined to list banks. + def list_banks(cls, **kwargs): + """ + Static method defined to list banks. + Args: - No argument required. + No argument is required. + + country (str): The country from which to obtain the list of supported banks. e.g country=ghana or country=nigeria + + gateway (str): The gateway type of the bank. It can be one of these: [emandate, digitalbankmandate] + + currency (str): Any of NGN, USD, GHS or ZAR + Returns: Json data from paystack API. """ - return cls().requests.get('bank') + return cls().requests.get('bank', qs=kwargs)