Overview

Namespaces

  • ShippoClient
    • Entity
    • Http
      • Request
        • Addresses
        • Parcels
        • Shipments
        • Transactions
      • Response
        • Exception

Classes

  • ShippoClient\Addresses
  • ShippoClient\Entity\Address
  • ShippoClient\Entity\AddressCollection
  • ShippoClient\Entity\EntityCollection
  • ShippoClient\Entity\Location
  • ShippoClient\Entity\ObjectInformation
  • ShippoClient\Entity\Parcel
  • ShippoClient\Entity\ParcelCollection
  • ShippoClient\Entity\Rate
  • ShippoClient\Entity\RateCollection
  • ShippoClient\Entity\Refund
  • ShippoClient\Entity\RefundCollection
  • ShippoClient\Entity\ServiceLevel
  • ShippoClient\Entity\Shipment
  • ShippoClient\Entity\ShipmentCollection
  • ShippoClient\Entity\TrackingHistory
  • ShippoClient\Entity\TrackingStatus
  • ShippoClient\Entity\Tracks
  • ShippoClient\Entity\Transaction
  • ShippoClient\Entity\TransactionCollection
  • ShippoClient\Entity\WebhookTracks
  • ShippoClient\Http\Request
  • ShippoClient\Http\Request\Addresses\CreateObject
  • ShippoClient\Http\Request\CommonParameter
  • ShippoClient\Http\Request\MockCollection
  • ShippoClient\Http\Request\Parcels\CreateObject
  • ShippoClient\Http\Request\Shipments\CreateObject
  • ShippoClient\Http\Request\Shipments\CreateObjectByNested
  • ShippoClient\Http\Request\Shipments\CreateReturnObject
  • ShippoClient\Http\Request\Transactions\CreateObject
  • ShippoClient\Http\Response\AddressList
  • ShippoClient\Http\Response\ListResponse
  • ShippoClient\Http\Response\ParcelList
  • ShippoClient\Http\Response\RateList
  • ShippoClient\Http\Response\RefundList
  • ShippoClient\Http\Response\ShipmentList
  • ShippoClient\Http\Response\TransactionList
  • ShippoClient\Parcels
  • ShippoClient\Rates
  • ShippoClient\Refunds
  • ShippoClient\Shipments
  • ShippoClient\ShippoClient
  • ShippoClient\Tracks
  • ShippoClient\Transactions

Exceptions

  • ShippoClient\Http\Response\Exception\BadResponseException
  • ShippoClient\Http\Response\Exception\ClientErrorException
  • ShippoClient\Http\Response\Exception\ServerErrorException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace ShippoClient\Entity;
 4: 
 5: use TurmericSpice\ReadableAttributes;
 6: 
 7: class TrackingStatus
 8: {
 9:     use ReadableAttributes {
10:         mayHaveAsString as public getStatusDetails;
11:         mayHaveAsString as public getStatusDate;
12:         toArray as __toArray;
13:     }
14: 
15:     /**
16:      * Date and time of object creation.
17:      *
18:      * @return \DateTime
19:      */
20:     public function getObjectCreated()
21:     {
22:         return $this->attributes->mayHave('object_created')->asInstanceOf('\\DateTime');
23:     }
24: 
25:     /**
26:      * Date and time of last object update.
27:      *
28:      * @return \DateTime
29:      */
30:     public function getObjectUpdated()
31:     {
32:         return $this->attributes->mayHave('object_updated')->asInstanceOf('\\DateTime');
33:     }
34: 
35:     /**
36:      * Unique identifier of the given object.
37:      *
38:      * @return string
39:      */
40:     public function getObjectId()
41:     {
42:         return $this->attributes->mayHave('object_id')->asString();
43:     }
44: 
45:     /**
46:      * Package status.
47:      *  - "UNKNOWN"   The package has not been found via the carrier's tracking system,
48:      *                or it has been found but not yet scanned by the carrier.
49:      *  - "TRANSIT"   The package has been scanned by the carrier and is in transit.
50:      *  - "DELIVERED" The package has been successfully delivered.
51:      *  - "RETURNED"  The package is en route to be returned to the sender, or has been returned successfully.
52:      *  - "FAILURE"   The carrier indicated that there has been an issue with the delivery.
53:      *                This can happen for various reasons and depends on the carrier.
54:      *                This status does not indicate a technical error, but rather a delivery issue.
55:      *
56:      * @return string
57:      */
58:     public function getStatus()
59:     {
60:         return $this->attributes->mayHave('status')->asString();
61:     }
62: 
63:     /**
64:      * @return Location
65:      */
66:     public function getLocation()
67:     {
68:         $attributes = $this->attributes->mayHave('location')->asArray();
69:         return new Location($attributes);
70:     }
71: 
72:     public function toArray()
73:     {
74:         return [
75:             'object_created' => $this->getObjectCreated(),
76:             'object_updated' => $this->getObjectUpdated(),
77:             'object_id'      => $this->getObjectId(),
78:             'status'         => $this->getStatus(),
79:             'status_date'    => $this->getStatusDate(),
80:             'status_details' => $this->getStatusDetails(),
81:             'location'       => $this->getLocation()->toArray(),
82:         ];
83:     }
84: }
85: 
API documentation generated by ApiGen