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:
japatel
2014-12-18 15:41:11 -06:00
parent d5450c64aa
commit f090642fae
12 changed files with 89 additions and 387 deletions

View File

@@ -26,11 +26,16 @@ use PayPal\Validation\ArgumentValidator;
* @property \PayPal\Api\Transaction[] transactions
* @property string state
* @property \PayPal\Api\RedirectUrls redirect_urls
* @property \PayPal\Api\Links links
* @property string experience_profile_id
*/
class Payment extends PayPalResourceModel
{
/**
* Approval URL for Payment
*/
const APPROVAL_URL = 'approval_url';
/**
* OAuth Credentials to use for this call
*
@@ -340,30 +345,6 @@ class Payment extends PayPalResourceModel
return $this->redirect_urls;
}
/**
* 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;
}
/**
* Set Experience_profile_id
* experience_profile_id of the payment
@@ -388,6 +369,16 @@ class Payment extends PayPalResourceModel
{
return $this->experience_profile_id;
}
/**
* Get Approval Link
*
* @return null|string
*/
public function getApprovalLink()
{
return $this->getLink(Payment::APPROVAL_URL);
}
/**
* Creates (and processes) a new Payment Resource.