Skip to content

printu/ElektronicznyNadawca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

956dfb2 · Feb 13, 2024

History

55 Commits
Feb 13, 2024
Feb 13, 2024
Sep 11, 2023
Sep 11, 2023
Sep 22, 2023
Sep 11, 2023
Sep 11, 2023
Sep 11, 2023
Sep 11, 2023

Repository files navigation

ElektronicznyNadawca

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.