appvise/kvk-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

appvise/kvk-api

Composer 安装命令:

composer require appvise/kvk-api

包简介

PHP KVK API client

README 文档

README

As for 1 april 2022 there are some new API's available for interacting with KVK. This library makes this easy for you. Check for installation and usage details below.

Documentation

Installation

Install this package via composer

composer require appvise/kvk-api

Probably you want to install the KVK (Staat der Nederlanden Private Root CA - G1) certificate into you trusted chains. For more information head to: Certificate information

Usage

Zoeken API

use Appvise\KvkApi\Http\SearchQuery;
use Appvise\KvkApi\KvkClientFactory;
use Appvise\KvkApi\Exception\ApiException;
use Appvise\KvkApi\Exception\NotFoundException;

// for more information check:
// https://developers.kvk.nl/nl/support/tls-certificate-chain-trust-instructions
$rootCertificate = <location_of_root_certificate>;
$client = KvkClientFactory::create(<YOUR_API_KEY>, 'test | production', $rootCertificate);

$query = new SearchQuery();
$query->setKvkNumber('KVK nummer to search for');

try {
    $resultaten = $this->client->search($query);
    foreach ($resultaten->getResultaten() as $searchResult) {
        // do something with $searchResult
    }
} catch(NotFoundException | ApiException $exception) {
    // handle error
}

BasisProfiel API

use Appvise\KvkApi\Http\ProfileQuery;
use Appvise\KvkApi\KvkClientFactory;
use Appvise\KvkApi\Exception\ApiException;
use Appvise\KvkApi\Exception\NotFoundException;

// for more information check:
// https://developers.kvk.nl/nl/support/tls-certificate-chain-trust-instructions
$rootCertificate = <location_of_root_certificate>;
$client = KvkClientFactory::create(<YOUR_API_KEY>, 'test | production', $rootCertificate);

$query = new ProfileQuery();
$query->setKvkNumber('KVK nummer to fetch basis profile information for');

try {
    $basisProfile = $this->client->getBasisProfiel($query);
    // do something with $basisProfile
} catch(NotFoundException | ApiException $exception) {
    // handle error
}

Tests

composer test

统计信息

  • 总下载量: 26.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-23