Download the PHP package sharifur/payfast without Composer
On this page you can find all versions of the php package sharifur/payfast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package payfast
Laravel Payfast
A dead simple Laravel payment processing class for payments through payfast.co.za. This package only supports ITN transactions. Laravel Payfast is strictly use at own risk.
important notice
this is a focked version of billowapp/payfast
package, this package is not update for long with so i have create a fork and give support to laravel 9 and publish it in packagist so that i can use it in my private packages.
all credit to main author "Warren Hansen".
Installation
Add Laravel Payfast to your composer.json
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 $excepted 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'
NOTE
If you want to use subscripions, make sure to set your merchant's passphrase in the config file for this package. It is required for subscriptions.
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
The cart total may be set in 2 ways, as a string value:
Or as an Integer. In the case of an integer, the cart total must be passed through in cents, as follows:
Payment Form
By default the paymentForm() method will return a compiled HTML form including a submit button. There are 3 configurations available for the submit button.