Unit Tests and Functional Tests for Invoicing

- Updated Unit Tests for PPModels used by Invoicing
- Updated Functional Tests
- Updated Samples for quick changes.
This commit is contained in:
japatel
2014-11-19 15:21:18 -06:00
parent ef4797a94c
commit 026802443d
41 changed files with 3795 additions and 7 deletions

View File

@@ -3,6 +3,8 @@
namespace PayPal\Api;
use PayPal\Common\PPModel;
use PayPal\Validation\NumericValidator;
use PayPal\Common\FormatConverter;
/**
* Class Cost
@@ -11,7 +13,7 @@ use PayPal\Common\PPModel;
*
* @package PayPal\Api
*
* @property \PayPal\Api\number percent
* @property string percent
* @property \PayPal\Api\Currency amount
*/
class Cost extends PPModel
@@ -19,12 +21,14 @@ class Cost extends PPModel
/**
* Cost in percent. Range of 0 to 100.
*
* @param \PayPal\Api\number $percent
* @param string $percent
*
* @return $this
*/
public function setPercent($percent)
{
NumericValidator::validate($percent, "Percent");
$percent = FormatConverter::formatToTwoDecimalPlaces($percent);
$this->percent = $percent;
return $this;
}
@@ -32,7 +36,7 @@ class Cost extends PPModel
/**
* Cost in percent. Range of 0 to 100.
*
* @return \PayPal\Api\number
* @return string
*/
public function getPercent()
{

View File

@@ -208,4 +208,24 @@ class ShippingInfo extends PPModel
return $this->address;
}
/**
* @deprecated This will not be supported soon. Kept for backward Compatibility
*
* @param string $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @deprecated This will not be supported soon. Kept for backward Compatibility
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
}