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,7 +3,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class PaymentExecution
@@ -13,13 +12,12 @@ use PayPal\Rest\ApiContext;
* @package PayPal\Api
*
* @property string payer_id
* @property \PayPal\Api\Transactions transactions
* @property \PayPal\Api\Transaction[] transactions
*/
class PaymentExecution extends PayPalModel
{
/**
* PayPal assigned Payer ID returned in the approval return url.
*
*
* @param string $payer_id
*
@@ -42,10 +40,9 @@ class PaymentExecution extends PayPalModel
}
/**
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
*
* Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment
*
* @param \PayPal\Api\Transactions $transactions
* @param \PayPal\Api\Transaction[] $transactions
*
* @return $this
*/
@@ -56,13 +53,43 @@ class PaymentExecution extends PayPalModel
}
/**
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
* Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment
*
* @return \PayPal\Api\Transactions[]
* @return \PayPal\Api\Transaction[]
*/
public function getTransactions()
{
return $this->transactions;
}
/**
* Append Transactions to the list.
*
* @param \PayPal\Api\Transaction $transaction
* @return $this
*/
public function addTransaction($transaction)
{
if (!$this->getTransactions()) {
return $this->setTransactions(array($transaction));
} else {
return $this->setTransactions(
array_merge($this->getTransactions(), array($transaction))
);
}
}
/**
* Remove Transactions from the list.
*
* @param \PayPal\Api\Transaction $transaction
* @return $this
*/
public function removeTransaction($transaction)
{
return $this->setTransactions(
array_diff($this->getTransactions(), array($transaction))
);
}
}