All platform transactions are carried out through Atomic Transfer involving the various stakeholders.
//Transaction 1 : payment to platform
$transactions = array();
$transactions[] = array(
"txn" => array(
"aamt" => $platformFee,
"type" => "axfer", //Tx Type
"fee" => 1000, //Fee
..............................
//Transaction 2 : payment to hotspot owner
$transactions[] = array(
"txn" => array(
"aamt" => $hotspotFee,
"type" => "axfer", //Tx Type
"fee" => 1000, //Fee
..............................
//Transaction 3 : payment to reserve address
$transactions[] = array(
"txn" => array(
"aamt" => $reserveFee,
"type" => "axfer", //Tx Type
"fee" => 1000, //Fee
...............................
// 2) Group TRansactions
$groupid = $algorand_kmd->groupid($transactions);
#Assigns Group ID
$transactions[0]['txn']['grp'] = $groupid;
$transactions[1]['txn']['grp'] = $groupid;
$transactions[2]['txn']['grp'] = $groupid;
................................
//4) Send Transaction Group
#Broadcasts a raw atomic transaction to the network.
$params['transaction'] = $txn;
$return = $algorand->post("v2", "transactions", $params);
$txId = $return['response']->txId;
................................