PHP code example of apihub-cdc / ficoscore-peru-simulacion-client-php

1. Go to this page and download the library: Download apihub-cdc/ficoscore-peru-simulacion-client-php 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 / ficoscore-peru-simulacion-client-php example snippets



public function setUp()
{
    $config = new \FicoscorePeruSandbox\Client\Configuration();
    $config->setHost('the_url');

    $client = new \GuzzleHttp\Client();
    $this->apiInstance = new \FicoscorePeruSandbox\Client\Api\FicoScoreApi($client, $config);
}    



/**
* Este es el método que se será ejecutado en la prueba ubicado en path/to/repository/test/Api/FicoScoreApiTest.php
*/
public function testReportarEnLineaSimulacion()
{
    $x_api_key = "your_api_key";
    $request = new \FicoscorePeruSandbox\Client\Model\DatosConsulta();

    $request->setNumeroDocumento('xxxxx');
    $request->setTipoDocumento('x');
    $request->setFolioConsultaOtorgante(null);

    try {
        $result = $this->apiInstance->ficoScore($x_api_key, $request);
        $this->assertNotNull($result);
    } catch (Exception $e) {
        echo 'Exception when calling FicoScoreApi->ficoScore: ', $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