I am currently using laravel sdk for cashin. and it works
$paypackInstance = new \Paypack\Paypack(); $paypackInstance->config([ 'client_id' => env('PAYPACK_CLIENT_ID'), 'client_secret' => env('PAYPACK_CLIENT_SECRET') ]); return $paypackInstance->Cashin([ 'phone' => "0780331198", 'amount' => "100"]);
I went through webhooks documentation here but i couldn;t get it done well.
This is sample codes of what i was trying
<?php include 'db.php'; // Takes raw data from the request $json = file_get_contents('php://input'); $data = json_decode($json,TRUE); echo $data['status']; $q = mysqli_query($conn,"INSERT INTO `test` (`id`, `data`) VALUES (NULL, '$data[status]')");
Here i wanteed to save the status in the db for testing, and it is not working.
I used ngrok to generate the link and added it into webhook in my dashboard .
Kindly help, or if there are some sample codes for callback using php, please share