Skip to content

Commit 1847987

Browse files
Shehryar2shehryar
andauthored
Added Missing Carbon Neutral Additional Option to ShipmentServiceOptions Class (#336)
Co-authored-by: shehryar <[email protected]>
1 parent b17eb56 commit 1847987

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ Tracking API, Shipping API, Rating API and Time in Transit API. Feel free to con
4747
12. [Shipping Class](#shipping-class)
4848
* [Example](#shipping-class-example)
4949
* [Parameters](#shipping-class-parameters)
50-
13. [Logging](#logging)
51-
14. [License](#license-section)
50+
12. [Shipment Service Options](#shipment-service-options)
51+
* [Example](#shipment-service-options-example)
52+
14. [Logging](#logging)
53+
15. [License](#license-section)
5254

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

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

845+
846+
<a name="shipment-service-options"></a>
847+
## Shipment Service Options
848+
849+
The Shipment Service Options class allows you to register shipments additional options. This also includes.
850+
851+
852+
* Add or Modify email notifications: Manage updates for this shipment.
853+
* Saturday Commericial: Get weekend delivery of your shipment.
854+
* Deliver only to receiver's address: Do not reroute for customer pickup at a UPS location.
855+
* UPS Carbon Neutral Shipments Thanks for offsetting the environmental impact of your shipment! : at a nominal fee for domestic and international shipments.
856+
857+
858+
In the example ShipmentServiceOptions class is used to show how a Shipment Additional Option can be added to Shipment.
859+
<a name="shipment-service-options-example"></a>
860+
### Shipment Service Options Example
861+
862+
```php
863+
// Start shipment
864+
$shipment = new Ups\Entity\Shipment;
865+
866+
// Create Shipment Service Options Class
867+
$shipmentOptions = new Ups\Entity\ShipmentServiceOptions;
868+
// Setting the Carbon Neutral Additional Option, you can set your desired one.
869+
$shipmentOptions->setUPScarbonneutralIndicator();
870+
// Set Shipment Service Options Class
871+
$shipment->setShipmentServiceOptions($shipmentOptions);
872+
```
873+
843874
<a name="logging"></a>
844875
## Logging
845876

src/Entity/ShipmentServiceOptions.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ class ShipmentServiceOptions implements NodeInterface
4848
*/
4949
public $DeliverToAddresseeOnlyIndicator;
5050

51+
/**
52+
* @var
53+
*/
54+
public $UPScarbonneutralIndicator;
55+
5156
/**
5257
* @var
5358
*/
@@ -468,4 +473,20 @@ public function setDeliverToAddresseeOnlyIndicator($DeliverToAddresseeOnlyIndica
468473
$this->DeliverToAddresseeOnlyIndicator = $DeliverToAddresseeOnlyIndicator;
469474
return $this;
470475
}
476+
477+
/**
478+
* @return mixed
479+
*/
480+
public function getUPScarbonneutralIndicator()
481+
{
482+
return $this->UPScarbonneutralIndicator;
483+
}
484+
485+
/**
486+
* @param mixed $UPScarbonneutralIndicator
487+
*/
488+
public function setUPScarbonneutralIndicator(): void
489+
{
490+
$this->UPScarbonneutralIndicator = true;
491+
}
471492
}

0 commit comments

Comments
 (0)