Updated Payment APIs

- Updated SDK Models to latest Payment APIs
- Updated Unit Tests
This commit is contained in:
Jay Patel
2015-02-26 15:03:59 -06:00
parent 241d80cd17
commit 3e43f93f9b
93 changed files with 6079 additions and 1735 deletions

View File

@@ -3,16 +3,15 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class PaymentHistory
*
* A list of Payment Resources
* List of Payments made by the seller.
*
* @package PayPal\Api
*
* @property \PayPal\Api\Payment payments
* @property \PayPal\Api\Payment[] payments
* @property int count
* @property string next_id
*/
@@ -20,9 +19,8 @@ class PaymentHistory extends PayPalModel
{
/**
* A list of Payment resources
*
*
* @param \PayPal\Api\Payment $payments
* @param \PayPal\Api\Payment[] $payments
*
* @return $this
*/
@@ -42,9 +40,38 @@ class PaymentHistory extends PayPalModel
return $this->payments;
}
/**
* Append Payments to the list.
*
* @param \PayPal\Api\Payment $payment
* @return $this
*/
public function addPayment($payment)
{
if (!$this->getPayments()) {
return $this->setPayments(array($payment));
} else {
return $this->setPayments(
array_merge($this->getPayments(), array($payment))
);
}
}
/**
* Remove Payments from the list.
*
* @param \PayPal\Api\Payment $payment
* @return $this
*/
public function removePayment($payment)
{
return $this->setPayments(
array_diff($this->getPayments(), array($payment))
);
}
/**
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
*
*
* @param int $count
*
@@ -68,7 +95,6 @@ class PaymentHistory extends PayPalModel
/**
* Identifier of the next element to get the next range of results.
*
*
* @param string $next_id
*