Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 6ab554d

Browse files
Merge pull request #9 from WilliamOtieno/develop
Develop
2 parents feb5b59 + 7e75ab8 commit 6ab554d

File tree

13 files changed

+336
-130
lines changed

13 files changed

+336
-130
lines changed

.DS_Store

6 KB
Binary file not shown.

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

python_flutterwave/charge/bank.py

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from python_flutterwave.decorators import handle_api_exceptions
66

77

8-
token = os.environ.get("SECRET_KEY")
8+
token = os.environ.get("FW_SECRET_KEY")
99
base_url = "https://api.flutterwave.com/v3/charges"
1010

1111

@@ -17,10 +17,14 @@ def initiate_bank_charge(
1717
) -> dict:
1818
"""
1919
Collect payments from your customers via bank transfers
20-
:param tx_ref: str
21-
:param amount: int
22-
:param email: str
23-
:return: dict
20+
21+
Args:
22+
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
23+
amount (int): This is the amount to be charged for the transaction.
24+
email (str): The customer's email address.
25+
26+
Returns:
27+
dict: Response Details
2428
"""
2529

2630
params = {"type": "bank_transfer"}
@@ -46,10 +50,14 @@ def initiate_nigeria_bank_charge(
4650
) -> dict:
4751
"""
4852
Charge Nigerian bank accounts using Flutterwave
49-
:param tx_ref: str
50-
:param amount: int
51-
:param email: str
52-
:return: dict
53+
54+
Args:
55+
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
56+
amount (int): This is the amount to be charged for the transaction.
57+
email (str): The customer's email address.
58+
59+
Returns:
60+
dict: Response Details
5361
"""
5462

5563
params = {"type": "mono"}
@@ -73,12 +81,16 @@ def initiate_uk_eu_bank_charge(
7381
) -> dict:
7482
"""
7583
Charge Customers UK and EU bank accounts
76-
:param tx_ref: str
77-
:param amount: int
78-
:param email: str
79-
:param phone_number: str
80-
:param is_token_io: int
81-
:return: dict
84+
85+
Args:
86+
tx_ref (int): Unique reference peculiar to the transaction.
87+
amount (int): Amount to be charged for the transaction.
88+
email (str): The customer's email address.
89+
phone_number (str): Phone number linked to the customer's bank account or mobile money account
90+
is_token_io (int):
91+
92+
Returns:
93+
dict: Response Details
8294
"""
8395

8496
params = {"type": "account-ach-uk"}
@@ -108,12 +120,16 @@ def initiate_ach_bank_charge(
108120
) -> dict:
109121
"""
110122
Collect ACH payments for USD and ZAR transactions
111-
:param tx_ref: str
112-
:param amount: int
113-
:param email: str
114-
:param phone_number: str
115-
:param currency: str
116-
:return: dict
123+
124+
Args:
125+
tx_ref (int): Unique reference peculiar to the transaction.
126+
amount (int): Amount to be charged for the transaction.
127+
email (str): The customer's email address.
128+
phone_number (str): Phone number linked to the customer's bank account or mobile money account
129+
currency (str): Currency to charge in. Expected values are ZAR for ZA ACH and USD for US ACH.
130+
131+
Returns:
132+
dict: Response Details
117133
"""
118134

119135
params = {"type": "account-ach-uk"}

python_flutterwave/charge/card.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from python_flutterwave.decorators import handle_api_exceptions
66

77

8-
token = os.environ.get("SECRET_KEY")
8+
token = os.environ.get("FW_SECRET_KEY")
99
base_url = "https://api.flutterwave.com/v3/charges"
1010

1111

@@ -21,14 +21,18 @@ def initiate_card_charge(
2121
) -> dict:
2222
"""
2323
This is used to initiate card payments.
24-
:param tx_ref: str
25-
:param amount: int
26-
:param card_number: int
27-
:param cvv: int
28-
:param expiry_month: int
29-
:param expiry_year: int
30-
:param email: str
31-
:return: dict
24+
25+
Args:
26+
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
27+
amount (int): This is the amount to be charged for the transaction.
28+
email (str): The customer's email address.
29+
card_number (int): The customer's card.
30+
cvv (int): Card CVV.
31+
expiry_month (int): Card expiry month
32+
expiry_year (int): Card expiry year
33+
34+
Returns:
35+
dict: Response Details
3236
"""
3337

3438
params = {"type": "card"}

0 commit comments

Comments
 (0)