PHP code example of fergusdixon / payfast-sdk-php

1. Go to this page and download the library: Download fergusdixon/payfast-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fergusdixon / payfast-sdk-php example snippets


$config = [
    'merchantId' => 'testId',               // Required
    'passPhrase' => 'testPhrase',           // Required
    'endpoint' => '//api.payfast.co.za',
    'port' => 443,
    'ssl' => true,
    'testing' => false,
];

$payfast = new PayFastSDK($config);

$verb = 'GET';
$method = '/history';
$options = [
    'from' => '2018-02-01',
    'to' => '2018-03-04',
];
$response = $payfast->request->customRequest($verb, $method, $options)