Updated Invoicing APIs

- Updated Model objects.
- Updated Samples.
- Updated Tests.
This commit is contained in:
Jay Patel
2016-07-13 15:16:25 -05:00
parent 9534bcb176
commit c714f77980
48 changed files with 3320 additions and 2881 deletions

View File

@@ -5,6 +5,7 @@ namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Converter\FormatConverter;
use PayPal\Validation\NumericValidator;
use PayPal\Validation\UrlValidator;
/**
* Class InvoiceItem
@@ -20,11 +21,12 @@ use PayPal\Validation\NumericValidator;
* @property \PayPal\Api\Tax tax
* @property string date
* @property \PayPal\Api\Cost discount
* @property string unit_of_measure
*/
class InvoiceItem extends PayPalModel
{
/**
* Name of the item. 60 characters max.
* Name of the item. 200 characters max.
*
* @param string $name
*
@@ -37,7 +39,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Name of the item. 60 characters max.
* Name of the item. 200 characters max.
*
* @return string
*/
@@ -70,7 +72,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Quantity of the item. Range of 0 to 9999.999.
* Quantity of the item. Range of -10000 to 10000.
*
* @param string|double $quantity
*
@@ -85,7 +87,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Quantity of the item. Range of 0 to 9999.999.
* Quantity of the item. Range of -10000 to 10000.
*
* @return string
*/
@@ -95,7 +97,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Unit price of the item. Range of -999999.99 to 999999.99.
* Unit price of the item. Range of -1,000,000 to 1,000,000.
*
* @param \PayPal\Api\Currency $unit_price
*
@@ -108,7 +110,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Unit price of the item. Range of -999999.99 to 999999.99.
* Unit price of the item. Range of -1,000,000 to 1,000,000.
*
* @return \PayPal\Api\Currency
*/
@@ -141,7 +143,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Date on which the item or service was provided. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
* The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
*
* @param string $date
*
@@ -154,7 +156,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Date on which the item or service was provided. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
* The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
*
* @return string
*/
@@ -164,7 +166,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Item discount in percent or amount.
* The item discount, as a percent or an amount value.
*
* @param \PayPal\Api\Cost $discount
*
@@ -177,7 +179,7 @@ class InvoiceItem extends PayPalModel
}
/**
* Item discount in percent or amount.
* The item discount, as a percent or an amount value.
*
* @return \PayPal\Api\Cost
*/
@@ -186,4 +188,52 @@ class InvoiceItem extends PayPalModel
return $this->discount;
}
/**
* The image URL. Maximum length is 4000 characters.
* @deprecated Not publicly available
* @param string $image_url
* @throws \InvalidArgumentException
* @return $this
*/
public function setImageUrl($image_url)
{
UrlValidator::validate($image_url, "ImageUrl");
$this->image_url = $image_url;
return $this;
}
/**
* The image URL. Maximum length is 4000 characters.
* @deprecated Not publicly available
* @return string
*/
public function getImageUrl()
{
return $this->image_url;
}
/**
* The unit of measure of the item being invoiced.
* Valid Values: ["QUANTITY", "HOURS", "AMOUNT"]
*
* @param string $unit_of_measure
*
* @return $this
*/
public function setUnitOfMeasure($unit_of_measure)
{
$this->unit_of_measure = $unit_of_measure;
return $this;
}
/**
* The unit of measure of the item being invoiced.
*
* @return string
*/
public function getUnitOfMeasure()
{
return $this->unit_of_measure;
}
}