定制 salonhub/kvk-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

salonhub/kvk-api

最新稳定版本:1.0.0

Composer 安装命令:

composer require salonhub/kvk-api

包简介

PHP KVK API client

README 文档

README

This project is a fork of the orignial KVK API created by Appvise for use in Salonhub. It contains only minor changes to keep it working.

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 salonhub/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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-03