PHP code example of chanshige / houjin-bangou

1. Go to this page and download the library: Download chanshige/houjin-bangou 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/ */

    

chanshige / houjin-bangou example snippets



Chanshige\NTA\HoujinBangouFactory;
use Chanshige\NTA\Condition\Criteria\CorporateName;

$houjin = HoujinBangouFactory::newInstance('国税庁より発行されたアプリケーションID');

$condition = new CorporateName();
$condition->name('カラビナテクノロジー');
$response = $houjin($condition);

echo $response->body(); //XML(Original)
// or $response->toJson();
// or $response->toArray();


use Chanshige\NTA\HoujinBangouFactory;
use Chanshige\NTA\Contracts\HoujinBangouInterface;
use GuzzleHttp\Client as GuzzleClient;
use Illuminate\Support\ServiceProvider;

class HoujinBangouServiceProvider extends ServiceProvider implements DeferrableProvider
{
    public function register()
    {
        $this->app->singleton(HoujinBangouInterface::class, static function () {
            return HoujinBangouFactory::newInstance(
                config('services.houjin_bangou.application_id')
            );
        });
    }

    public function provides(): array
    {
        return [
            ClientInterface::class
        ];
    }
}