⚠️
Disclaimer:

This is an unofficial PayFast API Payment Gateway. This repository is only created to help developers in streamlining the integration process. You can review the Official Payment Gateway documentation here.

`ESC`
{{ result.title }}
{{ result.snippet }}
🔍
No results found
Try different keywords
⌨️
Start typing to search
Search across all documentation

# PayFast
Seamless Integration!

A comprehensive Laravel package for PayFast payment gateway processing

💳

### Direct Checkout

PCI DSS compliant payment processing with 3DS authentication for secure card payments.

🌐

### Hosted Checkout

Redirect-based payment processing that handles sensitive card data securely on PayFast servers.

📱

### Mobile Wallets

Support for EasyPaisa, UPaisa, and JazzCash mobile wallet payments with OTP verification.

🔔

### IPN Support

Instant Payment Notification webhook handling for automatic payment status updates.

⚡

### Event System

Event-driven architecture with listeners for payment events, activity logging, and email notifications.

🔄

### Subscriptions

Recurring billing support for monthly, yearly or custom intervals with automated iteration management.

🔒

### Secure & Reliable

Comprehensive security features, activity logging, and robust error handling for production use.

## Quick Start

    # Install via Composer
    composer require zfhassaan/payfast

    # Publish configuration
    php artisan vendor:publish --tag=payfast-config

    # Publish migrations
    php artisan vendor:publish --tag=payfast-migrations
    php artisan migrate

    # Add to .env
    PAYFAST_API_URL=https://api.payfast.com
    PAYFAST_SANDBOX_URL=https://sandbox.payfast.com
    PAYFAST_MERCHANT_ID=your_merchant_id
    PAYFAST_SECURED_KEY=your_secured_key
    PAYFAST_MODE=sandbox
    PAYFAST_RETURN_URL=https://yourdomain.com/payment/callback

    use zfhassaan\Payfast\Facades\PayFast;

    // Get authentication token
    $response = PayFast::getToken();

    // Process card payment
    $paymentData = [
        'orderNumber' => 'ORD-12345',
        'transactionAmount' => 1000.00,
        'customerMobileNo' => '03001234567',
        'customer_email' => 'customer@example.com',
        'cardNumber' => '4111111111111111',
        'expiry_month' => '12',
        'expiry_year' => '2025',
        'cvv' => '123',
    ];

    $response = PayFast::getOTPScreen($paymentData);

## Contributors

Thanks to all the amazing people who have contributed to this project!

@{{ contributor.login }}
{{ contributor.location }}
View All Contributors

## GitHub Issues

Track and view all issues, bug reports, and feature requests from the GitHub repository.

{{ issue.state === 'open' ? 'Open' : 'Closed' }}
#{{ issue.number }} {{ formatDate(issue.updated_at) }}

### {{ issue.title }}

{{ issue.body.substring(0, 150) }}{{ issue.body.length > 150 ? '...' : '' }}
{{ label.name }}
🎉
No issues found

Great job! There are currently no open or closed issues.

Create New Issue