1. Go to this page and download the library: Download apihub-cdc/rcc-light-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-light-client example snippets
public function setUp()
{
$config = new \RccLight\Client\Configuration();
$config->setHost('the_url');
$password = getenv('KEY_PASSWORD');
$this->signer = new \RccLight\Client\Interceptor\KeyHandler(null, null, $password);
$events = new \RccLight\Client\Interceptor\MiddlewareEvents($this->signer);
$handler = \GuzzleHttp\HandlerStack::create();
$handler->push($events->add_signature_header('x-signature'));
$handler->push($events->verify_signature_header('x-signature'));
$client = new \GuzzleHttp\Client(['handler' => $handler]);
$this->apiInstance = new \RccLight\Client\Api\ReporteDeCreditoConsolidadoLightFICOScorePLDApi($client, $config);
$this->x_api_key = "your_api_key";
$this->username = "your_username";
$this->password = "your_password";
}
/**
* Este es el método que se será ejecutado en la prueba ubicado en path/to/repository/test/Api/ReporteDeCrditoConsolidadoLightFICOScorePLDApiTest.php
*/
public function testGetFullReporte()
{
$x_full_report = true;
$request = new \RccLight\Client\Model\PersonaPeticion();
$request->setPrimerNombre("XXXXX");
$request->setSegundoNombre("XXXXX");
$request->setApellidoPaterno("XXXXX");
$request->setApellidoMaterno("XXXXX");
$request->setApellidoAdicional(null);
$request->setFechaNacimiento("yyyy-MM-dd");
try {
$result = $this->apiInstance->getReporte($this->x_api_key, $this->username, $this->password, $request, $x_full_report);
$this->assertNotNull($result);
echo "testGetFullReporte finished\n";
} catch (Exception $e) {
echo 'Exception when calling ReporteDeCreditoConsolidadoLightFICOScorePLDApi->getReporte: ', $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.