Download the PHP package tshimologomoeng/payfast-php without Composer

On this page you can find all versions of the php package tshimologomoeng/payfast-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package payfast-php

PayFast PHP Package

Modern PHP package for PayFast payment integration with automatic signature generation and webhook handling.

Features

Installation

Requirements


Table of Contents

  1. Simple Payment Integration
  2. Onsite Payments
  3. Recurring Billing (Subscriptions)
  4. Tokenization
  5. Split Payments
  6. Webhook Handler
  7. Testing

Simple Payment Integration

Redirect users to PayFast's payment page.

or you can send the data to your frontend and directed them from there.

Onsite Payments

Embed PayFast's payment form directly on your checkout page.

Important: Requires HTTPS for security.

PHP Setup

For complete JavaScript implementation, see PayFast Onsite Documentation.


Recurring Billing (Subscriptions)

Set up automatic recurring payments.

Important: Passphrase is required for subscriptions.

Subscription Frequencies

Free Trial

Set initial amount to R0.00 for a free trial period:


Tokenization

Save customer payment details for future ad-hoc charges.

Update Card Details

Generate a link for customers to update their saved card:


Split Payments

Instantly split payments with a third party merchant.

Note: Must be enabled on your PayFast account.

Calculation Examples:


Webhook Handler

Simple Payment Webhook

Subscription Webhook

Webhook Security

The webhook handler performs these security checks:

  1. ✅ Signature verification - Ensures data wasn't tampered with
  2. ✅ IP validation - Confirms request is from PayFast servers
  3. ✅ Amount validation - Verifies payment amount matches expected
  4. ✅ Server confirmation - Validates with PayFast's servers

Available Payment Methods

You can force a specific payment method using the PaymentMethod enum:

Available options:


Testing

Running Tests

Or add to composer.json:

Then run:

PayFast Sandbox Credentials

For testing, use PayFast's sandbox credentials:

Test Card Details

Use these test cards in sandbox mode:


Configuration

Sandbox vs Production

Using Passphrase (Recommended)

For added security, set a passphrase in your PayFast dashboard and include it:

Note: Passphrase is required for subscriptions and tokenization.


Error Handling


API Reference

PayfastSimpleIntegration

Constructor

Methods

set_customer_details()

set_transaction_details()

get_payment_url()


Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature-name)
  3. Commit your changes (git commit -m 'your-message (informative)')
  4. Push to the branch (git push origin feature/your-feature-name)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details


Support

-name


Changelog

2.0.0 (Current)

1.0.2

1.0.0


Note: This is an unofficial package and is not affiliated with PayFast. Always refer to the official PayFast documentation for the latest API specifications.


All versions of payfast-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tshimologomoeng/payfast-php contains the following files

Loading the files please wait ...