⚠️
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.

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

PayFast Payment Gateway
Seamless Integration!

A comprehensive Laravel package for PayFast payment processing

PayFast Payment Gateway
💳

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!