PHP code example of apihub-cdc / rcc-simulacion-client
1. Go to this page and download the library: Download apihub-cdc/rcc-simulacion-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
apihub-cdc / rcc-simulacion-client example snippets
public function setUp()
{
$config = new Configuration();
$config->setHost('the_url');
$this->x_api_key = "your_x_api_key";
$client = new Client();
$this->apiInstance = new Instance($client,$config);
}
/**
* Este es el método que se será ejecutado en la prueba ubicado en path/to/repository/test/Api/ApiTest.php
*/
public function testGetFullReporte()
{
$request = new PersonaPeticion();
$request->setPrimerNombre("JUAN");
$request->setApellidoPaterno("SESENTAYDOS");
$request->setApellidoMaterno("PRUEBA");
$request->setRfc("SEPJ650809JG1");
$request->setFechaNacimiento("1965-08-09");
$request->setNacionalidad("MX");
$domicilio = new DomicilioPeticion();
$domicilio->setDireccion("PASADISO ENCONTRADO 58");
$domicilio->setColoniaPoblacion("MONTEVIDEO");
$domicilio->setCiudad("CIUDAD DE MÉXICO");
$domicilio->setCp("07730");
$domicilio->setDelegacionMunicipio("GUSTAVO A MADERO");
$domicilio->setEstado("CDMX");
$request->setDomicilio($domicilio);
try {
$result = $this->apiInstance->getReporte($this->x_api_key, $request);
$this->assertNotNull($result);
print_r($result);
echo "testGetFullReporte finished\n";
} catch (Exception $e) {
echo 'Exception when calling ApiTest->testGetFullReporte: ', $e->getMessage(), PHP_EOL;
}
}
sh
#ejemplo con php en versión 7.3 para otra versión colocar php{version}-curl
apt-get install php7.3-curl
apt-get install php7.3-mbstring
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.