I am using php not laravel and I have did composer and written all the required code in your documentation. But the problem is I am getting an Uncaught Error: Class “Paypack\Paypack” not found. Here is the entire code:
<?php
use Paypack\Paypack;
$paypack = new Paypack();
$paypack->config([
'client_id' => ' CLIENT ID',
'client_secret' => 'CLIENT SECRET',
]);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$phone_number = $_POST['phone-number'];
$amount = $_POST['amount'];
$cashin = $paypack->Cashin([
'phone-number' => $phone_number,
'amount' => $amount,
]);
// Handle the result of the payment
print_r($cashin);
}
?>
If you have installed the Paypack library using Composer, you need to include the vendor/autoload.php file in your PHP script.
For Example:
require_once __DIR__ . '/vendor/autoload.php';
Make sure that the path to the autoload.php file is correct relative to your PHP script. Once the autoloader is included, you should be able to instantiate the Paypack class and use its methods.
Warning : Attempt to read property “access” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 141
Warning : Attempt to read property “refresh” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 142
Warning : Attempt to read property “access” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 141
Warning : Attempt to read property “refresh” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 142
Warning : Attempt to read property “access” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 141
Warning : Attempt to read property “refresh” on null in C:\xampp\htdocs\H\vendor\quarksgroup\paypack-php\src\Util\HttpClient.php on line 142
Array ( [message] => api: requires write rights for this action ) PLEASE HEKP ME