apihub-cdc/rcc-light-simulacion

此包的最新版本(1.0.1)没有可用的许可证信息。

1.0.1 2020-01-29 21:47 UTC

README

此报告显示了个人与金融机构、非金融机构和商业信用机构所承担的信用承诺的支付履约历史。

要求

PHP 7.1 或更高版本

额外依赖项

  • 需要以下PHP依赖项
    • ext-curl
    • ext-mbstring
  • 如果不符合,对于Linux,请使用以下命令
#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

安装

执行: composer install

入门指南

步骤 1. 将产品添加到应用程序

登录后按照以下步骤操作

  1. 点击 "我的应用" 部分。
  2. 选择应用程序。
  3. 转到 "编辑 '@tuApp' " 选项卡。

  4. 在弹出窗口中,选择产品。
  5. 点击 "保存 App" 按钮

步骤 2. 捕获请求数据

以下需要修改的数据位于 test/Api/ReporteDeCreditoConsolidadoLightFICOScorePLDApiTest.php

非常重要,需要 setUp() 来初始化 URL。修改请求对象的 $config 中的 URL ('the_url'),如下所示

<?php
public function setUp()
{
    $config = new \RccLightSimulacion\Client\Configuration();
    $config->setHost('the_url');

    $client = new \GuzzleHttp\Client();
    $this->apiInstance = new \RccLightSimulacion\Client\Api\ReporteDeCreditoConsolidadoLightFICOScorePLDApi($client, $config);
    $this->x_api_key = "your_api_key";
}    
<?php
/**
* Este es el método que se será ejecutado en la prueba ubicado en path/to/repository/test/Api/ReporteDeCreditoConsolidadoLightFICOScorePLDApiTest.php
*/
public function testGetFullReporte()
{
    $x_full_report = true;
    $request = new \RccLightSimulacion\Client\Model\PersonaPeticion();
    
    $request->setPrimerNombre("xxxxx");
    $request->setSegundoNombre(null);
    $request->setApellidoPaterno("xxxxx");
    $request->setApellidoMaterno("xxxxx");
    $request->setApellidoAdicional(null);
    $request->setFechaNacimiento("yyyy-MM-dd");

    try {
        $result = $this->apiInstance->getReporte($this->x_api_key, $request, $x_full_report);
        $this->assertNotNull($result);
        echo "testGetFullReporte finished\n";
    } catch (Exception $e) {
        echo 'Exception when calling ReporteDeCreditoConsolidadoLightFICOScorePLDApi->getReporte: ', $e->getMessage(), PHP_EOL;
    }
}
?>

单元测试

要执行单元测试

./vendor/bin/phpunit