printu/elektroniczny-nadawca

Elektroniczny Nadawca WebAPI

v14.1.0 2024-02-13 11:08 UTC

This package is auto-updated.

Last update: 2024-10-13 12:37:38 UTC


README

PHP bindings for the e-nadawca Poczta Polska (https://e-nadawca.poczta-polska.pl/).

API Documentation

Installation

The API client can be installed via Composer.

In your composer.json file:

{
    "require": {
        "printu/elektroniczny-nadawca": "^14.0.0"
    }
}

Once the composer.json file is created you can run composer install for the initial package install and composer update to update to the latest version of the API client.

Example

require_once __DIR__ . '/vendor/autoload.php';
/**
 * Minimal options
 */
$options = [
    WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => \PocztaPolska\EnumType\WsdlType::getPath(),
    WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \PocztaPolska\ClassMap::get(),
    WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOGIN = "login",
    WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_PASSWORD = "secret",
];
/**
 * Samples for Service ServiceType
 */
$service = new \PocztaPolska\ServiceType\Service($options);
/**
 * Sample call for addShipment operation/method
 */
if ($service->addShipment(new \PocztaPolska\StructType\AddShipment()) !== false) {
    print_r($service->getResult());
} else {
    print_r($service->getLastError());
}

License

MIT license. See the LICENSE file for more details.