Skip to content

Commit

Permalink
Merge pull request #9 from WilliamOtieno/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
WilliamOtieno authored Dec 31, 2023
2 parents feb5b59 + 7e75ab8 commit 6ab554d
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 130 deletions.
Binary file added .DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
58 changes: 37 additions & 21 deletions python_flutterwave/charge/bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from python_flutterwave.decorators import handle_api_exceptions


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


Expand All @@ -17,10 +17,14 @@ def initiate_bank_charge(
) -> dict:
"""
Collect payments from your customers via bank transfers
:param tx_ref: str
:param amount: int
:param email: str
:return: dict
Args:
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
amount (int): This is the amount to be charged for the transaction.
email (str): The customer's email address.
Returns:
dict: Response Details
"""

params = {"type": "bank_transfer"}
Expand All @@ -46,10 +50,14 @@ def initiate_nigeria_bank_charge(
) -> dict:
"""
Charge Nigerian bank accounts using Flutterwave
:param tx_ref: str
:param amount: int
:param email: str
:return: dict
Args:
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
amount (int): This is the amount to be charged for the transaction.
email (str): The customer's email address.
Returns:
dict: Response Details
"""

params = {"type": "mono"}
Expand All @@ -73,12 +81,16 @@ def initiate_uk_eu_bank_charge(
) -> dict:
"""
Charge Customers UK and EU bank accounts
:param tx_ref: str
:param amount: int
:param email: str
:param phone_number: str
:param is_token_io: int
:return: dict
Args:
tx_ref (int): Unique reference peculiar to the transaction.
amount (int): Amount to be charged for the transaction.
email (str): The customer's email address.
phone_number (str): Phone number linked to the customer's bank account or mobile money account
is_token_io (int):
Returns:
dict: Response Details
"""

params = {"type": "account-ach-uk"}
Expand Down Expand Up @@ -108,12 +120,16 @@ def initiate_ach_bank_charge(
) -> dict:
"""
Collect ACH payments for USD and ZAR transactions
:param tx_ref: str
:param amount: int
:param email: str
:param phone_number: str
:param currency: str
:return: dict
Args:
tx_ref (int): Unique reference peculiar to the transaction.
amount (int): Amount to be charged for the transaction.
email (str): The customer's email address.
phone_number (str): Phone number linked to the customer's bank account or mobile money account
currency (str): Currency to charge in. Expected values are ZAR for ZA ACH and USD for US ACH.
Returns:
dict: Response Details
"""

params = {"type": "account-ach-uk"}
Expand Down
22 changes: 13 additions & 9 deletions python_flutterwave/charge/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from python_flutterwave.decorators import handle_api_exceptions


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


Expand All @@ -21,14 +21,18 @@ def initiate_card_charge(
) -> dict:
"""
This is used to initiate card payments.
:param tx_ref: str
:param amount: int
:param card_number: int
:param cvv: int
:param expiry_month: int
:param expiry_year: int
:param email: str
:return: dict
Args:
tx_ref (int): This is a unique reference peculiar to the transaction being carried out.
amount (int): This is the amount to be charged for the transaction.
email (str): The customer's email address.
card_number (int): The customer's card.
cvv (int): Card CVV.
expiry_month (int): Card expiry month
expiry_year (int): Card expiry year
Returns:
dict: Response Details
"""

params = {"type": "card"}
Expand Down
Loading

0 comments on commit 6ab554d

Please sign in to comment.