Giter Site home page Giter Site logo

kvk-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kvk-api's Issues

not handling incorrect results

Hi,

I'm trying to retrieve data from a non-existing kvk number:

KVK returns:

{
  "apiVersion": "2.0",
  "meta": {},
  "error": {
    "code": 404,
    "message": "NotFound",
    "reason": "No companies found for the given query."
  }
}

This is not properly handled by:

private function decodeJsonToArray(string $json): array
    {
        return json_decode($json, true)['data'];
    }

improve scrutinizer config

add the following to the scrutinizer config

build:
    dependencies:
        before:
            - composer install -d instapro --no-scripts

    nodes:
        analysis:
            project_setup:
                override: true
            tests:
                override:
                    - php-scrutinizer-run --enable-security-analysis

filter:
  paths:
    - "src/"
  dependency_paths:
    - "vendor/"

build_failure_conditions:
    - 'issues.new.exists'
    - 'project.metric_change("scrutinizer.test_coverage", < -0.05)'

improve cs fixer config

instead of this:

    ->setFinder(
        PhpCsFixer\Finder::create()
            ->exclude('bin')
            ->exclude('coverage')
            ->exclude('vendor')
            ->in(__DIR__)
    );

do this:

    ->setFinder(
        PhpCsFixer\Finder::create()
            ->in([__DIR__ . '/src', __DIR__ . '/tests'])
            ->name('*.php')
    );

Class 'Werkspot\KvkApi\ClientFactory' not found

Hello,
I added the example of the readme, but this doesnt work..
Getting:
Class 'Werkspot\KvkApi\ClientFactory' not found

For:

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Werkspot\KvkApi\ClientFactory;
use Werkspot\KvkApi\Http\Endpoint\Production;
use Werkspot\KvkApi\Http\Search\ProfileQuery;

class KvkCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'kvk {id}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Search KVK';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $client = ClientFactory::create(env('KVK_API'), new Production());

        $profileQuery = new ProfileQuery();
        $profileQuery->setKvkNumber($this->argument('id'));

        $kvkPaginator = $client->getProfile($profileQuery);

        foreach ($kvkPaginator->getItems() as $company) {
            $this->info(json_encode($company));
        }

// get next set of data
        $kvkPaginator = $client->getNextPage($kvkPaginator);
    }
}

SSL routines::unsafe legacy renegotiation disabled

Hi,

We're trying to use your kvk-api implementation but we're getting a SSL error which we can't figure out. Renegotiation disabled.
Tried with and without adding the cert chain to the trusted certificates on ubuntu. Also tried with new Production() in case it was only an issue on the test endpoint but the same result.

Ever run into this issue by any coincidence?

$client = KvkClientFactory::create(config('kvk.api_key'), new Testing(), base_path('vendor/werkspot/kvk-api/cert/Private_G1_chain.pem'));

$searchQuery = new SearchQuery();
$searchQuery->setStreet('ABEBE Bikilalaan');
$kvkPaginator = $client->fetchSearch($searchQuery);
dd($kvkPaginator);

add a readme

add a readme with info on what this is, how it works, build tags, ...

I usually start from this template:

Hgraca \ LibName

Author
Software License
Latest Version
Total Downloads

Build Status
Coverage Status
Quality Score

<lib-name-description>

Add here a short description of what is the project. This should explain what the project is.
Add here a short description of the motivation behind the creation and maintenance of the project.
This should explain why the project exists.

Installation

To install the library, run the command below and you will get the latest version:

composer require hgraca/lib-name

Deployment

Add additional notes about how to deploy this on a live system

Available commands

make run
make test
make test-acc
make test-func
make test-int
make test-unit
make coverage
make cs-fix
make dep-install
make dep-update
make build-container-dev
make build-container-prd

No Releases (Request for semantic versioning)

Hi,

I'd very much like to start using this library. However there are no releases and the original maintainer does not work for your company anymore.

It would be awesome to use Sematic versioning for example, so that we don't have to require the "dev-master" version in our projects.

What needs to be done to release a "v1.0"/stable version?

Semantical make commands

Change make commands names, and order them alfabetically:

cs-fix => fix-cs
all-tests => test
coverage => test-coverage
integration-tests => test-integration
unit-tests => test-unit

New KVK APIs (From 1 April 2022)

The current APIs KVK Handelsregister Search and Profile will be phased out.

As of 1 April 2022, these APIs will cease to exist:

  • KVK Handelsregister Search
  • KVK Handelsregister Profile

These are the new APIs that take their place:

  • KVK Handelsregister Zoeken – search by KVK number, street, place name, or indication main office / branch office.
  • KVK Handelsregister Basisprofiel – request general company data, based on a KVK number.
  • KVK Handelsregister Vestigingsprofiel – request specific company data per office, based on the branch number.

More info: https://developers.kvk.nl/support/switch-to-new-apis

New certificate chain causing issues

Since today, the new KvK API certificate chain causes issues - a cURL error is returned:

cURL error 60: Unrecognized Object Identifier. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

I assume this happens for everyone. Message from KvK API Team:

Dear valued costumer,

On September 28, KVK (Chamber of Commerce) will switch to a private root certificate for connecting
to the KVK API Search and KVK API Profile. This implies that all (!) customers need to take immediate
action. An API-key will not be sufficient to provide a connection to the API’s. You need to adapt your
software. This can be achieved by trusting the trust chain in your software.
Instructions can be found https://developers.kvk.nl/guides.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.