<?php
ini_set("include_path", '/home/africawebstudent/php:' . ini_get("include_path") );

require_once 'HTTP/Request2.php'; // Only when installed with PEAR

require_once '/home/africawebstudent/public_html/gs/progicielgeststudent/uuid/vendor/autoload.php';

use Ramsey\Uuid\Uuid;

include_once('PayementLibrary/getaccesstoken.php');

include_once('PayementLibrary/requestepayement.php');

$amount = 10;

$currency = 'XOF';

$externalId = time();

$partyId = '22996329890';

$accesstoken = access_token();

$uuid = Uuid::uuid4();

$response = callRequestpayment($amount, $currency, $externalId, $partyId, $accesstoken, $uuid);

$resultats = array(
        "statusCode" => $response->getStatus(),
        "response" => array(
        "externalId" => $externalId,
        'xreferenceId' => $uuid,
        "amount" => $amount,
        "currency" => $currency,
        "payer" => array(
        "partyIdType" => "MSISDN",
        "partyId" => $partyId
        ),
        "payerMessage" => "GestStudent Finance",
        "payeeNote" => "GestStudent Finance",
        "status" => $response->getReasonPhrase(),
        "effectiveUrl" => $response->getEffectiveUrl(),
        "body" => $response->getBody(),
        "token" =>  $accesstoken
    )
);

//print_r(json_encode($resultats) );

$res = getRequestpaymentstatus($accesstoken, $uuid);
//$res = json_decode($res, TRUE);
//$res = json_decode("$res");
//print_r($res->financialTransactionId);
print_r($res);
?>