avido/postnl-cif-rest-api-php-client

Post NL Webservices 的 PHP 客户端

0.4.6 2019-11-20 14:29 UTC

This package is auto-updated.

Last update: 2024-09-14 18:09:30 UTC


README

Build Status Latest Stable Version Total Downloads License

PHP 版 PostNL CIF Rest Webservices API 客户端

开源 PHP 客户端,用于 [PostNL Rest CIF Webservices] (https://developer.postnl.nl/)。

安装

使用 composer 获取

运行命令

composer require avido/postnl-cif-rest-api-php-client

客户端初始化

require __DIR__ . '/vendor/autoload.php';
use Avido\PostNLCifClient\CifApi;

$apikey = '--YOUR APIKEY --';
$client = new CifApi($apiKey);

示例:根据地址信息检索最近的位置

use Avido\PostNLCifClient\Request\DeliveryOptions\Locations\NearestLocationsRequest;

// get nearest locations based on address information
$request = new NearestLocationsRequest();
$request->setCountryCode('NL')
    ->setPostalcode('2132WT')
    ->setCity('Hoofddorp')
    ->setStreet('Siriusdreef')
    ->setHouseNumber(42)
    ->setDeliveryDate('01-01-2999')
    ->setOpeningTime('09:00:00')
    ->addDeliveryOptions('PG');
// load api "getAPI" based on required services.
$response = $client->getAPI('location')->getNearestLocations($request);

单元测试

<phpunit>
  ...
    <php>
        <env name="PHP_APIKEY" value="--YOUR APIKEY--"/>
    </php>
</phpunit>

实现状态

此库仍在开发中,新的发布/实现将随后跟来。

配送选项

配送日期 webservice

发送 & 跟踪

条形码 webservice

欺诈预防

IBAN 检查国家

商业信贷检查

客户概览

国家商业检查

邮件