forked from LiveCarta/PayPal-PHP-SDK
Helper Function to Retrieve Specific Link from Model Object
- Helper Methods in Payment and Agreement to get ApprovalLink - Fixes #195
This commit is contained in:
@@ -26,7 +26,6 @@ use PayPal\Transport\PayPalRestCall;
|
||||
* @property \PayPal\Api\PaymentDefinition[] payment_definitions
|
||||
* @property \PayPal\Api\Terms[] terms
|
||||
* @property \PayPal\Api\MerchantPreferences merchant_preferences
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Plan extends PayPalResourceModel
|
||||
{
|
||||
@@ -420,59 +419,6 @@ class Plan extends PayPalResourceModel
|
||||
return $this->merchant_preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user