Download the PHP package thehiddenhaku/sscc without Composer
On this page you can find all versions of the php package thehiddenhaku/sscc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thehiddenhaku/sscc
More information about thehiddenhaku/sscc
Files in thehiddenhaku/sscc
Package sscc
Short Description PHP Serial Shipping Container Code Generator
License MIT
Informations about the package sscc
Serial Shipping Container Code (S.S.C.C.) Calculator
A simple PHP class to calculate a full SSCC code given your vendor code and shipping number
Installation
install with composer
Usage
First you need to instantiate the class
The first parameter $vendorCode
is your personal vendor code.
The code must be assigned to you (or your client) by and authority.
It can be either 7 or 9 digit long.
The second parameter $extensionDigit
is an optional digit that will be added at the beginning of the code.
It defaults to 0
but you can override it with any positive integer between 0
and 9
Once the class is ready, just call the calculate()
method like this
the parameter $shippingNumber
id the progressive number of your shipping.
If your $vendorCode
is 7 digit your $shippingNumber
must be 9 digit (it will be "zerofilled" behind the scene)
if your $vendorCode
is 9 digit your $shippingNumber
must be 7 digit (it will be "zerofilled" behind the scene)
The method will return a complete SSCC code (with the correct Check Digit) which you can use where needed for instance in logistic labels
Testing
I used phpunit so you can just run
Contribute
Feel free to contribute and improve the class. just fork it and open you PR
License
This library is licensed under the MIT license. Please see License file for more information.