Merge branch 'master' of https://github.com/irfanevrens/PayPal-PHP-SDK into irfanevrens-master

This commit is contained in:
Jay Patel
2015-06-30 11:57:56 -05:00
26 changed files with 75 additions and 46 deletions

View File

@@ -2,8 +2,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class Address
*

View File

@@ -4,10 +4,9 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Core\PayPalConstants;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\AgreementTransactions;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Agreement

View File

@@ -3,10 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\Capture;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Authorization

View File

@@ -3,10 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\Refund;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Capture

View File

@@ -3,7 +3,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class CreditCardHistory
@@ -12,7 +11,7 @@ use PayPal\Rest\ApiContext;
*
* @package PayPal\Api
*
* @property \PayPal\Api\CreditCard credit_cards
* @property \PayPal\Api\CreditCard[] credit_cards
* @property int count
* @property string next_id
*/
@@ -20,10 +19,9 @@ class CreditCardHistory extends PayPalModel
{
/**
* A list of credit card resources
*
*
* @param \PayPal\Api\CreditCard $credit-cards
*
*
* @param \PayPal\Api\CreditCard[] $credit_cards
* @return $this
*/
public function setCreditCards($credit_cards)

View File

@@ -2,7 +2,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;

View File

@@ -2,8 +2,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class InvoiceAddress
*

View File

@@ -5,11 +5,20 @@ namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class OpenIdAddress
*
* End-User's preferred address.
*
* @package PayPal\Api
*
* @property string street_address
* @property string locality
* @property string region
* @property string postal_code
* @property string country
*/
class OpenIdAddress extends PayPalModel
{
/**
* Full street address component, which may include house number, street name.
*

View File

@@ -4,7 +4,13 @@ namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class OpenIdError
*
* Error resource
*
* @property string error
* @property string error_description
* @property string error_uri
*/
class OpenIdError extends PayPalModel
{

View File

@@ -12,13 +12,15 @@ class OpenIdSession
* Returns the PayPal URL to which the user must be redirected to
* start the authentication / authorization process.
*
* @param string $redirectUri Uri on merchant website to where
* @param string $redirectUri Uri on merchant website to where
* the user must be redirected to post paypal login
* @param array $scope The access privilges that you are requesting for
* @param array $scope The access privilges that you are requesting for
* from the user. Pass empty array for all scopes.
* @param string $clientId client id from developer portal
* @param string $clientId client id from developer portal
* See https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/#attributes for more
* @param ApiContext $apiContext Optional API Context
* @param null $nonce
* @param null $state
* @param ApiContext $apiContext Optional API Context
* @return string Authorization URL
*/
public static function getAuthorizationUrl($redirectUri, $scope, $clientId, $nonce = null, $state = null, $apiContext = null)

View File

@@ -1,13 +1,21 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
/**
* Class OpenIdTokeninfo
*
* Token grant resource
*
* @property string scope
* @property string access_token
* @property string refresh_token
* @property string token_type
* @property string id_token
* @property int expires_in
*/
class OpenIdTokeninfo extends PayPalResourceModel
{

View File

@@ -5,7 +5,31 @@ use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
/**
* Class OpenIdUserinfo
*
* OpenIdConnect UserInfo Resource
*
* @property string user_id
* @property string sub
* @property mixed name
* @property string given_name
* @property string family_name
* @property string middle_name
* @property string picture
* @property string email
* @property bool email_verified
* @property string gender
* @property string birthday
* @property string zoneinfo
* @property string locale
* @property string language
* @property bool verified
* @property string phone_number
* @property OpenIdAddress address
* @property mixed verified_account
* @property mixed account_type
* @property string age_range
* @property string payer_id
*/
class OpenIdUserinfo extends PayPalResourceModel
{

View File

@@ -3,11 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\Capture;
use PayPal\Api\Authorization;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Order

View File

@@ -3,7 +3,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class Payee

View File

@@ -4,11 +4,9 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Core\PayPalConstants;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\object;
use PayPal\Api\PaymentHistory;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Payment

View File

@@ -4,10 +4,9 @@ namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\PlanList;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Plan

View File

@@ -3,9 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class Sale
@@ -15,6 +15,7 @@ use PayPal\Transport\PayPalRestCall;
* @package PayPal\Api
*
* @property string id
* @property string purchase_unit_reference_id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Amount amount

View File

@@ -2,8 +2,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class ShippingAddress
*

View File

@@ -2,9 +2,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class TransactionBase
*

View File

@@ -3,7 +3,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
/**
* Class Transactions

View File

@@ -3,10 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\CreateProfileResponse;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class WebProfile

View File

@@ -3,10 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\WebhookList;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
use PayPal\Validation\UrlValidator;
/**

View File

@@ -3,10 +3,9 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Api\WebhookEventList;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* Class WebhookEventType

View File

@@ -198,6 +198,8 @@ class OAuthTokenCredential extends PayPalResourceModel
if ($response != null && isset($response["refresh_token"])) {
return $response['refresh_token'];
}
return null;
}
/**
@@ -251,6 +253,7 @@ class OAuthTokenCredential extends PayPalResourceModel
* Generates a new access token
*
* @param array $config
* @param null|string $refreshToken
* @return null
* @throws PayPalConnectionException
*/

View File

@@ -1,12 +1,11 @@
<?php
namespace PayPal\Common;
use PayPal\Handler\IPayPalHandler;
use PayPal\Rest\ApiContext;
use PayPal\Rest\IResource;
use PayPal\Transport\PayPalRestCall;
/**
* Class PayPalResourceModel
* An Executable PayPalModel Class

View File

@@ -93,6 +93,8 @@ class PayPalHttpConnection
switch ($this->httpConfig->getMethod()) {
case 'POST':
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
break;
case 'PUT':
case 'PATCH':
case 'DELETE':