Skip to content

Use the paystack api to implement a payment interface into a website

Notifications You must be signed in to change notification settings

Gahdloot/payment-intergration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Integrator

A Django app for integrating payments with multiple gateways. Currently supports integration with [Gateway 1] and [Gateway 2].

Features

  • Easy integration with multiple payment gateways
  • Automated payment status tracking
  • Customizable payment form
  • Support for multiple currencies

Installation

Install the package using pip:

pip install django-payment-integrator

Add payment_integrator to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    'payment_integrator',
]

Run the migrations to create the necessary database tables:

python manage.py migrate

Configuration

To configure the payment integrator, add the following to your settings.py:

PAYMENT_INTEGRATOR = {
    'GATEWAY_1': {
        'API_KEY': '[api_key]',
        'API_SECRET': '[api_secret]',
    },
    'GATEWAY_2': {
        'API_KEY': '[api_key]',
        'API_SECRET': '[api_secret]',
    },
}

Usage

To use the payment integrator, you will need to create a payment form and process the payment using the provided functions.

from payment_integrator.forms import PaymentForm
from payment_integrator.utils import process_payment

# Create the payment form
form = PaymentForm(request.POST or None)

if form.is_valid():
    # Process the payment
    result = process_payment(form.cleaned_data, gateway='GATEWAY_1')

    if result['status'] == 'success':
        # Payment successful
    else:
        # Payment failed

For more information on the available functions and options, see the documentation.

Documentation

For full documentation, see https://django-payment-integrator.readthedocs.io/.

About

Use the paystack api to implement a payment interface into a website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published