PHPackages                             jubbs/cakephp-star-ship-it - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jubbs/cakephp-star-ship-it

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

jubbs/cakephp-star-ship-it
==========================

StarShipIt plugin for CakePHP4

00PHP

Since Feb 4Pushed 1y agoCompare

[ Source](https://github.com/jubbs/cakephp-star-ship-it)[ Packagist](https://packagist.org/packages/jubbs/cakephp-star-ship-it)[ RSS](/packages/jubbs-cakephp-star-ship-it/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

StarShipIt plugin for CakePHP
=============================

[](#starshipit-plugin-for-cakephp)

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require jubbs/star-ship-it

```

Create the Database log table bin/cake migrations migrate -p StarShipIt

if there is shipping\_status field in the order model then it will be updated with the tracking status

Configuration
-------------

[](#configuration)

in app\_local.php add the following

```
    'StarShipIt' => [
        'API_KEY' => '',
        'SUBSCRIPTION_KEY' => '',
        'ORDER_TABLE_CLASS' => 'Order', // The class name of the order table blank if not used
        'ORDER_STATUS_FIELD' => 'shipping_status', // The field name of the order status blank if not used
        'LOG' => false, // Log the requests and responses to debug.log
    ],

```

### Event Callbacks

[](#event-callbacks)

Need to create the database table for the event callbacks

```
bin/cake migrations migrate -p StarShipIt

```

To set the location of the callback in you starshipit account go to

Notification Endpoint URL = https://&lt;&gt;/star-ship-it/event

### Event Callback processes

[](#event-callback-processes)

You can have functions run when an event is received from StarShipIt

Within the config of the app

Pass and array with the key of the event and the value of the class and function to run and an array of the parameters to pass to the function if the name exists on the order object then that value will be passed to the function otherwise the text. In this example the order id and the text 'StarShipIt' will be passed to the emailInvoice function in the Mail class

```
'EVENT_PROCESSES' => [
        'Dispatched' => ['\App\Util\Mail', 'emailInvoice', ['id', 'StarShipIt']],
]

```

### Usage

[](#usage)

There are two options to create the StarShipIt order

You can instantiate the StarShipIt/ApiModels/Order class and populate the fields and then call the create method

```

$ssiOrder = new \StarShipIt\ApiModelsOrder();
$ssiOrder->setOrderNumber('1234');
$ssiOrder->setOrderDate('2020-01-01');
$ssiOrder->setOrderStatus('Processing');
$ssiOrder->setOrderTotal('100.00');
..
$result = $this->ShipIt->createShippingOrder($order);

```

Or you can add a getStarShipItOrder function to your order Entity class and pass that object directly to the createShippingOrder function on the ShipItComponent

```

class Order extends Entity
{

    public function getStarShipItOrder()
    {

        $result = new stdClass();

        $result->order_number = $this->id;
        $result->items = [];

        $di = json_decode($this->delivery_address);

        $result->destination = (object)[
            "name" => $di->name ?? ($di->attention ?? null),
            "company" => $di->company ?? null,
            "street" => $di->address_1,
            "suburb" => $di->address_2 ?? null,
            "city" => $di->town ?? ($di->city ?? null),
            "state" => $di->region ?? null,
            "post_code" => $di->post_code ?? null,
            "country" => $di->country ?? null,
            "email" => $di->email ?? null,
            "phone" => $di->phone ?? null,
            "delivery_instructions" => $di->courier_instructions ?? null
        ];
        if ($di->country == "New Zealand") {
            $result->currency = "NZD";
        } elseif ($di->country == "Australia") {
            $result->currency = "AUD";
        }

        foreach ($this->order_products as $line_item) {

            $value = 0;
            if ($line_item->qty) {
                $value = $line_item->price / $line_item->qty;
            }

            if (!$line_item->backordered) { // Dont send backordered items
                $result->items[] = (object)[
                    "item_id" => $line_item->id,
                    "description" => $line_item->product->name,
                    "quantity" => $line_item->qty,
                    "value" => $value
                    //  "tarrif_code" => $line_item->product->tarrif_code ?? "00000000",
                ];
            }
        }

        return $result;
    }
}

$order = $this->Orders->get($id);
$result = $this->ShipIt->createShippingOrder($order);

```

```

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cba39d090416a04f5d9e303e7002fb487da97038c458971707ba1d36dcffb80?d=identicon)[jubbs](/maintainers/jubbs)

---

Top Contributors

[![jubbs](https://avatars.githubusercontent.com/u/7624010?v=4)](https://github.com/jubbs "jubbs (4 commits)")

### Embed Badge

![Health badge](/badges/jubbs-cakephp-star-ship-it/health.svg)

```
[![Health](https://phpackages.com/badges/jubbs-cakephp-star-ship-it/health.svg)](https://phpackages.com/packages/jubbs-cakephp-star-ship-it)
```

###  Alternatives

[naxeem/thaana-transliterator

Thaana transliterator

202.5k](/packages/naxeem-thaana-transliterator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
