<?php 

function getSecrets(){
    $servername = "directoriofitness.com.mx";
    $db = "direct18_ProGymCloud";
    $username = "direct18";
    $password = "L4LL4v3M@3str@";
    $conn = new mysqli($servername,$username,$password, $db);
    mysqli_set_charset($conn, 'utf8');
    
    //Realizamos la consulta
    $consulta = "SELECT * FROM `info_openpay` WHERE gimnasio_idGimnasio = 87 AND sucursal_idSucursal ='1' ";
	$result = mysqli_query($conn, $consulta);

    $respuesta = 0;
	//Verificamos si se realiza la consulta.
	if ($result) {
    	$longitud = mysqli_num_rows($result);
    	
    	//Se verifica si hay registros en la consulta
    	if($longitud > 0){
    	    $data = array();
        	while($row = mysqli_fetch_assoc($result)){
        		$data[] = $row;
        	}
            $secrets;
        	$secrets->idOpenpay = $data[0]["openpay_id"];
            $secrets->skOpenpay = $data[0]["private_key"];
            $secrets->pkOpenpay = $data[0]["public_key"];

            echo $secrets;
    	}else{
            echo false;
    	}
    }else{
        echo false;
    }
}

?>