2017 © Pedro Peláez
 

library sscc

PHP Serial Shipping Container Code Generator

image

thehiddenhaku/sscc

PHP Serial Shipping Container Code Generator

  • Wednesday, April 20, 2016
  • by TheHiddenHaku
  • Repository
  • 0 Watchers
  • 2 Stars
  • 291 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 666 % Grown

The README.md

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, (*1)

$vendorCode = 800200800;
$shippingNumber = 1234;
$sscc = new TheHiddenHaku\SerialShippingContainerCode\SerialShippingContainerCode($vendorCode);
echo $sscc->calculate($shippingNumber);
//echoes '080020080000012346'

Installation

install with composer, (*2)

composer require thehiddenhaku/sscc

Usage

First you need to instantiate the class, (*3)

$sscc = new TheHiddenHaku\SerialShippingContainerCode\SerialShippingContainerCode($vendorCode, $extensionDigit);

The first parameter $vendorCode is your personal vendor code., (*4)

The code must be assigned to you (or your client) by and authority., (*5)

It can be either 7 or 9 digit long., (*6)

The second parameter $extensionDigit is an optional digit that will be added at the beginning of the code., (*7)

It defaults to 0 but you can override it with any positive integer between 0 and 9, (*8)

Once the class is ready, just call the calculate() method like this, (*9)

$code = $sscc->calculate($shippingNumber);

the parameter $shippingNumber id the progressive number of your shipping., (*10)

If your $vendorCode is 7 digit your $shippingNumber must be 9 digit (it will be "zerofilled" behind the scene), (*11)

if your $vendorCode is 9 digit your $shippingNumber must be 7 digit (it will be "zerofilled" behind the scene), (*12)

The method will return a complete SSCC code (with the correct Check Digit) which you can use where needed for instance in logistic labels, (*13)

Testing

I used phpunit so you can just run, (*14)

vendor/bin/phpunit

Contribute

Feel free to contribute and improve the class. just fork it and open you PR, (*15)

License

This library is licensed under the MIT license. Please see License file for more information., (*16)

The Versions

20/04 2016

dev-master

9999999-dev

PHP Serial Shipping Container Code Generator

  Sources   Download

MIT

The Development Requires

by Alessio Bottiroli

container code shipping sscc serial thehiddenhaku logistic

20/04 2016

0.2

0.2.0.0

PHP Serial Shipping Container Code Generator

  Sources   Download

MIT

The Development Requires

by Alessio Bottiroli

container code shipping sscc serial thehiddenhaku logistic

20/04 2016

0.1

0.1.0.0

PHP Serial Shipping Container Code Generator

  Sources   Download

MIT

The Development Requires

by Alessio Bottiroli

container code shipping sscc serial thehiddenhaku logistic