Download the PHP package visual-host/payfast without Composer

On this page you can find all versions of the php package visual-host/payfast. 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

Laravel 6 Payfast

A dead simple Laravel 6 payment processing class for payments through payfast.co.za. This package only supports ITN transactions.

Forked from io-digital/payfast.

This repo adds missing verification steps that are required.

Still in development.

Installation

Add Laravel 6 Payfast to your composer.json

composer require visual-host/payfast

Add the PayfastServiceProvider to your providers array in config/app.php

In your .env add the following keys:

IMPORTANT: In order to work with the ITN callback reliably, it's suggested to make use of ngrok. That would make your config/payfast.php file url's look like:

Config

publish default configuration file.

php artisan vendor:publish

IMPORTANT: You will need to edit App\Http\Middleware\VerifyCsrfToken by adding the route, which handles the ITN response to the $except array. Validation is done via the ITN response.

Usage

Creating a payment returns an html form ready to POST to payfast. When the customer submits the form they will be redirected to payfast to complete payment. Upon successful payment the customer will be returned to the specified 'return_url' and in the case of a cancellation they will be returned to the specified 'cancel_url'

ITN Responses

Payfast will send a POST request to notify the merchant (You) with a status on the transaction. This will allow you to update your order status based on the appropriate status sent back from Payfast. You are not forced to use the key 'm_payment_id' to store your merchant reference but this is the the key that will be returned back to you from Payfast for further verification.

The response variables POSTED back by payfast may be accessed as follows:

Variables Returned by Payfast

Amounts

In the case of an integer, the cart total must be passed through in cents, as follows:

Payment Form

By default the getPaymentForm() method will return a compiled HTML form including a submit button. There are 3 configurations available for the submit button.

To Do's

  1. Unit Testing
  2. Add in a Facade Class
  3. Allow for custom integers/strings
  4. Curl request to Payfast (validation) -> needs more testing

All versions of payfast with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^6.0.2
illuminate/http Version ^6.0.2
moneyphp/money Version ^3.2
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 visual-host/payfast contains the following files

Loading the files please wait ....