apihub-cdc/rcc-light-client

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

1.0.1 2020-01-30 22:17 UTC

This package is auto-updated.

Last update: 2024-09-10 02:59: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/ReporteDeCrditoConsolidadoLightFICOScorePLDApiTest.php

重要:需要有一个 setUp() 方法来初始化 URL。修改对象 $config 中请求的 URL ('the_url'),如下代码片段所示

<?php
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";
}  
<?php
/**
* 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;
    }
}
?>

单元测试

要执行单元测试

./vendor/bin/phpunit