Skip to content

Commit

Permalink
Added Missing Carbon Neutral Additional Option to ShipmentServiceOpti…
Browse files Browse the repository at this point in the history
…ons Class (#336)

Co-authored-by: shehryar <shehryar@clicklaboratory.com>
  • Loading branch information
Shehryar2 and shehryar authored Feb 15, 2022
1 parent b17eb56 commit 1847987
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<a name="requirements"></a>
## Requirements
Expand Down Expand Up @@ -840,6 +842,35 @@ For the Shipping `accept` call, the parameters are:

* $shipmentDigest The UPS Shipment Digest received from a ShipConfirm request. Required


<a name="shipment-service-options"></a>
## 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.
<a name="shipment-service-options-example"></a>
### 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);
```

<a name="logging"></a>
## Logging

Expand Down
21 changes: 21 additions & 0 deletions src/Entity/ShipmentServiceOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class ShipmentServiceOptions implements NodeInterface
*/
public $DeliverToAddresseeOnlyIndicator;

/**
* @var
*/
public $UPScarbonneutralIndicator;

/**
* @var
*/
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 1847987

Please sign in to comment.