PHP code example of monster / zhima-credit

1. Go to this page and download the library: Download monster/zhima-credit 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/ */

    

monster / zhima-credit example snippets




use Monster\Zhima\Client;

$config = new Monster\Zhima\Config();
$config->setAppId('1001528');
$config->setPrivateKey(__DIR__ . '/rsa/rsa_private_key.pem');
$config->setZhimaPublicKey(__DIR__ . '/rsa/rsa_public_key.pem');
$config->setChannel('api');


$creditIvsDetail = new \Monster\Zhima\Handlers\CreditIvsDetail();
$creditIvsDetail->setCertNo('33022719xxxxxxxxxxx');
$creditIvsDetail->setName('张三');
$creditIvsDetail->setCertType('100');

$client = new Client(new \GuzzleHttp\Client(), $config);
$result = $client->with($creditIvsDetail)->fetch();

var_dump($result);