diff --git a/src/AddressVerify.php b/src/AddressVerify.php index f600bba..76c75d0 100644 --- a/src/AddressVerify.php +++ b/src/AddressVerify.php @@ -16,6 +16,10 @@ class AddressVerify extends USPSBase * @var string - the api version used for this type of call */ protected $apiVersion = 'Verify'; + /** + * @var string - revision version for including additional response fields + */ + protected $revision = ''; /** * @var array - list of all addresses added so far */ @@ -38,7 +42,8 @@ public function verify() */ public function getPostFields() { - return $this->addresses; + $postFields = !empty($this->revision) ? ['Revision' => $this->revision] : []; + return array_merge($postFields, $this->addresses); } /** @@ -53,4 +58,18 @@ public function addAddress(Address $data, $id = null) $this->addresses['Address'][] = array_merge(['@attributes' => ['ID' => $packageId]], $data->getAddressInfo()); } + + /** + * Set the revision value + * + * @param string|int $value + * + * @return object AddressVerify + */ + public function setRevision($value) + { + $this->revision = (string)$value; + + return $this; + } }