Moved APPROVAL_URL Constant to PayPalConstant class

- Improvement to #195
This commit is contained in:
japatel
2014-12-18 15:44:47 -06:00
parent f090642fae
commit 2d5c6d3266
3 changed files with 9 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
namespace PayPal\Api; namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Core\PayPalConstants;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
use PayPal\Api\AgreementTransactions; use PayPal\Api\AgreementTransactions;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
@@ -542,7 +543,7 @@ class Agreement extends PayPalResourceModel
*/ */
public function getApprovalLink() public function getApprovalLink()
{ {
return $this->getLink(Payment::APPROVAL_URL); return $this->getLink(PayPalConstants::APPROVAL_URL);
} }
/** /**

View File

@@ -4,6 +4,7 @@ namespace PayPal\Api;
use PayPal\Common\PayPalModel; use PayPal\Common\PayPalModel;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Core\PayPalConstants;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Rest\IResource; use PayPal\Rest\IResource;
use PayPal\Api\PaymentHistory; use PayPal\Api\PaymentHistory;
@@ -31,11 +32,6 @@ use PayPal\Validation\ArgumentValidator;
class Payment extends PayPalResourceModel class Payment extends PayPalResourceModel
{ {
/**
* Approval URL for Payment
*/
const APPROVAL_URL = 'approval_url';
/** /**
* OAuth Credentials to use for this call * OAuth Credentials to use for this call
* *
@@ -377,7 +373,7 @@ class Payment extends PayPalResourceModel
*/ */
public function getApprovalLink() public function getApprovalLink()
{ {
return $this->getLink(Payment::APPROVAL_URL); return $this->getLink(PayPalConstants::APPROVAL_URL);
} }
/** /**

View File

@@ -14,6 +14,11 @@ class PayPalConstants
const SDK_NAME = 'PayPal-PHP-SDK'; const SDK_NAME = 'PayPal-PHP-SDK';
const SDK_VERSION = '0.16.1'; const SDK_VERSION = '0.16.1';
/**
* Approval URL for Payment
*/
const APPROVAL_URL = 'approval_url';
const REST_SANDBOX_ENDPOINT = "https://api.sandbox.paypal.com/"; const REST_SANDBOX_ENDPOINT = "https://api.sandbox.paypal.com/";
const OPENID_REDIRECT_SANDBOX_URL = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect"; const OPENID_REDIRECT_SANDBOX_URL = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect";