dj-payfast

Getting Started

  • INSTALLATION.RST
    • Installation
      • Requirements
      • Installing dj-payfast
        • Using pip (Recommended)
        • Installing from GitHub
        • Installing for Development
      • Verifying Installation
      • Django Configuration
        • 1. Add to INSTALLED_APPS
        • 2. Configure PayFast Settings
        • 3. Include URLs
        • 4. Run Migrations
      • Getting PayFast Credentials
        • Sandbox (Testing)
        • Production
      • Next Steps
  • Quick Start Guide
    • Prerequisites
    • Step 1: Installation
    • Step 2: Add to Django Settings
    • Step 3: Configure PayFast Credentials
    • Step 4: Configure URLs
    • Step 5: Run Migrations
    • Step 6: Create Your First Payment
    • Note: Payment Outcome Templates
    • Step 7: Override Templates
    • Step 8: Add URL Patterns
    • Step 9: Test Your Integration
    • Step 10: Handle Webhooks (Important!)
    • Next Steps
      • Common Next Features
    • Troubleshooting
    • Getting Help
    • Congratulations! 🎉
  • CONFIGURATION.RST
    • Configuration
      • Basic Settings
        • Required Settings
        • Optional Settings
      • Environment Variables
      • Test vs Production Mode
        • Test Mode (Sandbox)
        • Production Mode
      • URL Configuration
      • Custom Configuration
      • Database Configuration
      • Webhook Configuration
      • Security Settings
        • Passphrase
        • IP Validation
        • HTTPS Configuration
      • Logging Configuration
      • Multi-Environment Setup
      • Configuration Checklist
      • Next Steps
  • API Reference
    • Models
      • PayFastPayment
        • payfast.models.PayFastPayment
      • PayFastNotification
        • payfast.models.PayFastNotification
    • Forms
      • PayFastPaymentForm
        • payfast.forms.PayFastPaymentForm
    • Views
      • PayFastNotifyView
        • payfast.views.PayFastNotifyView
    • Utility Functions
      • generate_signature
        • payfast.utils.generate_signature()
      • verify_signature
        • payfast.utils.verify_signature()
      • validate_ip
        • payfast.utils.validate_ip()
    • Configuration
      • Settings
        • PAYFAST_MERCHANT_ID
        • PAYFAST_MERCHANT_KEY
        • PAYFAST_PASSPHRASE
        • PAYFAST_TEST_MODE
      • URLs
        • payfast.urls
    • Admin
      • PayFastPaymentAdmin
        • payfast.admin.PayFastPaymentAdmin
      • PayFastNotificationAdmin
        • payfast.admin.PayFastNotificationAdmin
    • Exceptions
    • Constants
      • Payment Status Choices
        • payfast.models.PayFastPayment.STATUS_CHOICES
      • PayFast URLs
        • payfast.conf.PAYFAST_URL
        • payfast.conf.PAYFAST_VALIDATE_URL
    • Version Information
      • payfast.__version__
    • Type Hints
    • See Also

User Guide

  • Usage Guide
    • Basic Payment Flow
    • Creating Payments
      • Simple Payment
      • Payment with Custom Fields
      • Payment for Guest Checkout
    • Generating Payment Forms
      • Basic Form
      • Form with All Callback URLs
      • Rendering the Form
    • Querying Payments
      • Get User’s Payments
      • Get Payment by ID
      • Calculate Revenue
    • Handling Payment Status
      • Check Payment Status
      • Manual Status Update
    • Using Django Signals
      • Listen for Payment Events
    • Working with Webhooks
      • Understanding ITN Notifications
      • Accessing Notification History
      • Custom Webhook Processing
    • Advanced Use Cases
      • Dynamic Pricing
      • Multiple Items Checkout
      • Refund Tracking
    • Best Practices
    • Next Steps
  • Webhooks Guide
    • Understanding PayFast Webhooks
      • What are Webhooks?
      • Why Webhooks are Important
      • How Webhooks Work
    • Setting Up Webhooks
      • Step 1: Configure Webhook URL
      • Step 2: Add URL to Django
      • Step 3: Configure in PayFast Form
    • Webhook Security
      • 1. IP Address Validation
      • 2. Signature Verification
      • 3. Server-Side Validation
    • Webhook Data Structure
      • Standard Fields
      • Payment Status Values
    • Handling Webhooks
      • Built-in Webhook Handler
      • Custom Webhook Processing
      • Using Django Signals
    • Webhook Debugging
      • Logging Webhooks
      • View in Django Admin
      • Testing Webhooks Locally
    • Common Webhook Issues
      • Issue 1: Webhook Not Receiving Notifications
      • Issue 2: Signature Verification Failing
      • Issue 3: Payment Status Not Updating
      • Issue 4: Duplicate Webhooks
    • Webhook Best Practices
      • 1. Respond Quickly
      • 2. Use Background Tasks
      • 3. Implement Idempotency
      • 4. Log Everything
      • 5. Monitor Webhook Health
    • Production Checklist
    • Next Steps
  • Testing Guide
    • Overview
    • Testing Environments
      • PayFast Sandbox
      • Configuring Test Mode
    • Unit Testing
      • Testing Models
      • Testing Forms
      • Testing Utilities
    • Integration Testing
      • Testing Views
      • Testing Signals
    • Testing Webhooks
      • Mocking PayFast Webhooks
    • Manual Testing
      • Test Card Numbers
      • Testing Payment Flow
    • Testing Checklist
      • Before Production
    • Next Steps

Reference

  • API Reference
    • Models
      • PayFastPayment
        • payfast.models.PayFastPayment
      • PayFastNotification
        • payfast.models.PayFastNotification
    • Forms
      • PayFastPaymentForm
        • payfast.forms.PayFastPaymentForm
    • Views
      • PayFastNotifyView
        • payfast.views.PayFastNotifyView
    • Utility Functions
      • generate_signature
        • payfast.utils.generate_signature()
      • verify_signature
        • payfast.utils.verify_signature()
      • validate_ip
        • payfast.utils.validate_ip()
    • Configuration
      • Settings
        • PAYFAST_MERCHANT_ID
        • PAYFAST_MERCHANT_KEY
        • PAYFAST_PASSPHRASE
        • PAYFAST_TEST_MODE
      • URLs
        • payfast.urls
    • Admin
      • PayFastPaymentAdmin
        • payfast.admin.PayFastPaymentAdmin
      • PayFastNotificationAdmin
        • payfast.admin.PayFastNotificationAdmin
    • Exceptions
    • Constants
      • Payment Status Choices
        • payfast.models.PayFastPayment.STATUS_CHOICES
      • PayFast URLs
        • payfast.conf.PAYFAST_URL
        • payfast.conf.PAYFAST_VALIDATE_URL
    • Version Information
      • payfast.__version__
    • Type Hints
    • See Also

Additional Information

  • Frequently Asked Questions (FAQ)
    • General Questions
      • What is dj-payfast?
      • Is dj-payfast production-ready?
      • What Django versions are supported?
      • What Python versions are supported?
      • Do I need a PayFast account?
    • Installation & Setup
      • How do I install dj-payfast?
      • Do I need to install any other packages?
      • How do I get my PayFast credentials?
    • Payment & Integration
      • Can I use dj-payfast without user authentication?
      • How do I store additional data with payments?
      • Can I customize the checkout page?
      • How do I process different types of payments?
    • Webhooks
      • What is a webhook?
      • Why are webhooks important?
      • How do I set up webhooks?
      • How do I test webhooks locally?
      • Do I need to validate webhooks?
      • How do I add custom logic when payment completes?
    • Security
      • Is dj-payfast secure?
      • Should I use a passphrase?
      • How do I store credentials securely?
      • Is HTTPS required?
    • Testing
      • Can I test without processing real payments?
      • How do I test webhooks?
      • What test data should I use?
    • Pricing & Fees
      • Does dj-payfast cost money?
      • What are PayFast’s fees?
    • Production
      • How do I switch to production?
      • What should I monitor in production?
    • Database
      • What database should I use?
      • Can I store payment data in a separate database?
    • Advanced Features
      • Can I use dj-payfast with Django REST Framework?
      • Can I use dj-payfast with React/Vue/Angular?
      • Does dj-payfast support subscriptions?
      • How do I handle refunds?
    • Support & Community
      • Where can I get help?
      • How do I report bugs?
      • How can I contribute?
    • Common Errors
      • “No module named ‘payfast’”
      • “Invalid signature”
      • “Method Not Allowed” on webhook
      • “Payment not found”
    • Still Have Questions?
    • Next Steps
  • Troubleshooting Guide
    • Quick Diagnosis
    • Installation Issues
      • Issue: pip install fails
      • Issue: Import error after installation
    • Payment Creation Issues
      • Issue: Payment form not displaying
      • Issue: Missing required fields
      • Issue: Duplicate payment_id error
    • Payment Processing Issues
      • Issue: Can’t reach PayFast
      • Issue: Redirect not working
      • Issue: Payment stuck on “Processing”
    • Webhook Issues
      • Issue: Webhook never fires
      • Issue: Webhook returns 403 Forbidden
      • Issue: Webhook timeout
    • Security/Signature Issues
      • Issue: Signature verification failed
      • Issue: IP validation failing
    • Database Issues
      • Issue: Migration errors
      • Issue: Database locked
    • Configuration Issues
      • Issue: Settings not found
      • Issue: Environment variables not loading
    • Template Issues
      • Issue: Template not found
      • Issue: Static files not loading
    • Performance Issues
      • Issue: Slow payment creation
      • Issue: Webhook processing slow
    • Getting Help
    • Next Steps
dj-payfast
  • Search


© Copyright 2025, Carrington Muleya.

Built with Sphinx using a theme provided by Read the Docs.