<?php 
    session_start();
    require_once '/opt/cpanel/ea-php72/root/usr/share/pear/HTTP/Request2.php';
    $uuid = 'fd4fd33f-0790-4f9e-81f4-e16ad3bfe4d0';
    $request = new Http_Request2('https://proxy.momoapi.mtn.com/collection/v1_0/requesttopay/'.$uuid.'');
    $url = $request->getUrl();
    
    $headers2 = array(
        // Request headers
        'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSMjU2In0.eyJjbGllbnRJZCI6IjA3NmI3MjcwLWEzYmEtNDgwMC05YmI3LTJlZjk3NzZlMzY5ZiIsImV4cGlyZXMiOiIyMDIxLTA2LTEyVDE3OjAwOjIxLjUyNSIsInNlc3Npb25JZCI6IjhiZmExNjFmLThiNDgtNGZkMi1iZTM2LTI1OTRlYjU2ZWRmMSJ9.ckw4aCGEIMPcB9Or7VLKlaYZuwtHM-sH5SzDp0MVADqXjsoxQn2Qk0IPpIxTNOS9BUzidjIk3Men3iUs_vd5SsjVA0aYupID6DRwodQ9cjKaNvr91ZtKbaUvf1xBA8pCz_Vx8r_rBjcPBTe8fsXYBGZTGpCffZjNHdMcSEEfSsrFmuDB0JgPaeAlC6D9kb_eJCQyvu-9AEAn5xEals8yiAYSHANAQWaoOVdiy16Qa8KtTiUqXmChjMKOaqHz_pNS-RwxX0Ustv4u_E8yoMD7IB1LkesMmQ8xY3kTubVyNJMdBbAGkjOPvzES9IqRskLiH4LmOAqoSbdv6mhwdDgSew',
        'X-Target-Environment' => 'mtnbenin',
        'Ocp-Apim-Subscription-Key' => 'b4cfab4d10ac4416921694591c061a76'
    );
    
    $request->setHeader($headers2);
    
    $parameters = array(
        //'referenceId' => "$uuid"
    );
    
    $url->setQueryVariables($parameters);
    
    $request->setMethod(HTTP_Request2::METHOD_GET);
    
    // Request body
    $request->setBody("");
    
    try {
        $response = $request->send();
        print_r($response->getBody());
    } catch (HttpException $ex) {
        echo $ex;
    }
?>
