1. Go to this page and download the library: Download sargilla/firstdata 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/ */
sargilla / firstdata example snippets
Firstdata::getDateTime() // It returns formated datetime
Firstdata::createExtendedHash($totalcharge,$currency,$invoiceNumber)
namespace App\Http\Controllers\Payments;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
class FirstDataController {
public function success()
{
// PROCESS SUCCESS AND REDIRECT
Log::notice('OPERATION SUCCESS');
Log::info(request()->all());
dd(request()->all());
}
public function failure()
{
// PROCESS FAILURE AND REDIRECT
Log::notice('OPERATION FAILED');
Log::info(request()->all());
dd(request()->all());
}
public function notification()
{
// PROCESS NOTIFICATION
Log::notice('OPERATION NOTIFICATION');
Log::info(request()->all());
dd(request()->all());
}
}
php artisan vendor:publish --tag=firstdata
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.