django-fac
is a python package that helps to simplify the integration with First Atlantic Commerce payment gateway.
PyPi Package: https://pypi.org/project/django-fac/
Detailed documentation is in the "docs" directory.
- First we need to install the
django-fac
:
pip install django-fac
- Add
django_fac
to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'django_fac',
]
- Setting up the package config variables. It is recommemded to store the values in environment variables. Add the following variables to your
settings.py
file
FAC_ID = "..."
FAC_PASSWORD = "..."
FAC_DEFAULT_CURRENCY = "..."
FAC_BASE_URL = "https://..."
This is an example of how the authorization process works
from django_fac.core import payment
from django_fac.entities import TransactionDetail, CardDetail
transaction_detail = TransactionDetail(
order_id="1234567",
amount=2000
)
card_detail = CardDetail(
card_number="0000-0000-0000-000",
cvv2="123",
exp_date="09/28", # MM/YY
cardholder_name="John Doe"
)
# This URL will receive the status of the transaction after authorization
redirect_url = "https://your-domain.com/webhook/payment"
response = payment.authorize(transaction_detail, card_detail, redirect_url)
# TODO: add remaining logic
....
If you are interested in contributing to the project then the following instructions will apply to you.