diff --git a/README.md b/README.md index d1c7f83..7084a44 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,10 @@ Tracking API, Shipping API, Rating API and Time in Transit API. Feel free to con 12. [Shipping Class](#shipping-class) * [Example](#shipping-class-example) * [Parameters](#shipping-class-parameters) -13. [Logging](#logging) -14. [License](#license-section) +12. [Shipment Service Options](#shipment-service-options) + * [Example](#shipment-service-options-example) +14. [Logging](#logging) +15. [License](#license-section) ## Requirements @@ -840,6 +842,35 @@ For the Shipping `accept` call, the parameters are: * $shipmentDigest The UPS Shipment Digest received from a ShipConfirm request. Required + + +## Shipment Service Options + +The Shipment Service Options class allows you to register shipments additional options. This also includes. + + +* Add or Modify email notifications: Manage updates for this shipment. +* Saturday Commericial: Get weekend delivery of your shipment. +* Deliver only to receiver's address: Do not reroute for customer pickup at a UPS location. +* UPS Carbon Neutral Shipments Thanks for offsetting the environmental impact of your shipment! : at a nominal fee for domestic and international shipments. + + +In the example ShipmentServiceOptions class is used to show how a Shipment Additional Option can be added to Shipment. + +### Shipment Service Options Example + +```php +// Start shipment +$shipment = new Ups\Entity\Shipment; + +// Create Shipment Service Options Class + $shipmentOptions = new Ups\Entity\ShipmentServiceOptions; + // Setting the Carbon Neutral Additional Option, you can set your desired one. + $shipmentOptions->setUPScarbonneutralIndicator(); +// Set Shipment Service Options Class + $shipment->setShipmentServiceOptions($shipmentOptions); +``` + ## Logging diff --git a/src/Entity/ShipmentServiceOptions.php b/src/Entity/ShipmentServiceOptions.php index b2b9f18..ba03abc 100644 --- a/src/Entity/ShipmentServiceOptions.php +++ b/src/Entity/ShipmentServiceOptions.php @@ -48,6 +48,11 @@ class ShipmentServiceOptions implements NodeInterface */ public $DeliverToAddresseeOnlyIndicator; + /** + * @var + */ + public $UPScarbonneutralIndicator; + /** * @var */ @@ -468,4 +473,20 @@ public function setDeliverToAddresseeOnlyIndicator($DeliverToAddresseeOnlyIndica $this->DeliverToAddresseeOnlyIndicator = $DeliverToAddresseeOnlyIndicator; return $this; } + + /** + * @return mixed + */ + public function getUPScarbonneutralIndicator() + { + return $this->UPScarbonneutralIndicator; + } + + /** + * @param mixed $UPScarbonneutralIndicator + */ + public function setUPScarbonneutralIndicator(): void + { + $this->UPScarbonneutralIndicator = true; + } }