ibrows / post_barcode_bundle
Bundle for creating barcode through the swiss post soap API
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- symfony/framework-bundle: ~2.8
Requires (Dev)
- phpunit/phpunit: >3.7
This package is not auto-updated.
Last update: 2024-12-23 03:12:56 UTC
README
The IbrowsPostBarcodeBundle allows you to create letter and package barcodes through the swiss post API. more information under: http://www.post.ch/post-barcode-cug
Install and setup the bundle
-
Fetch the source code
$ php composer.phar require ibrows/post_barcode_bundle
Composer will install the bundle to your project's
ibrows/post_barcode_bundle
directory. -
Add the bundle to your
AppKernel
class// app/AppKernerl.php public function registerBundles() { $bundles = array( // ... new Ibrows\PostBarcodeBundle\IbrowsPostBarcodeBundle(), // ... ); // ... }
Configuration
Setup credentials, paths and entities
ibrows_post_barcode: soap: wsdl: '%kernel.root_dir%/../vendor/ibrows/post_barcode_bundle/Soap/wsdl' dir: '%kernel.root_dir%/../vendor/ibrows/post_barcode_bundle/Soap/Classes' namespace: 'Ibrows\PostBarcodeBundle\Soap\classes' endpoint: "https://wsbc.post.ch/wsbc/barcode/v2_2" username: <postApiUser> password: <postApiPassword> frankingLicence: <frankingLicenceNumber> barcode: folder: '%kernel.root_dir%/../web/barcodes'
Usage example
$recipient = new Address(); $recipient->setCountry('CH'); $recipient->setCity('Zürich'); $recipient->setCompany('iBROWS AG'); $recipient->setFirstName('Manuel'); $recipient->setLastName('Knobel'); $recipient->setPrimaryStreet('Seestrasse 356'); $recipient->setZipCode('8038'); $recipient->setTitle(Address::MISTER); $customer = clone $recipient; $service = $this->getContainer()->get('ibrows_post_barcode.soap.client.service.barcode'); $service->generateLabel($recipient, $customer);