<?php
    require_once("../../../autoloader.php");
    header('Access-Control-Allow-Origin: *');
    header('Content-Type: application/json');
    header("Access-Control-Allow-Methods: POST");
    header("Allow: POST, OPTIONS, PUT, DELETE");
    header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Origin");

    $headers = apache_request_headers();
    $response = array();
    $controller = new SubscriberModel;
   
    date_default_timezone_set('Africa/Lagos');
          

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
 
 
 
     
        
    $userId = $_POST['user_id'];

 $result = $controller->getAirtimeBeneficiary($userId);
// $result = json_decode($result);
 file_put_contents("airtime_fail_log.txt",json_encode($result))
        ;
  $response = array('status' => true,
       'wallet' => "i", 'notif' => $result->message );
       file_put_contents("airtime_i.txt", $result->message);
       echo json_encode($result);
 
}

?>