PHP code example of farzai / truemoney-webhook

1. Go to this page and download the library: Download farzai/truemoney-webhook 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/ */

    

farzai / truemoney-webhook example snippets


use Farzai\TruemoneyWebhook\Postman;

// New instance
$postman = new Postman([
   'secret' => 'your-secret-key',
]);

// Capture all data from incoming request
$data = $postman->capture();

// You can use $data to do anything you want.
// For example, you can get the data as Array
// @returned
// [
//    'event_type' => 'P2P',
//    'received_time' => '2022-01-31T13:02:23+0700',
//    'amount' => 100,
//    'sender_mobile' => '0988882222',
//    'message' => 'ค่าไอเทม',
//    'lat' => 1653538793,
// ]
$data->asArray();

$data->event_type; // string
$data->amount; // int
$data->sender_mobile; // string
$data->message; // string
$data->lat; // int