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,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.
|
||||
|
||||
Reference in New Issue
Block a user