定制 bigbank/omniva 二次开发

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

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

bigbank/omniva

Composer 安装命令:

composer require bigbank/omniva

包简介

Library to interface with Omniva web API-s

README 文档

README

Latest Stable Version on Packagist Software License Build Status Total Downloads

A PHP library for interfacing with Omniva (former Estonian Postal Service) web API-s without dealing with SOAP (too much).

Install

Via Composer

$ composer require bigbank/omniva

The library requires PHP >=5.6, curl, soap and openssl extensions.

Usage

// Instantiate the main class
$omniva = new Omniva;

// Ask for a service (see: Services)
$addressSearchService = $omniva->getService(AddressSearchInterface::class)
    ->setApiKey(getenv('OMNIVA_PASSWORD'));

// Get a list of all matching addresses for a partial input
$addresses = $addressSearchService->findAddresses('Tartu mnt 18');

print_r($addresses);

Example implementation in examples/search-address.php can be run with

$ OMNIVA_PASSWORD="<secret-string>" php examples/search-address.php

To use a HTTP proxy, set HTTP_PROXY environment variable.

Services

The library provides access to the following services:

Address Search

Get a list of physical addresses based on a partial input. Useful for applications like address auto-complete.

Usage

$addressSearchService = $omniva->getService(AddressSearchInterface::class)
    ->setApiKey(getenv('OMNIVA_PASSWORD'))
    ->findAddresses('Tartu mnt 18');

You can change the URL of the Omniva API endpoint by manually instantiating AddressSearch:

$addressSearchService = new AddressSearch(
    new SingleAddress2_5_1PortTypeService($soapOptions, $wsdlUrl),
    new SingleAddress2_5_1Request
);

Sample Output

Array
(
    [0] => Array
        (
            [address] => Eesti Vabariik, Tartu maakond, Elva linn, Tartu maantee 18
            [addressNumber] => 18
            [county] => Tartu maakond
            [countyId] => 0078
            [designation] => 
            [flatNumber] => 
            [latitude] => 641443.84
            [level] => A7
            [longitude] => 6457217.29
            [mailboxType] => 
            [mainAddress] => 
            [municipality] => Elva linn
            [municipalityId] => 0170
            [municipalityType] => linn
            [nationalAddressId] => 7817000000000002H000019HC00000000
            [omnivaAddressId] => 3702034
            [postalIndex] => 61505
            [postOfficeBoxNumber] => 
            [settlement] => 
            [settlementId] => 0000
            [settlementType] => 
            [status] => Kontrollitud, kehtiv
            [territorialAddress] => 
            [territorialAddressType] => 
            [trafficSurface] => Tartu maantee
            [trafficSurfaceType] => tee
        )
)

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Development

Please see CONTRIBUTING for details.

Definitions

Definitions for terms used by Omniva API-s (in Estonian):

  • EHAK - Eesti haldus- ja asustusjaotuse klassifikaator
  • ADS - Aadressiandmete süsteem
  • Põhiaadress - See on vajalik juhul kui objektil on küll mitu aadressi kuid aktiivselt kasutatakse ühte nendest ja teine on varuks. Näiteks kui on tegu tänava nurgal oleva majaga, millel on kaks aadressi. Hoone peasissekäik on ühelt tänavalt ja see aadress oleks sel juhul põhiaadress.

Related Materials

These materials (in Estonian) help to understand the address domain.

Security

If you discover any security related issues, please email info@bigbank.ee instead of using the issue tracker.

Credits

License

The Apache 2.0 License (Apache-2.0). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固