定制 dividebv/postnl 二次开发

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

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

dividebv/postnl

最新稳定版本:v2.0.2

Composer 安装命令:

composer require dividebv/postnl

包简介

Library to connect to PostNL's SOAP service called CIF

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

This is a library to interface with the SOAP services offered by PostNL, called CIF.

New authorization

Since version 2.0 of this library, the new authorization method (using tokens instead of username/password) is used.

Installation

Install the latest version with

composer require dividebv/postnl

Implementation Status

This library is not complete. This table lists which services are implemented and which aren't. The list of existing services is taken from PostNL's developer center.

Service Implemented Version
Addresses €
Adrescheck Nationaal N/A
Adrescheck Basis Nationaal N/A
Adrescheck Internationaal N/A
Persoon op Adrescheck Basis N/A
Geo Adrescheck Nationaal N/A
Creditworthiness & Business information €
Bedrijfscheck Nationaal N/A
Fraudepreventie Check Basis N/A
IBANcheck Nationaal N/A
Kredietcheck Consument Basis N/A
Kredietcheck Consument Premium N/A
Kredietcheck Zakelijk N/A
Send & Track
Barcode webservice 1_1
Confirming webservice 1_9
Labelling webservice 2_0
Shippingstatus webservice 1_6
Delivery options
Deliverydate webservice 2_1
Location webservice 2_1
Timeframe webservice 2_0
Mail
Bulkmail webservice N/A

Example

use DivideBV\Postnl\Postnl; use DivideBV\Postnl\ComplexTypes; // Create client class using credentials received from PostNL. $client = new Postnl( 12345678, // Customer number 'ABCD', // Customer code 'Acme BV', // Customer name 'xxxxxxxx', // API key 123456, // Collection location 'CD1234', // Globalpack true // Whether to use PostNL's sandbox environment. ); /**  * Jan Smit  * Smit & Zonen  * Hoofdstraat 1A  * 1234 AB Heikant  * The Netherlands  */ $receiverAddress = ComplexTypes\Address::create() ->setAddressType('01') ->setFirstName('Jan') ->setName('Smit') ->setCompanyName('Smit & Zonen') ->setStreet('Hoofdstraat') ->setHouseNr('1') ->setHouseNrExt('A') ->setZipcode('1234AB') ->setCity('Heikant') ->setCountrycode('NL'); $senderAddress = ComplexTypes\Address::create() ->setAddressType('02') ->setFirstName('Robert') ->setName('Jansen') ->setCompanyName('Jansen & Janssen') ->setStreet('Hoofdstraat') ->setHouseNr('999') ->setHouseNrExt('B') ->setZipcode('1234AB') ->setCity('Heikant') ->setCountrycode('NL'); // Request a barcode from PostNL. $barcode = $client->generateBarcodeByDestination($receiverAddress->getCountryCode()); // Create a shipment. $shipment = ComplexTypes\Shipment::create() ->setAddresses(new ComplexTypes\ArrayOfAddress([ $receiverAddress, $senderAddress, ])) ->setBarcode($barcode) ->setDimension(ComplexTypes\Dimension::create() ->setWeight(5000) // Weight in g ->setWidth(215) // Width in mm ->setLength(305) // Length in mm ->setHeight(280) // Height in mm ) ->setProductCodeDelivery('3085'); // Generate label and confirm shipment. $result = $client->generateLabel($shipment); // Save the label PDF locally. $label = $result->getLabels()[0]; $file = new \SplFileObject("label.pdf", 'w'); $file->fwrite($label->getContent());

统计信息

  • 总下载量: 346.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 31
  • Watchers: 10
  • Forks: 38
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固