Skip to content

Zasilkovna.cz PHP library supporting SOAP and REST API + custom Label generator

License

Notifications You must be signed in to change notification settings

baraja-core/zasilkovna

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Zasilkovna client in PHP using SOAP or REST API

Installation

Install using Composer:

$ composer require baraja-core/zasilkovna

Documentation

See http://www.zasilkovna.cz/popis-api/ for more info

Example code

$api = new Baraja\Zasilkovna\ApiRest($apiPassword, $apiKey);
// OR Soap implementation $api = new Baraja\Zasilkovna\ApiSoap($apiPassword, $apiKey);
$branch = new Branch($apiKey, new BranchStorageSqLite()); // There are multiple implementations of IBranchStorage BranchStorageSqLite using SQLite, BranchStorageFile using file in /tmp and BranchStorageMemory using simple variable (SLOW), You can implement your own by implementing IBranchStorage interface
$label = new Label($api, $branch);

// To greate new packet
$transporterPackage = new PacketAttributes(
	'ORDERID',
	'FirstName',
	'LastName',
	null,
	'addressId',
	null,
	'Company',
	'Email',
	'Phone',
	null,
	null,
	null,
	'www',
	false,
	'Street',
	'StreetNumber',
	'City',
	'ZipCode'
);

$api->createPacket($transporterPackage);

// Generate A4 label
$label->generateLabelFull($pdf, $transporterPackage);

// Generate A2 label
$label->generateLabelQuarter($pdf, $transporterPackage);

// Get full branch list as array
$branch->getBranchList();

// Returns branch detail by ID
$branch->find($branchId);

About

Zasilkovna.cz PHP library supporting SOAP and REST API + custom Label generator

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%