diff --git a/README.md b/README.md index 59e30a9..a1ab942 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,33 @@ This repository contains PayPal's PHP SDK and samples for REST API. - PHP 5.3 or above - [curl](http://php.net/manual/en/book.curl.php), [json](http://php.net/manual/en/book.json.php) & [openssl](http://php.net/manual/en/book.openssl.php) extensions must be enabled +## Breaking Changes to 1.* Release + * Removed Deprecated Getter Setters from all Model Classes + * All Camelcase getters and setters are removed. Please use first letter uppercase syntax + * E.g. instead of using get_notify_url(), use getNotifyUrl() instead + * Renamed Classes + * PayPal\Common\PPModel => PayPal\Common\PayPalModel + * PayPal\Common\ResourceModel => PayPal\Common\PayPalResourceModel + * PayPal\Common\PPUserAgent => PayPal\Common\PayPalUserAgent + * PayPal\Core\PPConfigManager => PayPal\Core\PayPalConfigManager + * PayPal\Core\PPConstants => PayPal\Core\PayPalConstants + * PayPal\Core\PPCredentialManager => PayPal\Core\PayPalCredentialManager + * PayPal\Core\PPHttpConfig => PayPal\Core\PayPalHttpConfig + * PayPal\Core\PPHttpConnection => PayPal\Core\PayPalHttpConnection + * PayPal\Core\PPLoggingLevel => PayPal\Core\PayPalLoggingLevel + * PayPal\Core\PPLoggingManager => PayPal\Core\PayPalLoggingManager + * PayPal\Exception\PPConfigurationException => PayPal\Exception\PayPalConfigurationException + * PayPal\Exception\PPConnectionException => PayPal\Exception\PayPalConnectionException + * PayPal\Exception\PPInvalidCredentialException => PayPal\Exception\PayPalInvalidCredentialException + * PayPal\Exception\PPMissingCredentialException => PayPal\Exception\PayPalMissingCredentialException + * PayPal\Handler\IPPHandler => PayPal\Handler\IPayPalHandler + * PayPal\Transport\PPRestCall => PayPal\Transport\PayPalRestCall + * Namespace Changes and Class Naming Convention + * PayPal\Common\FormatConverter => PayPal\Converter\FormatConverter + * PayPal\Rest\RestHandler => PayPal\Handler\RestHandler + * PayPal\Rest\OauthHandler => PayPal\Handler\OauthHandler + + ## Installation ### - Using Composer @@ -144,16 +171,22 @@ Please visit our [sample sdk_config.ini](https://github.com/paypal/PayPal-PHP-SD ;Caching Configuration [cache] ; If Cache is enabled, it stores the access token retrieved from ClientId and Secret from the -; server into a file provided in constant $CACHE_PATH in PayPal/Cache/AuthorizationCache. +; server into a file provided by the cache.FileName option or by using +; the constant $CACHE_PATH value in PayPal/Cache/AuthorizationCache if the option is omitted/empty. ; If the value is set to 'true', it would try to create a file and store the information. ; For any other value, it would disable it ; Please note, this is a very good performance improvement, and we would encourage you to ; set this up properly to reduce the number of calls, to almost 50% on normal use cases ; PLEASE NOTE: You may need to provide proper write permissions to /var directory under PayPal-PHP-SDK on -; your hosting server +; your hosting server or whichever custom directory you choose cache.enabled=true +; When using a relative path, the cache file is created +; relative to the .php file that is the entry point +; for this request. You can also provide an absolute +; path here +cache.FileName=../auth.cache ``` -##### PLEASE NOTE: You may need to provide proper write permissions to /var directory under PayPal-PHP-SDK on your hosting server +##### PLEASE NOTE: You may need to provide proper write permissions to /var directory under PayPal-PHP-SDK (or your custom directory) on your hosting server ### API Model Constructor diff --git a/lib/PayPal/Api/Address.php b/lib/PayPal/Api/Address.php index 693fa2d..175db20 100644 --- a/lib/PayPal/Api/Address.php +++ b/lib/PayPal/Api/Address.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Address diff --git a/lib/PayPal/Api/Agreement.php b/lib/PayPal/Api/Agreement.php index 6509200..0348de5 100644 --- a/lib/PayPal/Api/Agreement.php +++ b/lib/PayPal/Api/Agreement.php @@ -2,11 +2,12 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; +use PayPal\Core\PayPalConstants; use PayPal\Validation\ArgumentValidator; use PayPal\Api\AgreementTransactions; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class Agreement @@ -28,9 +29,8 @@ use PayPal\Transport\PPRestCall; * @property string create_time * @property string update_time * @property \PayPal\Api\AgreementDetails agreement_details - * @property \PayPal\Api\Links[] links */ -class Agreement extends ResourceModel +class Agreement extends PayPalResourceModel { /** * Identifier of the agreement. @@ -147,31 +147,6 @@ class Agreement extends ResourceModel return $this->start_date; } - /** - * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setStartDate - * - * @param string $start_date - * @return $this - */ - public function setStart_date($start_date) - { - $this->start_date = $start_date; - return $this; - } - - /** - * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getStartDate - * - * @return string - */ - public function getStart_date() - { - return $this->start_date; - } - /** * Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL. * @@ -218,31 +193,6 @@ class Agreement extends ResourceModel return $this->shipping_address; } - /** - * Shipping address object of the agreement, which should be provided if it is different from the default address. - * - * @deprecated Instead use setShippingAddress - * - * @param \PayPal\Api\Address $shipping_address - * @return $this - */ - public function setShipping_address($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * Shipping address object of the agreement, which should be provided if it is different from the default address. - * @deprecated Instead use getShippingAddress - * - * @return \PayPal\Api\Address - */ - public function getShipping_address() - { - return $this->shipping_address; - } - /** * Default merchant preferences from the billing plan are used, unless override preferences are provided here. * @@ -266,31 +216,6 @@ class Agreement extends ResourceModel return $this->override_merchant_preferences; } - /** - * Default merchant preferences from the billing plan are used, unless override preferences are provided here. - * - * @deprecated Instead use setOverrideMerchantPreferences - * - * @param \PayPal\Api\MerchantPreferences $override_merchant_preferences - * @return $this - */ - public function setOverride_merchant_preferences($override_merchant_preferences) - { - $this->override_merchant_preferences = $override_merchant_preferences; - return $this; - } - - /** - * Default merchant preferences from the billing plan are used, unless override preferences are provided here. - * @deprecated Instead use getOverrideMerchantPreferences - * - * @return \PayPal\Api\MerchantPreferences - */ - public function getOverride_merchant_preferences() - { - return $this->override_merchant_preferences; - } - /** * Array of override_charge_model for this agreement if needed to change the default models from the billing plan. * @@ -344,31 +269,6 @@ class Agreement extends ResourceModel ); } - /** - * Array of override_charge_model for this agreement if needed to change the default models from the billing plan. - * - * @deprecated Instead use setOverrideChargeModels - * - * @param \PayPal\Api\OverrideChargeModel $override_charge_models - * @return $this - */ - public function setOverride_charge_models($override_charge_models) - { - $this->override_charge_models = $override_charge_models; - return $this; - } - - /** - * Array of override_charge_model for this agreement if needed to change the default models from the billing plan. - * @deprecated Instead use getOverrideChargeModels - * - * @return \PayPal\Api\OverrideChargeModel - */ - public function getOverride_charge_models() - { - return $this->override_charge_models; - } - /** * Plan details for this agreement. * @@ -415,31 +315,6 @@ class Agreement extends ResourceModel return $this->create_time; } - /** - * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -463,31 +338,6 @@ class Agreement extends ResourceModel return $this->update_time; } - /** - * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Agreement Details * @@ -512,88 +362,20 @@ class Agreement extends ResourceModel } /** - * Agreement Details + * Get Approval Link * - * @deprecated Instead use setAgreementDetails - * - * @param \PayPal\Api\AgreementDetails $agreement-details - * @return $this + * @return null|string */ - public function setAgreement_details($agreement_details) + public function getApprovalLink() { - $this->{"agreement-details"} = $agreement_details; - return $this; - } - - /** - * Agreement Details - * @deprecated Instead use getAgreementDetails - * - * @return \PayPal\Api\AgreementDetails - */ - public function getAgreement_details() - { - return $this->{"agreement-details"}; - } - - /** - * 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)) - ); + return $this->getLink(PayPalConstants::APPROVAL_URL); } /** * Create a new billing agreement by passing the details for the agreement, including the name, description, start date, payer, and billing plan in the request JSON. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Agreement */ public function create($apiContext = null, $restCall = null) @@ -616,7 +398,7 @@ class Agreement extends ResourceModel * * @param $paymentToken * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Agreement */ public function execute($paymentToken, $apiContext = null, $restCall = null) @@ -640,7 +422,7 @@ class Agreement extends ResourceModel * * @param string $agreementId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Agreement */ public static function get($agreementId, $apiContext = null, $restCall = null) @@ -665,7 +447,7 @@ class Agreement extends ResourceModel * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function update($patchRequest, $apiContext = null, $restCall = null) @@ -689,7 +471,7 @@ class Agreement extends ResourceModel * * @param AgreementStateDescriptor $agreementStateDescriptor * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function suspend($agreementStateDescriptor, $apiContext = null, $restCall = null) @@ -713,7 +495,7 @@ class Agreement extends ResourceModel * * @param AgreementStateDescriptor $agreementStateDescriptor * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function reActivate($agreementStateDescriptor, $apiContext = null, $restCall = null) @@ -737,7 +519,7 @@ class Agreement extends ResourceModel * * @param AgreementStateDescriptor $agreementStateDescriptor * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function cancel($agreementStateDescriptor, $apiContext = null, $restCall = null) @@ -761,7 +543,7 @@ class Agreement extends ResourceModel * * @param AgreementStateDescriptor $agreementStateDescriptor * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function billBalance($agreementStateDescriptor, $apiContext = null, $restCall = null) @@ -785,7 +567,7 @@ class Agreement extends ResourceModel * * @param Currency $currency * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function setBalance($currency, $apiContext = null, $restCall = null) @@ -809,7 +591,7 @@ class Agreement extends ResourceModel * * @param string $agreementId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return AgreementTransactions */ public static function transactions($agreementId, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/AgreementDetails.php b/lib/PayPal/Api/AgreementDetails.php index 6bc33bc..94e90cd 100644 --- a/lib/PayPal/Api/AgreementDetails.php +++ b/lib/PayPal/Api/AgreementDetails.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class AgreementDetails @@ -20,7 +20,7 @@ use PayPal\Common\PPModel; * @property string final_payment_date * @property string failed_payment_count */ -class AgreementDetails extends PPModel +class AgreementDetails extends PayPalModel { /** * The outstanding balance for this agreement. @@ -45,31 +45,6 @@ class AgreementDetails extends PPModel return $this->outstanding_balance; } - /** - * The outstanding balance for this agreement. - * - * @deprecated Instead use setOutstandingBalance - * - * @param \PayPal\Api\Currency $outstanding_balance - * @return $this - */ - public function setOutstanding_balance($outstanding_balance) - { - $this->outstanding_balance = $outstanding_balance; - return $this; - } - - /** - * The outstanding balance for this agreement. - * @deprecated Instead use getOutstandingBalance - * - * @return \PayPal\Api\Currency - */ - public function getOutstanding_balance() - { - return $this->outstanding_balance; - } - /** * Number of cycles remaining for this agreement. * @@ -93,31 +68,6 @@ class AgreementDetails extends PPModel return $this->cycles_remaining; } - /** - * Number of cycles remaining for this agreement. - * - * @deprecated Instead use setCyclesRemaining - * - * @param string $cycles_remaining - * @return $this - */ - public function setCycles_remaining($cycles_remaining) - { - $this->cycles_remaining = $cycles_remaining; - return $this; - } - - /** - * Number of cycles remaining for this agreement. - * @deprecated Instead use getCyclesRemaining - * - * @return string - */ - public function getCycles_remaining() - { - return $this->cycles_remaining; - } - /** * Number of cycles completed for this agreement. * @@ -141,31 +91,6 @@ class AgreementDetails extends PPModel return $this->cycles_completed; } - /** - * Number of cycles completed for this agreement. - * - * @deprecated Instead use setCyclesCompleted - * - * @param string $cycles_completed - * @return $this - */ - public function setCycles_completed($cycles_completed) - { - $this->cycles_completed = $cycles_completed; - return $this; - } - - /** - * Number of cycles completed for this agreement. - * @deprecated Instead use getCyclesCompleted - * - * @return string - */ - public function getCycles_completed() - { - return $this->cycles_completed; - } - /** * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format. * @@ -189,31 +114,6 @@ class AgreementDetails extends PPModel return $this->next_billing_date; } - /** - * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format. - * - * @deprecated Instead use setNextBillingDate - * - * @param string $next_billing_date - * @return $this - */ - public function setNext_billing_date($next_billing_date) - { - $this->next_billing_date = $next_billing_date; - return $this; - } - - /** - * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format. - * @deprecated Instead use getNextBillingDate - * - * @return string - */ - public function getNext_billing_date() - { - return $this->next_billing_date; - } - /** * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format. * @@ -237,31 +137,6 @@ class AgreementDetails extends PPModel return $this->last_payment_date; } - /** - * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format. - * - * @deprecated Instead use setLastPaymentDate - * - * @param string $last_payment_date - * @return $this - */ - public function setLast_payment_date($last_payment_date) - { - $this->last_payment_date = $last_payment_date; - return $this; - } - - /** - * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format. - * @deprecated Instead use getLastPaymentDate - * - * @return string - */ - public function getLast_payment_date() - { - return $this->last_payment_date; - } - /** * Last payment amount for this agreement. * @@ -285,31 +160,6 @@ class AgreementDetails extends PPModel return $this->last_payment_amount; } - /** - * Last payment amount for this agreement. - * - * @deprecated Instead use setLastPaymentAmount - * - * @param \PayPal\Api\Currency $last_payment_amount - * @return $this - */ - public function setLast_payment_amount($last_payment_amount) - { - $this->last_payment_amount = $last_payment_amount; - return $this; - } - - /** - * Last payment amount for this agreement. - * @deprecated Instead use getLastPaymentAmount - * - * @return \PayPal\Api\Currency - */ - public function getLast_payment_amount() - { - return $this->last_payment_amount; - } - /** * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format. * @@ -333,31 +183,6 @@ class AgreementDetails extends PPModel return $this->final_payment_date; } - /** - * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format. - * - * @deprecated Instead use setFinalPaymentDate - * - * @param string $final_payment_date - * @return $this - */ - public function setFinal_payment_date($final_payment_date) - { - $this->final_payment_date = $final_payment_date; - return $this; - } - - /** - * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format. - * @deprecated Instead use getFinalPaymentDate - * - * @return string - */ - public function getFinal_payment_date() - { - return $this->final_payment_date; - } - /** * Total number of failed payments for this agreement. * @@ -381,29 +206,4 @@ class AgreementDetails extends PPModel return $this->failed_payment_count; } - /** - * Total number of failed payments for this agreement. - * - * @deprecated Instead use setFailedPaymentCount - * - * @param string $failed_payment_count - * @return $this - */ - public function setFailed_payment_count($failed_payment_count) - { - $this->failed_payment_count = $failed_payment_count; - return $this; - } - - /** - * Total number of failed payments for this agreement. - * @deprecated Instead use getFailedPaymentCount - * - * @return string - */ - public function getFailed_payment_count() - { - return $this->failed_payment_count; - } - } diff --git a/lib/PayPal/Api/AgreementStateDescriptor.php b/lib/PayPal/Api/AgreementStateDescriptor.php index 59d853d..619da31 100644 --- a/lib/PayPal/Api/AgreementStateDescriptor.php +++ b/lib/PayPal/Api/AgreementStateDescriptor.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class AgreementStateDescriptor @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property string note * @property \PayPal\Api\Currency amount */ -class AgreementStateDescriptor extends PPModel +class AgreementStateDescriptor extends PayPalModel { /** * Reason for changing the state of the agreement. diff --git a/lib/PayPal/Api/AgreementTransaction.php b/lib/PayPal/Api/AgreementTransaction.php index b1688c2..6f97f3b 100644 --- a/lib/PayPal/Api/AgreementTransaction.php +++ b/lib/PayPal/Api/AgreementTransaction.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class AgreementTransaction @@ -22,7 +22,7 @@ use PayPal\Common\PPModel; * @property string time_updated * @property string time_zone */ -class AgreementTransaction extends PPModel +class AgreementTransaction extends PayPalModel { /** * Id corresponding to this transaction. @@ -47,31 +47,6 @@ class AgreementTransaction extends PPModel return $this->transaction_id; } - /** - * Id corresponding to this transaction. - * - * @deprecated Instead use setTransactionId - * - * @param string $transaction_id - * @return $this - */ - public function setTransaction_id($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * Id corresponding to this transaction. - * @deprecated Instead use getTransactionId - * - * @return string - */ - public function getTransaction_id() - { - return $this->transaction_id; - } - /** * State of the subscription at this time. * @@ -118,31 +93,6 @@ class AgreementTransaction extends PPModel return $this->transaction_type; } - /** - * Type of transaction, usually Recurring Payment. - * - * @deprecated Instead use setTransactionType - * - * @param string $transaction_type - * @return $this - */ - public function setTransaction_type($transaction_type) - { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of transaction, usually Recurring Payment. - * @deprecated Instead use getTransactionType - * - * @return string - */ - public function getTransaction_type() - { - return $this->transaction_type; - } - /** * Amount for this transaction. * @@ -189,31 +139,6 @@ class AgreementTransaction extends PPModel return $this->fee_amount; } - /** - * Fee amount for this transaction. - * - * @deprecated Instead use setFeeAmount - * - * @param \PayPal\Api\Currency $fee_amount - * @return $this - */ - public function setFee_amount($fee_amount) - { - $this->fee_amount = $fee_amount; - return $this; - } - - /** - * Fee amount for this transaction. - * @deprecated Instead use getFeeAmount - * - * @return \PayPal\Api\Currency - */ - public function getFee_amount() - { - return $this->fee_amount; - } - /** * Net amount for this transaction. * @@ -237,31 +162,6 @@ class AgreementTransaction extends PPModel return $this->net_amount; } - /** - * Net amount for this transaction. - * - * @deprecated Instead use setNetAmount - * - * @param \PayPal\Api\Currency $net_amount - * @return $this - */ - public function setNet_amount($net_amount) - { - $this->net_amount = $net_amount; - return $this; - } - - /** - * Net amount for this transaction. - * @deprecated Instead use getNetAmount - * - * @return \PayPal\Api\Currency - */ - public function getNet_amount() - { - return $this->net_amount; - } - /** * Email id of payer. * @@ -285,31 +185,6 @@ class AgreementTransaction extends PPModel return $this->payer_email; } - /** - * Email id of payer. - * - * @deprecated Instead use setPayerEmail - * - * @param string $payer_email - * @return $this - */ - public function setPayer_email($payer_email) - { - $this->payer_email = $payer_email; - return $this; - } - - /** - * Email id of payer. - * @deprecated Instead use getPayerEmail - * - * @return string - */ - public function getPayer_email() - { - return $this->payer_email; - } - /** * Business name of payer. * @@ -333,31 +208,6 @@ class AgreementTransaction extends PPModel return $this->payer_name; } - /** - * Business name of payer. - * - * @deprecated Instead use setPayerName - * - * @param string $payer_name - * @return $this - */ - public function setPayer_name($payer_name) - { - $this->payer_name = $payer_name; - return $this; - } - - /** - * Business name of payer. - * @deprecated Instead use getPayerName - * - * @return string - */ - public function getPayer_name() - { - return $this->payer_name; - } - /** * Time at which this transaction happened. * @@ -381,31 +231,6 @@ class AgreementTransaction extends PPModel return $this->time_updated; } - /** - * Time at which this transaction happened. - * - * @deprecated Instead use setTimeUpdated - * - * @param string $time_updated - * @return $this - */ - public function setTime_updated($time_updated) - { - $this->time_updated = $time_updated; - return $this; - } - - /** - * Time at which this transaction happened. - * @deprecated Instead use getTimeUpdated - * - * @return string - */ - public function getTime_updated() - { - return $this->time_updated; - } - /** * Time zone of time_updated field. * @@ -429,29 +254,4 @@ class AgreementTransaction extends PPModel return $this->time_zone; } - /** - * Time zone of time_updated field. - * - * @deprecated Instead use setTimeZone - * - * @param string $time_zone - * @return $this - */ - public function setTime_zone($time_zone) - { - $this->time_zone = $time_zone; - return $this; - } - - /** - * Time zone of time_updated field. - * @deprecated Instead use getTimeZone - * - * @return string - */ - public function getTime_zone() - { - return $this->time_zone; - } - } diff --git a/lib/PayPal/Api/AgreementTransactions.php b/lib/PayPal/Api/AgreementTransactions.php index 9299375..30d4527 100644 --- a/lib/PayPal/Api/AgreementTransactions.php +++ b/lib/PayPal/Api/AgreementTransactions.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class AgreementTransactions @@ -13,7 +13,7 @@ use PayPal\Common\PPModel; * * @property \PayPal\Api\AgreementTransaction[] agreement_transaction_list */ -class AgreementTransactions extends PPModel +class AgreementTransactions extends PayPalModel { /** * Array of agreement_transaction object. @@ -68,29 +68,4 @@ class AgreementTransactions extends PPModel ); } - /** - * Array of agreement_transaction object. - * - * @deprecated Instead use setAgreementTransactionList - * - * @param \PayPal\Api\AgreementTransaction $agreement_transaction_list - * @return $this - */ - public function setAgreement_transaction_list($agreement_transaction_list) - { - $this->agreement_transaction_list = $agreement_transaction_list; - return $this; - } - - /** - * Array of agreement_transaction object. - * @deprecated Instead use getAgreementTransactionList - * - * @return \PayPal\Api\AgreementTransaction - */ - public function getAgreement_transaction_list() - { - return $this->agreement_transaction_list; - } - } diff --git a/lib/PayPal/Api/Amount.php b/lib/PayPal/Api/Amount.php index 5a90331..9678b09 100644 --- a/lib/PayPal/Api/Amount.php +++ b/lib/PayPal/Api/Amount.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Validation\NumericValidator; -use PayPal\Common\FormatConverter; +use PayPal\Converter\FormatConverter; /** * Class Amount @@ -18,7 +18,7 @@ use PayPal\Common\FormatConverter; * @property string total * @property \PayPal\Api\Details details */ -class Amount extends PPModel +class Amount extends PayPalModel { /** * 3 letter currency code diff --git a/lib/PayPal/Api/Authorization.php b/lib/PayPal/Api/Authorization.php index 4ef44dd..5f0a23b 100644 --- a/lib/PayPal/Api/Authorization.php +++ b/lib/PayPal/Api/Authorization.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\Capture; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; /** @@ -29,26 +29,8 @@ use PayPal\Validation\ArgumentValidator; * @property string valid_until * @property \PayPal\Api\Links links */ -class Authorization extends PPModel implements IResource +class Authorization extends PayPalModel implements IResource { - /** - * OAuth Credentials to use for this call - * - * @var \PayPal\Auth\OAuthTokenCredential $credential - */ - protected static $credential; - - /** - * Sets Credential - * - * @deprecated Pass ApiContext to create/get methods instead - * @param \PayPal\Auth\OAuthTokenCredential $credential - */ - public static function setCredential($credential) - { - self::$credential = $credential; - } - /** * Identifier of the authorization transaction. * @@ -97,31 +79,6 @@ class Authorization extends PPModel implements IResource return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated in UTC ISO8601 format. * @@ -146,31 +103,6 @@ class Authorization extends PPModel implements IResource return $this->update_time; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Amount being authorized for. * @@ -219,31 +151,6 @@ class Authorization extends PPModel implements IResource return $this->payment_mode; } - /** - * specifies payment mode of the transaction - * - * @deprecated Instead use setPaymentMode - * - * @param string $payment_mode - * @return $this - */ - public function setPayment_mode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * specifies payment mode of the transaction - * @deprecated Instead use getPaymentMode - * - * @return string - */ - public function getPayment_mode() - { - return $this->payment_mode; - } - /** * State of the authorization transaction. * Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"] @@ -292,31 +199,6 @@ class Authorization extends PPModel implements IResource return $this->protection_eligibility; } - /** - * Protection Eligibility of the Payer - * - * @deprecated Instead use setProtectionEligibility - * - * @param string $protection_eligibility - * @return $this - */ - public function setProtection_eligibility($protection_eligibility) - { - $this->protection_eligibility = $protection_eligibility; - return $this; - } - - /** - * Protection Eligibility of the Payer - * @deprecated Instead use getProtectionEligibility - * - * @return string - */ - public function getProtection_eligibility() - { - return $this->protection_eligibility; - } - /** * Protection Eligibility Type of the Payer * Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] @@ -341,31 +223,6 @@ class Authorization extends PPModel implements IResource return $this->protection_eligibility_type; } - /** - * Protection Eligibility Type of the Payer - * - * @deprecated Instead use setProtectionEligibilityType - * - * @param string $protection_eligibility_type - * @return $this - */ - public function setProtection_eligibility_type($protection_eligibility_type) - { - $this->protection_eligibility_type = $protection_eligibility_type; - return $this; - } - - /** - * Protection Eligibility Type of the Payer - * @deprecated Instead use getProtectionEligibilityType - * - * @return string - */ - public function getProtection_eligibility_type() - { - return $this->protection_eligibility_type; - } - /** * ID of the Payment resource that this transaction is based on. * @@ -390,31 +247,6 @@ class Authorization extends PPModel implements IResource return $this->parent_payment; } - /** - * ID of the Payment resource that this transaction is based on. - * - * @deprecated Instead use setParentPayment - * - * @param string $parent_payment - * @return $this - */ - public function setParent_payment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * @deprecated Instead use getParentPayment - * - * @return string - */ - public function getParent_payment() - { - return $this->parent_payment; - } - /** * Expected clearing time for eCheck Transactions * @@ -439,31 +271,6 @@ class Authorization extends PPModel implements IResource return $this->clearing_time; } - /** - * Expected clearing time for eCheck Transactions - * - * @deprecated Instead use setClearingTime - * - * @param string $clearing_time - * @return $this - */ - public function setClearing_time($clearing_time) - { - $this->clearing_time = $clearing_time; - return $this; - } - - /** - * Expected clearing time for eCheck Transactions - * @deprecated Instead use getClearingTime - * - * @return string - */ - public function getClearing_time() - { - return $this->clearing_time; - } - /** * Date/Time until which funds may be captured against this resource. * @@ -488,31 +295,6 @@ class Authorization extends PPModel implements IResource return $this->valid_until; } - /** - * Date/Time until which funds may be captured against this resource. - * - * @deprecated Instead use setValidUntil - * - * @param string $valid_until - * @return $this - */ - public function setValid_until($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Date/Time until which funds may be captured against this resource. - * @deprecated Instead use getValidUntil - * - * @return string - */ - public function getValid_until() - { - return $this->valid_until; - } - /** * Sets Links * @@ -552,8 +334,8 @@ class Authorization extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad); $ret = new Authorization(); $ret->fromJson($json); return $ret; @@ -575,8 +357,8 @@ class Authorization extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/capture", "POST", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/authorization/{$this->getId()}/capture", "POST", $payLoad); $ret = new Capture(); $ret->fromJson($json); return $ret; @@ -596,8 +378,8 @@ class Authorization extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/void", "POST", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/authorization/{$this->getId()}/void", "POST", $payLoad); $this->fromJson($json); return $this; } @@ -616,8 +398,8 @@ class Authorization extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad); $this->fromJson($json); return $this; } diff --git a/lib/PayPal/Api/BankAccount.php b/lib/PayPal/Api/BankAccount.php index fb87bc5..99750f1 100644 --- a/lib/PayPal/Api/BankAccount.php +++ b/lib/PayPal/Api/BankAccount.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class BankAccount @@ -37,9 +37,8 @@ use PayPal\Transport\PPRestCall; * @property string create_time * @property string update_time * @property string valid_until - * @property \PayPal\Api\Links[] links */ -class BankAccount extends ResourceModel +class BankAccount extends PayPalResourceModel { /** * ID of the bank account being saved for later use. @@ -87,31 +86,6 @@ class BankAccount extends ResourceModel return $this->account_number; } - /** - * Account number in either IBAN (max length 34) or BBAN (max length 17) format. - * - * @deprecated Instead use setAccountNumber - * - * @param string $account_number - * @return $this - */ - public function setAccount_number($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * Account number in either IBAN (max length 34) or BBAN (max length 17) format. - * @deprecated Instead use getAccountNumber - * - * @return string - */ - public function getAccount_number() - { - return $this->account_number; - } - /** * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number. * Valid Values: ["BBAN", "IBAN"] @@ -136,31 +110,6 @@ class BankAccount extends ResourceModel return $this->account_number_type; } - /** - * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number. - * - * @deprecated Instead use setAccountNumberType - * - * @param string $account_number_type - * @return $this - */ - public function setAccount_number_type($account_number_type) - { - $this->account_number_type = $account_number_type; - return $this; - } - - /** - * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number. - * @deprecated Instead use getAccountNumberType - * - * @return string - */ - public function getAccount_number_type() - { - return $this->account_number_type; - } - /** * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. * @@ -184,31 +133,6 @@ class BankAccount extends ResourceModel return $this->routing_number; } - /** - * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. - * - * @deprecated Instead use setRoutingNumber - * - * @param string $routing_number - * @return $this - */ - public function setRouting_number($routing_number) - { - $this->routing_number = $routing_number; - return $this; - } - - /** - * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. - * @deprecated Instead use getRoutingNumber - * - * @return string - */ - public function getRouting_number() - { - return $this->routing_number; - } - /** * Type of the bank account. * Valid Values: ["CHECKING", "SAVINGS"] @@ -233,31 +157,6 @@ class BankAccount extends ResourceModel return $this->account_type; } - /** - * Type of the bank account. - * - * @deprecated Instead use setAccountType - * - * @param string $account_type - * @return $this - */ - public function setAccount_type($account_type) - { - $this->account_type = $account_type; - return $this; - } - - /** - * Type of the bank account. - * @deprecated Instead use getAccountType - * - * @return string - */ - public function getAccount_type() - { - return $this->account_type; - } - /** * A customer designated name. * @@ -281,31 +180,6 @@ class BankAccount extends ResourceModel return $this->account_name; } - /** - * A customer designated name. - * - * @deprecated Instead use setAccountName - * - * @param string $account_name - * @return $this - */ - public function setAccount_name($account_name) - { - $this->account_name = $account_name; - return $this; - } - - /** - * A customer designated name. - * @deprecated Instead use getAccountName - * - * @return string - */ - public function getAccount_name() - { - return $this->account_name; - } - /** * Type of the check when this information was obtained through a check by the facilitator or merchant. * Valid Values: ["PERSONAL", "COMPANY"] @@ -330,31 +204,6 @@ class BankAccount extends ResourceModel return $this->check_type; } - /** - * Type of the check when this information was obtained through a check by the facilitator or merchant. - * - * @deprecated Instead use setCheckType - * - * @param string $check_type - * @return $this - */ - public function setCheck_type($check_type) - { - $this->check_type = $check_type; - return $this; - } - - /** - * Type of the check when this information was obtained through a check by the facilitator or merchant. - * @deprecated Instead use getCheckType - * - * @return string - */ - public function getCheck_type() - { - return $this->check_type; - } - /** * How the check was obtained from the customer, if check was the source of the information provided. * Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"] @@ -379,31 +228,6 @@ class BankAccount extends ResourceModel return $this->auth_type; } - /** - * How the check was obtained from the customer, if check was the source of the information provided. - * - * @deprecated Instead use setAuthType - * - * @param string $auth_type - * @return $this - */ - public function setAuth_type($auth_type) - { - $this->auth_type = $auth_type; - return $this; - } - - /** - * How the check was obtained from the customer, if check was the source of the information provided. - * @deprecated Instead use getAuthType - * - * @return string - */ - public function getAuth_type() - { - return $this->auth_type; - } - /** * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. * @@ -427,31 +251,6 @@ class BankAccount extends ResourceModel return $this->auth_capture_timestamp; } - /** - * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. - * - * @deprecated Instead use setAuthCaptureTimestamp - * - * @param string $auth_capture_timestamp - * @return $this - */ - public function setAuth_capture_timestamp($auth_capture_timestamp) - { - $this->auth_capture_timestamp = $auth_capture_timestamp; - return $this; - } - - /** - * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. - * @deprecated Instead use getAuthCaptureTimestamp - * - * @return string - */ - public function getAuth_capture_timestamp() - { - return $this->auth_capture_timestamp; - } - /** * Name of the bank. * @@ -475,31 +274,6 @@ class BankAccount extends ResourceModel return $this->bank_name; } - /** - * Name of the bank. - * - * @deprecated Instead use setBankName - * - * @param string $bank_name - * @return $this - */ - public function setBank_name($bank_name) - { - $this->bank_name = $bank_name; - return $this; - } - - /** - * Name of the bank. - * @deprecated Instead use getBankName - * - * @return string - */ - public function getBank_name() - { - return $this->bank_name; - } - /** * 2 letter country code of the Bank. * @@ -523,31 +297,6 @@ class BankAccount extends ResourceModel return $this->country_code; } - /** - * 2 letter country code of the Bank. - * - * @deprecated Instead use setCountryCode - * - * @param string $country_code - * @return $this - */ - public function setCountry_code($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * 2 letter country code of the Bank. - * @deprecated Instead use getCountryCode - * - * @return string - */ - public function getCountry_code() - { - return $this->country_code; - } - /** * Account holder's first name. * @@ -571,31 +320,6 @@ class BankAccount extends ResourceModel return $this->first_name; } - /** - * Account holder's first name. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * Account holder's first name. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Account holder's last name. * @@ -619,31 +343,6 @@ class BankAccount extends ResourceModel return $this->last_name; } - /** - * Account holder's last name. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Account holder's last name. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Birth date of the bank account holder. * @@ -667,31 +366,6 @@ class BankAccount extends ResourceModel return $this->birth_date; } - /** - * Birth date of the bank account holder. - * - * @deprecated Instead use setBirthDate - * - * @param string $birth_date - * @return $this - */ - public function setBirth_date($birth_date) - { - $this->birth_date = $birth_date; - return $this; - } - - /** - * Birth date of the bank account holder. - * @deprecated Instead use getBirthDate - * - * @return string - */ - public function getBirth_date() - { - return $this->birth_date; - } - /** * Billing address. * @@ -715,31 +389,6 @@ class BankAccount extends ResourceModel return $this->billing_address; } - /** - * Billing address. - * - * @deprecated Instead use setBillingAddress - * - * @param \PayPal\Api\Address $billing_address - * @return $this - */ - public function setBilling_address($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing address. - * @deprecated Instead use getBillingAddress - * - * @return \PayPal\Api\Address - */ - public function getBilling_address() - { - return $this->billing_address; - } - /** * State of this funding instrument. * Valid Values: ["ACTIVE", "INACTIVE", "DELETED"] @@ -788,31 +437,6 @@ class BankAccount extends ResourceModel return $this->confirmation_status; } - /** - * Confirmation status of a bank account. - * - * @deprecated Instead use setConfirmationStatus - * - * @param string $confirmation_status - * @return $this - */ - public function setConfirmation_status($confirmation_status) - { - $this->confirmation_status = $confirmation_status; - return $this; - } - - /** - * Confirmation status of a bank account. - * @deprecated Instead use getConfirmationStatus - * - * @return string - */ - public function getConfirmation_status() - { - return $this->confirmation_status; - } - /** * Deprecated - Use external_customer_id instead. * @@ -836,31 +460,6 @@ class BankAccount extends ResourceModel return $this->payer_id; } - /** - * Deprecated - Use external_customer_id instead. - * - * @deprecated Instead use setPayerId - * - * @param string $payer_id - * @return $this - */ - public function setPayer_id($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * Deprecated - Use external_customer_id instead. - * @deprecated Instead use getPayerId - * - * @return string - */ - public function getPayer_id() - { - return $this->payer_id; - } - /** * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. * @@ -884,30 +483,6 @@ class BankAccount extends ResourceModel return $this->external_customer_id; } - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } /** * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt. @@ -932,31 +507,6 @@ class BankAccount extends ResourceModel return $this->merchant_id; } - /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt. - * - * @deprecated Instead use setMerchantId - * - * @param string $merchant_id - * @return $this - */ - public function setMerchant_id($merchant_id) - { - $this->merchant_id = $merchant_id; - return $this; - } - - /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt. - * @deprecated Instead use getMerchantId - * - * @return string - */ - public function getMerchant_id() - { - return $this->merchant_id; - } - /** * Time the resource was created. * @@ -980,31 +530,6 @@ class BankAccount extends ResourceModel return $this->create_time; } - /** - * Time the resource was created. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated. * @@ -1028,31 +553,6 @@ class BankAccount extends ResourceModel return $this->update_time; } - /** - * Time the resource was last updated. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Date/Time until this resource can be used to fund a payment. * @@ -1076,89 +576,11 @@ class BankAccount extends ResourceModel return $this->valid_until; } - /** - * Date/Time until this resource can be used to fund a payment. - * - * @deprecated Instead use setValidUntil - * - * @param string $valid_until - * @return $this - */ - public function setValid_until($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Date/Time until this resource can be used to fund a payment. - * @deprecated Instead use getValidUntil - * - * @return string - */ - public function getValid_until() - { - return $this->valid_until; - } - - /** - * 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)) - ); - } - /** * Creates a new Bank Account Resource. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return BankAccount */ public function create($apiContext = null, $restCall = null) @@ -1181,7 +603,7 @@ class BankAccount extends ResourceModel * * @param string $bankAccountId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return BankAccount */ public static function get($bankAccountId, $apiContext = null, $restCall = null) @@ -1205,7 +627,7 @@ class BankAccount extends ResourceModel * Delete the bank account resource for the given identifier. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) @@ -1228,7 +650,7 @@ class BankAccount extends ResourceModel * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return BankAccount */ public function update($patchRequest, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/BankAccountsList.php b/lib/PayPal/Api/BankAccountsList.php index 540a1f1..9120941 100644 --- a/lib/PayPal/Api/BankAccountsList.php +++ b/lib/PayPal/Api/BankAccountsList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class BankAccountsList @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property int count * @property string next_id */ -class BankAccountsList extends PPModel +class BankAccountsList extends PayPalModel { /** * A list of bank account resources @@ -70,31 +70,6 @@ class BankAccountsList extends PPModel ); } - /** - * A list of bank account resources - * - * @deprecated Instead use setBankAccounts - * - * @param \PayPal\Api\BankAccount $bank-accounts - * @return $this - */ - public function setBank_accounts($bank_accounts) - { - $this->{"bank-accounts"} = $bank_accounts; - return $this; - } - - /** - * A list of bank account resources - * @deprecated Instead use getBankAccounts - * - * @return \PayPal\Api\BankAccount - */ - public function getBank_accounts() - { - return $this->{"bank-accounts"}; - } - /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @@ -141,29 +116,4 @@ class BankAccountsList extends PPModel return $this->next_id; } - /** - * Identifier of the next element to get the next range of results. - * - * @deprecated Instead use setNextId - * - * @param string $next_id - * @return $this - */ - public function setNext_id($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * @deprecated Instead use getNextId - * - * @return string - */ - public function getNext_id() - { - return $this->next_id; - } - } diff --git a/lib/PayPal/Api/BankToken.php b/lib/PayPal/Api/BankToken.php index 93d8dac..6cbee49 100644 --- a/lib/PayPal/Api/BankToken.php +++ b/lib/PayPal/Api/BankToken.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class BankToken @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string external_customer_id * @property string mandate_reference_number */ -class BankToken extends PPModel +class BankToken extends PayPalModel { /** * ID of a previously saved Bank resource using /vault/bank API. @@ -40,31 +40,6 @@ class BankToken extends PPModel return $this->bank_id; } - /** - * ID of a previously saved Bank resource using /vault/bank API. - * - * @deprecated Instead use setBankId - * - * @param string $bank_id - * @return $this - */ - public function setBank_id($bank_id) - { - $this->bank_id = $bank_id; - return $this; - } - - /** - * ID of a previously saved Bank resource using /vault/bank API. - * @deprecated Instead use getBankId - * - * @return string - */ - public function getBank_id() - { - return $this->bank_id; - } - /** * The unique identifier of the payer used when saving this bank using /vault/bank API. * @@ -88,31 +63,6 @@ class BankToken extends PPModel return $this->external_customer_id; } - /** - * The unique identifier of the payer used when saving this bank using /vault/bank API. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this bank using /vault/bank API. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } - /** * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). * @@ -136,29 +86,4 @@ class BankToken extends PPModel return $this->mandate_reference_number; } - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * - * @deprecated Instead use setMandateReferenceNumber - * - * @param string $mandate_reference_number - * @return $this - */ - public function setMandate_reference_number($mandate_reference_number) - { - $this->mandate_reference_number = $mandate_reference_number; - return $this; - } - - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * @deprecated Instead use getMandateReferenceNumber - * - * @return string - */ - public function getMandate_reference_number() - { - return $this->mandate_reference_number; - } - } diff --git a/lib/PayPal/Api/BaseAddress.php b/lib/PayPal/Api/BaseAddress.php index d5ab7cf..2087b61 100644 --- a/lib/PayPal/Api/BaseAddress.php +++ b/lib/PayPal/Api/BaseAddress.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class BaseAddress @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property string postal_code * @property string state */ -class BaseAddress extends PPModel +class BaseAddress extends PayPalModel { /** * Line 1 of the Address (eg. number, street, etc). @@ -112,31 +112,6 @@ class BaseAddress extends PPModel return $this->country_code; } - /** - * 2 letter country code. - * - * @deprecated Instead use setCountryCode - * - * @param string $country_code - * @return $this - */ - public function setCountry_code($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * 2 letter country code. - * @deprecated Instead use getCountryCode - * - * @return string - */ - public function getCountry_code() - { - return $this->country_code; - } - /** * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. * @@ -160,31 +135,6 @@ class BaseAddress extends PPModel return $this->postal_code; } - /** - * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. - * - * @deprecated Instead use setPostalCode - * - * @param string $postal_code - * @return $this - */ - public function setPostal_code($postal_code) - { - $this->postal_code = $postal_code; - return $this; - } - - /** - * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. - * @deprecated Instead use getPostalCode - * - * @return string - */ - public function getPostal_code() - { - return $this->postal_code; - } - /** * 2 letter code for US states, and the equivalent for other countries. * diff --git a/lib/PayPal/Api/BillingInfo.php b/lib/PayPal/Api/BillingInfo.php index fdc1edf..3b0a4cd 100644 --- a/lib/PayPal/Api/BillingInfo.php +++ b/lib/PayPal/Api/BillingInfo.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class BillingInfo @@ -21,7 +21,7 @@ use PayPal\Common\PPModel; * @property string notification_channel * @property \PayPal\Api\Phone phone */ -class BillingInfo extends PPModel +class BillingInfo extends PayPalModel { /** * Email address of the invoice recipient. 260 characters max. @@ -69,31 +69,6 @@ class BillingInfo extends PPModel return $this->first_name; } - /** - * First name of the invoice recipient. 30 characters max. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the invoice recipient. 30 characters max. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Last name of the invoice recipient. 30 characters max. * @@ -117,31 +92,6 @@ class BillingInfo extends PPModel return $this->last_name; } - /** - * Last name of the invoice recipient. 30 characters max. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Company business name of the invoice recipient. 100 characters max. * @@ -165,31 +115,6 @@ class BillingInfo extends PPModel return $this->business_name; } - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @deprecated Instead use setBusinessName - * - * @param string $business_name - * @return $this - */ - public function setBusiness_name($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * @deprecated Instead use getBusinessName - * - * @return string - */ - public function getBusiness_name() - { - return $this->business_name; - } - /** * Address of the invoice recipient. * @@ -260,31 +185,6 @@ class BillingInfo extends PPModel return $this->additional_info; } - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @deprecated Instead use setAdditionalInfo - * - * @param string $additional_info - * @return $this - */ - public function setAdditional_info($additional_info) - { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * @deprecated Instead use getAdditionalInfo - * - * @return string - */ - public function getAdditional_info() - { - return $this->additional_info; - } - /** * Preferred notification channel of the payer. Email by default. * Valid Values: ["SMS", "EMAIL"] @@ -309,31 +209,6 @@ class BillingInfo extends PPModel return $this->notification_channel; } - /** - * Preferred notification channel of the payer. Email by default. - * - * @deprecated Instead use setNotificationChannel - * - * @param string $notification_channel - * @return $this - */ - public function setNotification_channel($notification_channel) - { - $this->notification_channel = $notification_channel; - return $this; - } - - /** - * Preferred notification channel of the payer. Email by default. - * @deprecated Instead use getNotificationChannel - * - * @return string - */ - public function getNotification_channel() - { - return $this->notification_channel; - } - /** * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS. * diff --git a/lib/PayPal/Api/CancelNotification.php b/lib/PayPal/Api/CancelNotification.php index 2f5c115..612b302 100644 --- a/lib/PayPal/Api/CancelNotification.php +++ b/lib/PayPal/Api/CancelNotification.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class CancelNotification @@ -16,7 +16,7 @@ use PayPal\Common\PPModel; * @property bool send_to_merchant * @property bool send_to_payer */ -class CancelNotification extends PPModel +class CancelNotification extends PayPalModel { /** * Subject of the notification. @@ -87,31 +87,6 @@ class CancelNotification extends PPModel return $this->send_to_merchant; } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @deprecated Instead use setSendToMerchant - * - * @param bool $send_to_merchant - * @return $this - */ - public function setSend_to_merchant($send_to_merchant) - { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * @deprecated Instead use getSendToMerchant - * - * @return bool - */ - public function getSend_to_merchant() - { - return $this->send_to_merchant; - } - /** * A flag indicating whether a copy of the email has to be sent to the payer. * @@ -135,29 +110,4 @@ class CancelNotification extends PPModel return $this->send_to_payer; } - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * - * @deprecated Instead use setSendToPayer - * - * @param bool $send_to_payer - * @return $this - */ - public function setSend_to_payer($send_to_payer) - { - $this->send_to_payer = $send_to_payer; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * @deprecated Instead use getSendToPayer - * - * @return bool - */ - public function getSend_to_payer() - { - return $this->send_to_payer; - } - } diff --git a/lib/PayPal/Api/Capture.php b/lib/PayPal/Api/Capture.php index 1fef9cb..b679eae 100644 --- a/lib/PayPal/Api/Capture.php +++ b/lib/PayPal/Api/Capture.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\Refund; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; /** @@ -25,26 +25,8 @@ use PayPal\Validation\ArgumentValidator; * @property string parent_payment * @property \PayPal\Api\Links links */ -class Capture extends PPModel implements IResource +class Capture extends PayPalModel implements IResource { - /** - * OAuth Credentials to use for this call - * - * @var \PayPal\Auth\OAuthTokenCredential $credential - */ - protected static $credential; - - /** - * Sets Credential - * - * @deprecated Pass ApiContext to create/get methods instead - * @param \PayPal\Auth\OAuthTokenCredential $credential - */ - public static function setCredential($credential) - { - self::$credential = $credential; - } - /** * Identifier of the Capture transaction. * @@ -93,31 +75,6 @@ class Capture extends PPModel implements IResource return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated in UTC ISO8601 format. * @@ -142,31 +99,6 @@ class Capture extends PPModel implements IResource return $this->update_time; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true. * @@ -215,31 +147,6 @@ class Capture extends PPModel implements IResource return $this->is_final_capture; } - /** - * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. - * - * @deprecated Instead use setIsFinalCapture - * - * @param bool $is_final_capture - * @return $this - */ - public function setIs_final_capture($is_final_capture) - { - $this->is_final_capture = $is_final_capture; - return $this; - } - - /** - * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. - * @deprecated Instead use getIsFinalCapture - * - * @return bool - */ - public function getIs_final_capture() - { - return $this->is_final_capture; - } - /** * State of the capture transaction. * Valid Values: ["pending", "completed", "refunded", "partially_refunded"] @@ -288,31 +195,6 @@ class Capture extends PPModel implements IResource return $this->parent_payment; } - /** - * ID of the Payment resource that this transaction is based on. - * - * @deprecated Instead use setParentPayment - * - * @param string $parent_payment - * @return $this - */ - public function setParent_payment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * @deprecated Instead use getParentPayment - * - * @return string - */ - public function getParent_payment() - { - return $this->parent_payment; - } - /** * Sets Links * @@ -352,8 +234,8 @@ class Capture extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad); $ret = new Capture(); $ret->fromJson($json); return $ret; @@ -375,8 +257,8 @@ class Capture extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad); $ret = new Refund(); $ret->fromJson($json); return $ret; diff --git a/lib/PayPal/Api/CarrierAccountToken.php b/lib/PayPal/Api/CarrierAccountToken.php index 5539ad9..1ed4cdc 100644 --- a/lib/PayPal/Api/CarrierAccountToken.php +++ b/lib/PayPal/Api/CarrierAccountToken.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; @@ -16,7 +16,7 @@ use PayPal\Rest\ApiContext; * @property string carrier_account_id * @property string external_customer_id */ -class CarrierAccountToken extends PPModel +class CarrierAccountToken extends PayPalModel { /** * ID of a previously saved carrier account resource. @@ -41,31 +41,6 @@ class CarrierAccountToken extends PPModel return $this->carrier_account_id; } - /** - * ID of a previously saved carrier account resource. - * - * @deprecated Instead use setCarrierAccountId - * - * @param string $carrier_account_id - * @return $this - */ - public function setCarrier_account_id($carrier_account_id) - { - $this->carrier_account_id = $carrier_account_id; - return $this; - } - - /** - * ID of a previously saved carrier account resource. - * @deprecated Instead use getCarrierAccountId - * - * @return string - */ - public function getCarrier_account_id() - { - return $this->carrier_account_id; - } - /** * The unique identifier of the payer used when saving this carrier account instrument. * @@ -89,29 +64,4 @@ class CarrierAccountToken extends PPModel return $this->external_customer_id; } - /** - * The unique identifier of the payer used when saving this carrier account instrument. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this carrier account instrument. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } - } diff --git a/lib/PayPal/Api/CartBase.php b/lib/PayPal/Api/CartBase.php index a627b6c..03f2a7a 100644 --- a/lib/PayPal/Api/CartBase.php +++ b/lib/PayPal/Api/CartBase.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -22,7 +22,7 @@ use PayPal\Rest\ApiContext; * @property \PayPal\Api\PaymentOptions payment_options * @property \PayPal\Api\ItemList item_list */ -class CartBase extends PPModel +class CartBase extends PayPalModel { /** * Amount being collected. @@ -120,31 +120,6 @@ class CartBase extends PPModel return $this->note_to_payee; } - /** - * Note to the recipient of the funds in this transaction. - * - * @deprecated Instead use setNoteToPayee - * - * @param string $note_to_payee - * @return $this - */ - public function setNote_to_payee($note_to_payee) - { - $this->note_to_payee = $note_to_payee; - return $this; - } - - /** - * Note to the recipient of the funds in this transaction. - * @deprecated Instead use getNoteToPayee - * - * @return string - */ - public function getNote_to_payee() - { - return $this->note_to_payee; - } - /** * free-form field for the use of clients * @@ -193,31 +168,6 @@ class CartBase extends PPModel return $this->invoice_number; } - /** - * invoice number to track this payment - * - * @deprecated Instead use setInvoiceNumber - * - * @param string $invoice_number - * @return $this - */ - public function setInvoice_number($invoice_number) - { - $this->invoice_number = $invoice_number; - return $this; - } - - /** - * invoice number to track this payment - * @deprecated Instead use getInvoiceNumber - * - * @return string - */ - public function getInvoice_number() - { - return $this->invoice_number; - } - /** * Soft descriptor used when charging this funding source. * @@ -242,31 +192,6 @@ class CartBase extends PPModel return $this->soft_descriptor; } - /** - * Soft descriptor used when charging this funding source. - * - * @deprecated Instead use setSoftDescriptor - * - * @param string $soft_descriptor - * @return $this - */ - public function setSoft_descriptor($soft_descriptor) - { - $this->soft_descriptor = $soft_descriptor; - return $this; - } - - /** - * Soft descriptor used when charging this funding source. - * @deprecated Instead use getSoftDescriptor - * - * @return string - */ - public function getSoft_descriptor() - { - return $this->soft_descriptor; - } - /** * Payment options requested for this purchase unit * @@ -291,31 +216,6 @@ class CartBase extends PPModel return $this->payment_options; } - /** - * Payment options requested for this purchase unit - * - * @deprecated Instead use setPaymentOptions - * - * @param \PayPal\Api\PaymentOptions $payment_options - * @return $this - */ - public function setPayment_options($payment_options) - { - $this->payment_options = $payment_options; - return $this; - } - - /** - * Payment options requested for this purchase unit - * @deprecated Instead use getPaymentOptions - * - * @return \PayPal\Api\PaymentOptions - */ - public function getPayment_options() - { - return $this->payment_options; - } - /** * List of items being paid for. * @@ -340,29 +240,4 @@ class CartBase extends PPModel return $this->item_list; } - /** - * List of items being paid for. - * - * @deprecated Instead use setItemList - * - * @param \PayPal\Api\ItemList $item_list - * @return $this - */ - public function setItem_list($item_list) - { - $this->item_list = $item_list; - return $this; - } - - /** - * List of items being paid for. - * @deprecated Instead use getItemList - * - * @return \PayPal\Api\ItemList - */ - public function getItem_list() - { - return $this->item_list; - } - } diff --git a/lib/PayPal/Api/ChargeModel.php b/lib/PayPal/Api/ChargeModel.php index 2a929f3..de486fe 100644 --- a/lib/PayPal/Api/ChargeModel.php +++ b/lib/PayPal/Api/ChargeModel.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ChargeModel @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string type * @property \PayPal\Api\Currency amount */ -class ChargeModel extends PPModel +class ChargeModel extends PayPalModel { /** * Identifier of the charge model. 128 characters max. diff --git a/lib/PayPal/Api/Cost.php b/lib/PayPal/Api/Cost.php index f6baf37..b1e11a1 100644 --- a/lib/PayPal/Api/Cost.php +++ b/lib/PayPal/Api/Cost.php @@ -2,9 +2,9 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Validation\NumericValidator; -use PayPal\Common\FormatConverter; +use PayPal\Converter\FormatConverter; /** * Class Cost @@ -16,7 +16,7 @@ use PayPal\Common\FormatConverter; * @property string percent * @property \PayPal\Api\Currency amount */ -class Cost extends PPModel +class Cost extends PayPalModel { /** * Cost in percent. Range of 0 to 100. diff --git a/lib/PayPal/Api/CreateProfileResponse.php b/lib/PayPal/Api/CreateProfileResponse.php index e086ba3..64f79da 100644 --- a/lib/PayPal/Api/CreateProfileResponse.php +++ b/lib/PayPal/Api/CreateProfileResponse.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class CreateProfileResponse @@ -13,7 +13,7 @@ use PayPal\Common\PPModel; * * @property string id */ -class CreateProfileResponse extends PPModel +class CreateProfileResponse extends PayPalModel { /** * ID of the payment web experience profile. diff --git a/lib/PayPal/Api/Credit.php b/lib/PayPal/Api/Credit.php index 857233e..2693778 100644 --- a/lib/PayPal/Api/Credit.php +++ b/lib/PayPal/Api/Credit.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Credit @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string type * @property string terms */ -class Credit extends PPModel +class Credit extends PayPalModel { /** * Unique identifier of credit resource. diff --git a/lib/PayPal/Api/CreditCard.php b/lib/PayPal/Api/CreditCard.php index 0552c1a..a7dccbb 100644 --- a/lib/PayPal/Api/CreditCard.php +++ b/lib/PayPal/Api/CreditCard.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class CreditCard @@ -28,9 +28,8 @@ use PayPal\Transport\PPRestCall; * @property string valid_until * @property string create_time * @property string update_time - * @property \PayPal\Api\Links[] links */ -class CreditCard extends ResourceModel +class CreditCard extends PayPalResourceModel { /** * ID of the credit card being saved for later use. @@ -124,31 +123,6 @@ class CreditCard extends ResourceModel return $this->expire_month; } - /** - * 2 digit card expiry month. - * - * @deprecated Instead use setExpireMonth - * - * @param int $expire_month - * @return $this - */ - public function setExpire_month($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * 2 digit card expiry month. - * @deprecated Instead use getExpireMonth - * - * @return int - */ - public function getExpire_month() - { - return $this->expire_month; - } - /** * 4 digit card expiry year * @@ -172,31 +146,6 @@ class CreditCard extends ResourceModel return $this->expire_year; } - /** - * 4 digit card expiry year - * - * @deprecated Instead use setExpireYear - * - * @param int $expire_year - * @return $this - */ - public function setExpire_year($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * 4 digit card expiry year - * @deprecated Instead use getExpireYear - * - * @return int - */ - public function getExpire_year() - { - return $this->expire_year; - } - /** * Card validation code. Only supported when making a Payment but not when saving a credit card for future use. * @@ -243,31 +192,6 @@ class CreditCard extends ResourceModel return $this->first_name; } - /** - * Card holder's first name. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * Card holder's first name. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Card holder's last name. * @@ -291,31 +215,6 @@ class CreditCard extends ResourceModel return $this->last_name; } - /** - * Card holder's last name. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Card holder's last name. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Billing Address associated with this card. * @@ -339,31 +238,6 @@ class CreditCard extends ResourceModel return $this->billing_address; } - /** - * Billing Address associated with this card. - * - * @deprecated Instead use setBillingAddress - * - * @param \PayPal\Api\Address $billing_address - * @return $this - */ - public function setBilling_address($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing Address associated with this card. - * @deprecated Instead use getBillingAddress - * - * @return \PayPal\Api\Address - */ - public function getBilling_address() - { - return $this->billing_address; - } - /** * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. * @@ -387,31 +261,6 @@ class CreditCard extends ResourceModel return $this->external_customer_id; } - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } - /** * State of the funding instrument. * Valid Values: ["expired", "ok"] @@ -459,31 +308,6 @@ class CreditCard extends ResourceModel return $this->valid_until; } - /** - * Date/Time until this resource can be used fund a payment. - * - * @deprecated Instead use setValidUntil - * - * @param string $valid_until - * @return $this - */ - public function setValid_until($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Date/Time until this resource can be used fund a payment. - * @deprecated Instead use getValidUntil - * - * @return string - */ - public function getValid_until() - { - return $this->valid_until; - } - /** * Time the resource was created in UTC ISO8601 format. * @@ -507,31 +331,6 @@ class CreditCard extends ResourceModel return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was created in UTC ISO8601 format. * @@ -555,89 +354,11 @@ class CreditCard extends ResourceModel return $this->update_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - - /** - * 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)) - ); - } - /** * Creates a new Credit Card Resource (aka Tokenize). * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return CreditCard */ public function create($apiContext = null, $restCall = null) @@ -660,7 +381,7 @@ class CreditCard extends ResourceModel * * @param string $creditCardId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return CreditCard */ public static function get($creditCardId, $apiContext = null, $restCall = null) @@ -684,7 +405,7 @@ class CreditCard extends ResourceModel * Delete the Credit Card resource for the given identifier. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) @@ -706,7 +427,7 @@ class CreditCard extends ResourceModel * Update information in a previously saved card. Only the modified fields need to be passed in the request. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return CreditCard */ public function update($apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/CreditCardHistory.php b/lib/PayPal/Api/CreditCardHistory.php index 4a666f9..636429c 100644 --- a/lib/PayPal/Api/CreditCardHistory.php +++ b/lib/PayPal/Api/CreditCardHistory.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -16,7 +16,7 @@ use PayPal\Rest\ApiContext; * @property int count * @property string next_id */ -class CreditCardHistory extends PPModel +class CreditCardHistory extends PayPalModel { /** * A list of credit card resources @@ -42,31 +42,6 @@ class CreditCardHistory extends PPModel return $this->{"credit-cards"}; } - /** - * A list of credit card resources - * - * @deprecated Instead use setCreditCards - * - * @param \PayPal\Api\CreditCard $credit-cards - * @return $this - */ - public function setCredit_cards($credit_cards) - { - $this->{"credit-cards"} = $credit_cards; - return $this; - } - - /** - * A list of credit card resources - * @deprecated Instead use getCreditCards - * - * @return \PayPal\Api\CreditCard - */ - public function getCredit_cards() - { - return $this->{"credit-cards"}; - } - /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @@ -115,29 +90,4 @@ class CreditCardHistory extends PPModel return $this->next_id; } - /** - * Identifier of the next element to get the next range of results. - * - * @deprecated Instead use setNextId - * - * @param string $next_id - * @return $this - */ - public function setNext_id($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * @deprecated Instead use getNextId - * - * @return string - */ - public function getNext_id() - { - return $this->next_id; - } - } diff --git a/lib/PayPal/Api/CreditCardList.php b/lib/PayPal/Api/CreditCardList.php index 26cd7db..fa92e9e 100644 --- a/lib/PayPal/Api/CreditCardList.php +++ b/lib/PayPal/Api/CreditCardList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class CreditCardList @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property int count * @property string next_id */ -class CreditCardList extends PPModel +class CreditCardList extends PayPalModel { /** * A list of credit card resources @@ -70,31 +70,6 @@ class CreditCardList extends PPModel ); } - /** - * A list of credit card resources - * - * @deprecated Instead use setCreditCards - * - * @param \PayPal\Api\CreditCard $credit-cards - * @return $this - */ - public function setCredit_cards($credit_cards) - { - $this->{"credit-cards"} = $credit_cards; - return $this; - } - - /** - * A list of credit card resources - * @deprecated Instead use getCreditCards - * - * @return \PayPal\Api\CreditCard - */ - public function getCredit_cards() - { - return $this->{"credit-cards"}; - } - /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @@ -141,29 +116,4 @@ class CreditCardList extends PPModel return $this->next_id; } - /** - * Identifier of the next element to get the next range of results. - * - * @deprecated Instead use setNextId - * - * @param string $next_id - * @return $this - */ - public function setNext_id($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * @deprecated Instead use getNextId - * - * @return string - */ - public function getNext_id() - { - return $this->next_id; - } - } diff --git a/lib/PayPal/Api/CreditCardToken.php b/lib/PayPal/Api/CreditCardToken.php index 1ee5829..7bbb0dd 100644 --- a/lib/PayPal/Api/CreditCardToken.php +++ b/lib/PayPal/Api/CreditCardToken.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class CreditCardToken @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property int expire_month * @property int expire_year */ -class CreditCardToken extends PPModel +class CreditCardToken extends PayPalModel { /** * ID of a previously saved Credit Card resource using /vault/credit-card API. @@ -43,31 +43,6 @@ class CreditCardToken extends PPModel return $this->credit_card_id; } - /** - * ID of a previously saved Credit Card resource using /vault/credit-card API. - * - * @deprecated Instead use setCreditCardId - * - * @param string $credit_card_id - * @return $this - */ - public function setCredit_card_id($credit_card_id) - { - $this->credit_card_id = $credit_card_id; - return $this; - } - - /** - * ID of a previously saved Credit Card resource using /vault/credit-card API. - * @deprecated Instead use getCreditCardId - * - * @return string - */ - public function getCredit_card_id() - { - return $this->credit_card_id; - } - /** * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. * @@ -91,31 +66,6 @@ class CreditCardToken extends PPModel return $this->payer_id; } - /** - * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. - * - * @deprecated Instead use setPayerId - * - * @param string $payer_id - * @return $this - */ - public function setPayer_id($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. - * @deprecated Instead use getPayerId - * - * @return string - */ - public function getPayer_id() - { - return $this->payer_id; - } - /** * Last 4 digits of the card number from the saved card. * @@ -185,31 +135,6 @@ class CreditCardToken extends PPModel return $this->expire_month; } - /** - * Expiry month from the saved card, represented as 1 - 12. - * - * @deprecated Instead use setExpireMonth - * - * @param int $expire_month - * @return $this - */ - public function setExpire_month($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * Expiry month from the saved card, represented as 1 - 12. - * @deprecated Instead use getExpireMonth - * - * @return int - */ - public function getExpire_month() - { - return $this->expire_month; - } - /** * Expiry year from the saved card, represented as YYYY format. * @@ -233,29 +158,4 @@ class CreditCardToken extends PPModel return $this->expire_year; } - /** - * Expiry year from the saved card, represented as YYYY format. - * - * @deprecated Instead use setExpireYear - * - * @param int $expire_year - * @return $this - */ - public function setExpire_year($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * Expiry year from the saved card, represented as YYYY format. - * @deprecated Instead use getExpireYear - * - * @return int - */ - public function getExpire_year() - { - return $this->expire_year; - } - } diff --git a/lib/PayPal/Api/Currency.php b/lib/PayPal/Api/Currency.php index c4018a6..eb53eb9 100644 --- a/lib/PayPal/Api/Currency.php +++ b/lib/PayPal/Api/Currency.php @@ -2,8 +2,8 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; -use PayPal\Common\FormatConverter; +use PayPal\Common\PayPalModel; +use PayPal\Converter\FormatConverter; use PayPal\Validation\NumericValidator; /** @@ -16,7 +16,7 @@ use PayPal\Validation\NumericValidator; * @property string currency * @property string value */ -class Currency extends PPModel +class Currency extends PayPalModel { /** * 3 letter currency code as defined by ISO 4217. diff --git a/lib/PayPal/Api/CustomAmount.php b/lib/PayPal/Api/CustomAmount.php index 3727a5a..47f9d75 100644 --- a/lib/PayPal/Api/CustomAmount.php +++ b/lib/PayPal/Api/CustomAmount.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class CustomAmount @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property string label * @property \PayPal\Api\Currency amount */ -class CustomAmount extends PPModel +class CustomAmount extends PayPalModel { /** * Custom amount label. 25 characters max. diff --git a/lib/PayPal/Api/Details.php b/lib/PayPal/Api/Details.php index b03449e..8e36248 100644 --- a/lib/PayPal/Api/Details.php +++ b/lib/PayPal/Api/Details.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Validation\NumericValidator; -use PayPal\Common\FormatConverter; +use PayPal\Converter\FormatConverter; /** * Class Details @@ -23,7 +23,7 @@ use PayPal\Common\FormatConverter; * @property string handling_fee * @property string gift_wrap */ -class Details extends PPModel +class Details extends PayPalModel { /** * Amount being charged for shipping. @@ -156,31 +156,6 @@ class Details extends PPModel return $this->shipping_discount; } - /** - * Amount being charged as shipping discount. - * - * @deprecated Instead use setShippingDiscount - * - * @param string $shipping_discount - * @return $this - */ - public function setShipping_discount($shipping_discount) - { - $this->shipping_discount = $shipping_discount; - return $this; - } - - /** - * Amount being charged as shipping discount. - * @deprecated Instead use getShippingDiscount - * - * @return string - */ - public function getShipping_discount() - { - return $this->shipping_discount; - } - /** * Amount being charged as insurance. * @@ -233,31 +208,6 @@ class Details extends PPModel return $this->handling_fee; } - /** - * Amount being charged as handling fee. - * - * @deprecated Instead use setHandlingFee - * - * @param string $handling_fee - * @return $this - */ - public function setHandling_fee($handling_fee) - { - $this->handling_fee = $handling_fee; - return $this; - } - - /** - * Amount being charged as handling fee. - * @deprecated Instead use getHandlingFee - * - * @return string - */ - public function getHandling_fee() - { - return $this->handling_fee; - } - /** * Amount being charged as gift wrap fee. * @@ -283,29 +233,4 @@ class Details extends PPModel return $this->gift_wrap; } - /** - * Amount being charged as gift wrap fee. - * - * @deprecated Instead use setGiftWrap - * - * @param string $gift_wrap - * @return $this - */ - public function setGift_wrap($gift_wrap) - { - $this->gift_wrap = $gift_wrap; - return $this; - } - - /** - * Amount being charged as gift wrap fee. - * @deprecated Instead use getGiftWrap - * - * @return string - */ - public function getGift_wrap() - { - return $this->gift_wrap; - } - } diff --git a/lib/PayPal/Api/Error.php b/lib/PayPal/Api/Error.php index 9f5eac4..75ba3d2 100644 --- a/lib/PayPal/Api/Error.php +++ b/lib/PayPal/Api/Error.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Error @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\ErrorDetails[] details * @property \PayPal\Api\Links[] links */ -class Error extends PPModel +class Error extends PayPalModel { /** * Human readable, unique name of the error. @@ -66,31 +66,6 @@ class Error extends PPModel return $this->debug_id; } - /** - * PayPal internal identifier used for correlation purposes. - * - * @deprecated Instead use setDebugId - * - * @param string $debug_id - * @return $this - */ - public function setDebug_id($debug_id) - { - $this->debug_id = $debug_id; - return $this; - } - - /** - * PayPal internal identifier used for correlation purposes. - * @deprecated Instead use getDebugId - * - * @return string - */ - public function getDebug_id() - { - return $this->debug_id; - } - /** * Message describing the error. * @@ -137,31 +112,6 @@ class Error extends PPModel return $this->information_link; } - /** - * URI for detailed information related to this error for the developer. - * - * @deprecated Instead use setInformationLink - * - * @param string $information_link - * @return $this - */ - public function setInformation_link($information_link) - { - $this->information_link = $information_link; - return $this; - } - - /** - * URI for detailed information related to this error for the developer. - * @deprecated Instead use getInformationLink - * - * @return string - */ - public function getInformation_link() - { - return $this->information_link; - } - /** * Additional details of the error * diff --git a/lib/PayPal/Api/ErrorDetails.php b/lib/PayPal/Api/ErrorDetails.php index e2fc039..f4e14a0 100644 --- a/lib/PayPal/Api/ErrorDetails.php +++ b/lib/PayPal/Api/ErrorDetails.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ErrorDetails @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property string field * @property string issue */ -class ErrorDetails extends PPModel +class ErrorDetails extends PayPalModel { /** * Name of the field that caused the error. diff --git a/lib/PayPal/Api/ExtendedBankAccount.php b/lib/PayPal/Api/ExtendedBankAccount.php index 11e5297..69baec9 100644 --- a/lib/PayPal/Api/ExtendedBankAccount.php +++ b/lib/PayPal/Api/ExtendedBankAccount.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ExtendedBankAccount @@ -38,29 +38,4 @@ class ExtendedBankAccount extends BankAccount return $this->mandate_reference_number; } - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * - * @deprecated Instead use setMandateReferenceNumber - * - * @param string $mandate_reference_number - * @return $this - */ - public function setMandate_reference_number($mandate_reference_number) - { - $this->mandate_reference_number = $mandate_reference_number; - return $this; - } - - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * @deprecated Instead use getMandateReferenceNumber - * - * @return string - */ - public function getMandate_reference_number() - { - return $this->mandate_reference_number; - } - } diff --git a/lib/PayPal/Api/FlowConfig.php b/lib/PayPal/Api/FlowConfig.php index 471322c..a8ae332 100644 --- a/lib/PayPal/Api/FlowConfig.php +++ b/lib/PayPal/Api/FlowConfig.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Validation\UrlValidator; /** @@ -15,7 +15,7 @@ use PayPal\Validation\UrlValidator; * @property string landing_page_type * @property string bank_txn_pending_url */ -class FlowConfig extends PPModel +class FlowConfig extends PayPalModel { /** * Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used. @@ -41,31 +41,6 @@ class FlowConfig extends PPModel return $this->landing_page_type; } - /** - * Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used. - * - * @deprecated Instead use setLandingPageType - * - * @param string $landing_page_type - * @return $this - */ - public function setLanding_page_type($landing_page_type) - { - $this->landing_page_type = $landing_page_type; - return $this; - } - - /** - * Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used. - * @deprecated Instead use getLandingPageType - * - * @return string - */ - public function getLanding_page_type() - { - return $this->landing_page_type; - } - /** * The URL on the merchant site for transferring to after a bank transfer payment. * @@ -91,29 +66,4 @@ class FlowConfig extends PPModel return $this->bank_txn_pending_url; } - /** - * The URL on the merchant site for transferring to after a bank transfer payment. - * - * @deprecated Instead use setBankTxnPendingUrl - * - * @param string $bank_txn_pending_url - * @return $this - */ - public function setBank_txn_pending_url($bank_txn_pending_url) - { - $this->bank_txn_pending_url = $bank_txn_pending_url; - return $this; - } - - /** - * The URL on the merchant site for transferring to after a bank transfer payment. - * @deprecated Instead use getBankTxnPendingUrl - * - * @return string - */ - public function getBank_txn_pending_url() - { - return $this->bank_txn_pending_url; - } - } diff --git a/lib/PayPal/Api/FundingInstrument.php b/lib/PayPal/Api/FundingInstrument.php index d2aa844..9ee0646 100644 --- a/lib/PayPal/Api/FundingInstrument.php +++ b/lib/PayPal/Api/FundingInstrument.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class FundingInstrument @@ -19,7 +19,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\BankToken bank_account_token * @property \PayPal\Api\Credit credit */ -class FundingInstrument extends PPModel +class FundingInstrument extends PayPalModel { /** * Credit Card information. @@ -44,31 +44,6 @@ class FundingInstrument extends PPModel return $this->credit_card; } - /** - * Credit Card information. - * - * @deprecated Instead use setCreditCard - * - * @param \PayPal\Api\CreditCard $credit_card - * @return $this - */ - public function setCredit_card($credit_card) - { - $this->credit_card = $credit_card; - return $this; - } - - /** - * Credit Card information. - * @deprecated Instead use getCreditCard - * - * @return \PayPal\Api\CreditCard - */ - public function getCredit_card() - { - return $this->credit_card; - } - /** * Credit Card information. * @@ -92,31 +67,6 @@ class FundingInstrument extends PPModel return $this->credit_card_token; } - /** - * Credit Card information. - * - * @deprecated Instead use setCreditCardToken - * - * @param \PayPal\Api\CreditCardToken $credit_card_token - * @return $this - */ - public function setCredit_card_token($credit_card_token) - { - $this->credit_card_token = $credit_card_token; - return $this; - } - - /** - * Credit Card information. - * @deprecated Instead use getCreditCardToken - * - * @return \PayPal\Api\CreditCardToken - */ - public function getCredit_card_token() - { - return $this->credit_card_token; - } - /** * Payment Card information. * @@ -140,31 +90,6 @@ class FundingInstrument extends PPModel return $this->payment_card; } - /** - * Payment Card information. - * - * @deprecated Instead use setPaymentCard - * - * @param \PayPal\Api\PaymentCard $payment_card - * @return $this - */ - public function setPayment_card($payment_card) - { - $this->payment_card = $payment_card; - return $this; - } - - /** - * Payment Card information. - * @deprecated Instead use getPaymentCard - * - * @return \PayPal\Api\PaymentCard - */ - public function getPayment_card() - { - return $this->payment_card; - } - /** * Payment card token information. * @@ -188,31 +113,6 @@ class FundingInstrument extends PPModel return $this->payment_card_token; } - /** - * Payment card token information. - * - * @deprecated Instead use setPaymentCardToken - * - * @param \PayPal\Api\PaymentCardToken $payment_card_token - * @return $this - */ - public function setPayment_card_token($payment_card_token) - { - $this->payment_card_token = $payment_card_token; - return $this; - } - - /** - * Payment card token information. - * @deprecated Instead use getPaymentCardToken - * - * @return \PayPal\Api\PaymentCardToken - */ - public function getPayment_card_token() - { - return $this->payment_card_token; - } - /** * Bank Account information. * @@ -236,31 +136,6 @@ class FundingInstrument extends PPModel return $this->bank_account; } - /** - * Bank Account information. - * - * @deprecated Instead use setBankAccount - * - * @param \PayPal\Api\ExtendedBankAccount $bank_account - * @return $this - */ - public function setBank_account($bank_account) - { - $this->bank_account = $bank_account; - return $this; - } - - /** - * Bank Account information. - * @deprecated Instead use getBankAccount - * - * @return \PayPal\Api\ExtendedBankAccount - */ - public function getBank_account() - { - return $this->bank_account; - } - /** * Bank Account information. * @@ -284,31 +159,6 @@ class FundingInstrument extends PPModel return $this->bank_account_token; } - /** - * Bank Account information. - * - * @deprecated Instead use setBankAccountToken - * - * @param \PayPal\Api\BankToken $bank_account_token - * @return $this - */ - public function setBank_account_token($bank_account_token) - { - $this->bank_account_token = $bank_account_token; - return $this; - } - - /** - * Bank Account information. - * @deprecated Instead use getBankAccountToken - * - * @return \PayPal\Api\BankToken - */ - public function getBank_account_token() - { - return $this->bank_account_token; - } - /** * Credit funding information. * diff --git a/lib/PayPal/Api/FuturePayment.php b/lib/PayPal/Api/FuturePayment.php index 7c3947c..e37d3b5 100644 --- a/lib/PayPal/Api/FuturePayment.php +++ b/lib/PayPal/Api/FuturePayment.php @@ -2,9 +2,9 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class FuturePayment @@ -33,9 +33,9 @@ class FuturePayment extends Payment ); } $payLoad = $this->toJSON(); - $call = new PPRestCall($apiContext); + $call = new PayPalRestCall($apiContext); $json = $call->execute( - array('PayPal\Rest\RestHandler'), + array('PayPal\Handler\RestHandler'), "/v1/payments/payment", "POST", $payLoad, diff --git a/lib/PayPal/Api/HyperSchema.php b/lib/PayPal/Api/HyperSchema.php index 9c2d6f2..7ef5dbb 100644 --- a/lib/PayPal/Api/HyperSchema.php +++ b/lib/PayPal/Api/HyperSchema.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class HyperSchema @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property string pathStart * @property string mediaType */ -class HyperSchema extends PPModel +class HyperSchema extends PayPalModel { /** * Sets Links diff --git a/lib/PayPal/Api/Image.php b/lib/PayPal/Api/Image.php index fff9353..71c7d15 100644 --- a/lib/PayPal/Api/Image.php +++ b/lib/PayPal/Api/Image.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Image @@ -11,7 +11,7 @@ use PayPal\Common\PPModel; * * @property string image */ -class Image extends PPModel +class Image extends PayPalModel { /** * List of invoices belonging to a merchant. diff --git a/lib/PayPal/Api/InputFields.php b/lib/PayPal/Api/InputFields.php index 3e9b247..0bcf805 100644 --- a/lib/PayPal/Api/InputFields.php +++ b/lib/PayPal/Api/InputFields.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InputFields @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property int no_shipping * @property int address_override */ -class InputFields extends PPModel +class InputFields extends PayPalModel { /** * Enables the buyer to enter a note to the merchant on the PayPal page during checkout. @@ -41,31 +41,6 @@ class InputFields extends PPModel return $this->allow_note; } - /** - * Enables the buyer to enter a note to the merchant on the PayPal page during checkout. - * - * @deprecated Instead use setAllowNote - * - * @param bool $allow_note - * @return $this - */ - public function setAllow_note($allow_note) - { - $this->allow_note = $allow_note; - return $this; - } - - /** - * Enables the buyer to enter a note to the merchant on the PayPal page during checkout. - * @deprecated Instead use getAllowNote - * - * @return bool - */ - public function getAllow_note() - { - return $this->allow_note; - } - /** * Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`. * @@ -90,31 +65,6 @@ class InputFields extends PPModel return $this->no_shipping; } - /** - * Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`. - * - * @deprecated Instead use setNoShipping - * - * @param int $no_shipping - * @return $this - */ - public function setNo_shipping($no_shipping) - { - $this->no_shipping = $no_shipping; - return $this; - } - - /** - * Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`. - * @deprecated Instead use getNoShipping - * - * @return int - */ - public function getNo_shipping() - { - return $this->no_shipping; - } - /** * Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address. * @@ -139,29 +89,4 @@ class InputFields extends PPModel return $this->address_override; } - /** - * Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address. - * - * @deprecated Instead use setAddressOverride - * - * @param int $address_override - * @return $this - */ - public function setAddress_override($address_override) - { - $this->address_override = $address_override; - return $this; - } - - /** - * Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address. - * @deprecated Instead use getAddressOverride - * - * @return int - */ - public function getAddress_override() - { - return $this->address_override; - } - } diff --git a/lib/PayPal/Api/Invoice.php b/lib/PayPal/Api/Invoice.php index 1317160..1413215 100644 --- a/lib/PayPal/Api/Invoice.php +++ b/lib/PayPal/Api/Invoice.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\UrlValidator; /** @@ -40,7 +40,7 @@ use PayPal\Validation\UrlValidator; * @property \PayPal\Api\Metadata metadata * @property string additional_data */ -class Invoice extends ResourceModel +class Invoice extends PayPalResourceModel { /** * Unique invoice resource identifier. @@ -158,31 +158,6 @@ class Invoice extends ResourceModel return $this->merchant_info; } - /** - * Information about the merchant who is sending the invoice. - * - * @deprecated Instead use setMerchantInfo - * - * @param \PayPal\Api\MerchantInfo $merchant_info - * @return $this - */ - public function setMerchant_info($merchant_info) - { - $this->merchant_info = $merchant_info; - return $this; - } - - /** - * Information about the merchant who is sending the invoice. - * @deprecated Instead use getMerchantInfo - * - * @return \PayPal\Api\MerchantInfo - */ - public function getMerchant_info() - { - return $this->merchant_info; - } - /** * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). * @@ -236,31 +211,6 @@ class Invoice extends ResourceModel ); } - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * - * @deprecated Instead use setBillingInfo - * - * @param \PayPal\Api\BillingInfo $billing_info - * @return $this - */ - public function setBilling_info($billing_info) - { - $this->billing_info = $billing_info; - return $this; - } - - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * @deprecated Instead use getBillingInfo - * - * @return \PayPal\Api\BillingInfo - */ - public function getBilling_info() - { - return $this->billing_info; - } - /** * Shipping information for entities to whom items are being shipped. * @@ -284,31 +234,6 @@ class Invoice extends ResourceModel return $this->shipping_info; } - /** - * Shipping information for entities to whom items are being shipped. - * - * @deprecated Instead use setShippingInfo - * - * @param \PayPal\Api\ShippingInfo $shipping_info - * @return $this - */ - public function setShipping_info($shipping_info) - { - $this->shipping_info = $shipping_info; - return $this; - } - - /** - * Shipping information for entities to whom items are being shipped. - * @deprecated Instead use getShippingInfo - * - * @return \PayPal\Api\ShippingInfo - */ - public function getShipping_info() - { - return $this->shipping_info; - } - /** * List of items included in the invoice. 100 items max per invoice. * @@ -385,31 +310,6 @@ class Invoice extends ResourceModel return $this->invoice_date; } - /** - * Date on which the invoice was enabled. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setInvoiceDate - * - * @param string $invoice_date - * @return $this - */ - public function setInvoice_date($invoice_date) - { - $this->invoice_date = $invoice_date; - return $this; - } - - /** - * Date on which the invoice was enabled. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getInvoiceDate - * - * @return string - */ - public function getInvoice_date() - { - return $this->invoice_date; - } - /** * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. * @@ -433,31 +333,6 @@ class Invoice extends ResourceModel return $this->payment_term; } - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * - * @deprecated Instead use setPaymentTerm - * - * @param \PayPal\Api\PaymentTerm $payment_term - * @return $this - */ - public function setPayment_term($payment_term) - { - $this->payment_term = $payment_term; - return $this; - } - - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * @deprecated Instead use getPaymentTerm - * - * @return \PayPal\Api\PaymentTerm - */ - public function getPayment_term() - { - return $this->payment_term; - } - /** * Invoice level discount in percent or amount. * @@ -504,31 +379,6 @@ class Invoice extends ResourceModel return $this->shipping_cost; } - /** - * Shipping cost in percent or amount. - * - * @deprecated Instead use setShippingCost - * - * @param \PayPal\Api\ShippingCost $shipping_cost - * @return $this - */ - public function setShipping_cost($shipping_cost) - { - $this->shipping_cost = $shipping_cost; - return $this; - } - - /** - * Shipping cost in percent or amount. - * @deprecated Instead use getShippingCost - * - * @return \PayPal\Api\ShippingCost - */ - public function getShipping_cost() - { - return $this->shipping_cost; - } - /** * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. * @@ -575,31 +425,6 @@ class Invoice extends ResourceModel return $this->tax_calculated_after_discount; } - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * - * @deprecated Instead use setTaxCalculatedAfterDiscount - * - * @param bool $tax_calculated_after_discount - * @return $this - */ - public function setTax_calculated_after_discount($tax_calculated_after_discount) - { - $this->tax_calculated_after_discount = $tax_calculated_after_discount; - return $this; - } - - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * @deprecated Instead use getTaxCalculatedAfterDiscount - * - * @return bool - */ - public function getTax_calculated_after_discount() - { - return $this->tax_calculated_after_discount; - } - /** * A flag indicating whether the unit price includes tax. Default is false * @@ -623,31 +448,6 @@ class Invoice extends ResourceModel return $this->tax_inclusive; } - /** - * A flag indicating whether the unit price includes tax. Default is false - * - * @deprecated Instead use setTaxInclusive - * - * @param bool $tax_inclusive - * @return $this - */ - public function setTax_inclusive($tax_inclusive) - { - $this->tax_inclusive = $tax_inclusive; - return $this; - } - - /** - * A flag indicating whether the unit price includes tax. Default is false - * @deprecated Instead use getTaxInclusive - * - * @return bool - */ - public function getTax_inclusive() - { - return $this->tax_inclusive; - } - /** * General terms of the invoice. 4000 characters max. * @@ -717,31 +517,6 @@ class Invoice extends ResourceModel return $this->merchant_memo; } - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * - * @deprecated Instead use setMerchantMemo - * - * @param string $merchant_memo - * @return $this - */ - public function setMerchant_memo($merchant_memo) - { - $this->merchant_memo = $merchant_memo; - return $this; - } - - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * @deprecated Instead use getMerchantMemo - * - * @return string - */ - public function getMerchant_memo() - { - return $this->merchant_memo; - } - /** * Full URL of an external image to use as the logo. 4000 characters max. * @@ -766,31 +541,6 @@ class Invoice extends ResourceModel return $this->logo_url; } - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * - * @deprecated Instead use setLogoUrl - * - * @param string $logo_url - * @return $this - */ - public function setLogo_url($logo_url) - { - $this->logo_url = $logo_url; - return $this; - } - - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * @deprecated Instead use getLogoUrl - * - * @return string - */ - public function getLogo_url() - { - return $this->logo_url; - } - /** * The total amount of the invoice. * @@ -814,31 +564,6 @@ class Invoice extends ResourceModel return $this->total_amount; } - /** - * The total amount of the invoice. - * - * @deprecated Instead use setTotalAmount - * - * @param \PayPal\Api\Currency $total_amount - * @return $this - */ - public function setTotal_amount($total_amount) - { - $this->total_amount = $total_amount; - return $this; - } - - /** - * The total amount of the invoice. - * @deprecated Instead use getTotalAmount - * - * @return \PayPal\Api\Currency - */ - public function getTotal_amount() - { - return $this->total_amount; - } - /** * List of payment details for the invoice. * @@ -892,31 +617,6 @@ class Invoice extends ResourceModel ); } - /** - * List of payment details for the invoice. - * - * @deprecated Instead use setPaymentDetails - * - * @param \PayPal\Api\PaymentDetail $payment_details - * @return $this - */ - public function setPayment_details($payment_details) - { - $this->payment_details = $payment_details; - return $this; - } - - /** - * List of payment details for the invoice. - * @deprecated Instead use getPaymentDetails - * - * @return \PayPal\Api\PaymentDetail - */ - public function getPayment_details() - { - return $this->payment_details; - } - /** * List of refund details for the invoice. * @@ -970,31 +670,6 @@ class Invoice extends ResourceModel ); } - /** - * List of refund details for the invoice. - * - * @deprecated Instead use setRefundDetails - * - * @param \PayPal\Api\RefundDetail $refund_details - * @return $this - */ - public function setRefund_details($refund_details) - { - $this->refund_details = $refund_details; - return $this; - } - - /** - * List of refund details for the invoice. - * @deprecated Instead use getRefundDetails - * - * @return \PayPal\Api\RefundDetail - */ - public function getRefund_details() - { - return $this->refund_details; - } - /** * Audit information for the invoice. * @@ -1041,36 +716,11 @@ class Invoice extends ResourceModel return $this->additional_data; } - /** - * Any miscellaneous invoice data. 4000 characters max. - * - * @deprecated Instead use setAdditionalData - * - * @param string $additional_data - * @return $this - */ - public function setAdditional_data($additional_data) - { - $this->additional_data = $additional_data; - return $this; - } - - /** - * Any miscellaneous invoice data. 4000 characters max. - * @deprecated Instead use getAdditionalData - * - * @return string - */ - public function getAdditional_data() - { - return $this->additional_data; - } - /** * Create a new invoice by passing the details for the invoice, including the merchant_info, to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Invoice */ public function create($apiContext = null, $restCall = null) @@ -1093,7 +743,7 @@ class Invoice extends ResourceModel * * @param Search $search * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return InvoiceSearchResponse */ public static function search($search, $apiContext = null, $restCall = null) @@ -1117,7 +767,7 @@ class Invoice extends ResourceModel * Send a specific invoice to its intended recipient by passing the invoice ID to the request URI. Optionally, you can specify whether to send the merchant an invoice update notification by using the notify_merchant query parameter. By default, notify_merchant is true. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function send($apiContext = null, $restCall = null) @@ -1140,7 +790,7 @@ class Invoice extends ResourceModel * * @param Notification $notification * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function remind($notification, $apiContext = null, $restCall = null) @@ -1164,7 +814,7 @@ class Invoice extends ResourceModel * * @param CancelNotification $cancelNotification * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function cancel($cancelNotification, $apiContext = null, $restCall = null) @@ -1188,7 +838,7 @@ class Invoice extends ResourceModel * * @param PaymentDetail $paymentDetail * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function recordPayment($paymentDetail, $apiContext = null, $restCall = null) @@ -1212,7 +862,7 @@ class Invoice extends ResourceModel * * @param RefundDetail $refundDetail * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function recordRefund($refundDetail, $apiContext = null, $restCall = null) @@ -1236,7 +886,7 @@ class Invoice extends ResourceModel * * @param string $invoiceId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Invoice */ public static function get($invoiceId, $apiContext = null, $restCall = null) @@ -1261,7 +911,7 @@ class Invoice extends ResourceModel * * @param array $params * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return InvoiceSearchResponse */ public static function getAll($params = array(), $apiContext = null, $restCall = null) @@ -1288,25 +938,11 @@ class Invoice extends ResourceModel return $ret; } - /** - * @deprecated Use getAll instead - * - * List some or all invoices for a merchant according to optional query string parameters specified. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return InvoiceSearchResponse - */ - public static function get_all($apiContext = null, $restCall = null) - { - return self::getAll(null, $apiContext, $restCall); - } - /** * Fully update an invoice by passing the invoice ID to the request URI. In addition, pass a complete invoice object in the request JSON. Partial updates are not supported. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Invoice */ public function update($apiContext = null, $restCall = null) @@ -1329,7 +965,7 @@ class Invoice extends ResourceModel * Delete a particular invoice by passing the invoice ID to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) @@ -1353,7 +989,7 @@ class Invoice extends ResourceModel * @param array $params * @param string $invoiceId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Image */ public static function qrCode($invoiceId, $params = array(), $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/InvoiceAddress.php b/lib/PayPal/Api/InvoiceAddress.php index 4f7f5b4..b8cd850 100644 --- a/lib/PayPal/Api/InvoiceAddress.php +++ b/lib/PayPal/Api/InvoiceAddress.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoiceAddress diff --git a/lib/PayPal/Api/InvoiceItem.php b/lib/PayPal/Api/InvoiceItem.php index 49453f1..14cfe9b 100644 --- a/lib/PayPal/Api/InvoiceItem.php +++ b/lib/PayPal/Api/InvoiceItem.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoiceItem @@ -19,7 +19,7 @@ use PayPal\Common\PPModel; * @property string date * @property \PayPal\Api\Cost discount */ -class InvoiceItem extends PPModel +class InvoiceItem extends PayPalModel { /** * Name of the item. 60 characters max. @@ -113,31 +113,6 @@ class InvoiceItem extends PPModel return $this->unit_price; } - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * - * @deprecated Instead use setUnitPrice - * - * @param \PayPal\Api\Currency $unit_price - * @return $this - */ - public function setUnit_price($unit_price) - { - $this->unit_price = $unit_price; - return $this; - } - - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * @deprecated Instead use getUnitPrice - * - * @return \PayPal\Api\Currency - */ - public function getUnit_price() - { - return $this->unit_price; - } - /** * Tax associated with the item. * diff --git a/lib/PayPal/Api/InvoiceSearchResponse.php b/lib/PayPal/Api/InvoiceSearchResponse.php index 9afda6a..0634eb6 100644 --- a/lib/PayPal/Api/InvoiceSearchResponse.php +++ b/lib/PayPal/Api/InvoiceSearchResponse.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoiceSearchResponse @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property int total_count * @property \PayPal\Api\Invoice[] invoices */ -class InvoiceSearchResponse extends PPModel +class InvoiceSearchResponse extends PayPalModel { /** * Total number of invoices. @@ -39,31 +39,6 @@ class InvoiceSearchResponse extends PPModel return $this->total_count; } - /** - * Total number of invoices. - * - * @deprecated Instead use setTotalCount - * - * @param int $total_count - * @return $this - */ - public function setTotal_count($total_count) - { - $this->total_count = $total_count; - return $this; - } - - /** - * Total number of invoices. - * @deprecated Instead use getTotalCount - * - * @return int - */ - public function getTotal_count() - { - return $this->total_count; - } - /** * List of invoices belonging to a merchant. * diff --git a/lib/PayPal/Api/InvoicingMetaData.php b/lib/PayPal/Api/InvoicingMetaData.php index b669706..ee17273 100644 --- a/lib/PayPal/Api/InvoicingMetaData.php +++ b/lib/PayPal/Api/InvoicingMetaData.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Validation\UrlValidator; /** @@ -23,7 +23,7 @@ use PayPal\Validation\UrlValidator; * @property string last_sent_by * @property string payer_view_url */ -class InvoicingMetaData extends PPModel +class InvoicingMetaData extends PayPalModel { /** * Date when the resource was created. @@ -48,31 +48,6 @@ class InvoicingMetaData extends PPModel return $this->created_date; } - /** - * Date when the resource was created. - * - * @deprecated Instead use setCreatedDate - * - * @param string $created_date - * @return $this - */ - public function setCreated_date($created_date) - { - $this->created_date = $created_date; - return $this; - } - - /** - * Date when the resource was created. - * @deprecated Instead use getCreatedDate - * - * @return string - */ - public function getCreated_date() - { - return $this->created_date; - } - /** * Email address of the account that created the resource. * @@ -96,31 +71,6 @@ class InvoicingMetaData extends PPModel return $this->created_by; } - /** - * Email address of the account that created the resource. - * - * @deprecated Instead use setCreatedBy - * - * @param string $created_by - * @return $this - */ - public function setCreated_by($created_by) - { - $this->created_by = $created_by; - return $this; - } - - /** - * Email address of the account that created the resource. - * @deprecated Instead use getCreatedBy - * - * @return string - */ - public function getCreated_by() - { - return $this->created_by; - } - /** * Date when the resource was cancelled. * @@ -144,31 +94,6 @@ class InvoicingMetaData extends PPModel return $this->cancelled_date; } - /** - * Date when the resource was cancelled. - * - * @deprecated Instead use setCancelledDate - * - * @param string $cancelled_date - * @return $this - */ - public function setCancelled_date($cancelled_date) - { - $this->cancelled_date = $cancelled_date; - return $this; - } - - /** - * Date when the resource was cancelled. - * @deprecated Instead use getCancelledDate - * - * @return string - */ - public function getCancelled_date() - { - return $this->cancelled_date; - } - /** * Actor who cancelled the resource. * @@ -192,31 +117,6 @@ class InvoicingMetaData extends PPModel return $this->cancelled_by; } - /** - * Actor who cancelled the resource. - * - * @deprecated Instead use setCancelledBy - * - * @param string $cancelled_by - * @return $this - */ - public function setCancelled_by($cancelled_by) - { - $this->cancelled_by = $cancelled_by; - return $this; - } - - /** - * Actor who cancelled the resource. - * @deprecated Instead use getCancelledBy - * - * @return string - */ - public function getCancelled_by() - { - return $this->cancelled_by; - } - /** * Date when the resource was last edited. * @@ -240,31 +140,6 @@ class InvoicingMetaData extends PPModel return $this->last_updated_date; } - /** - * Date when the resource was last edited. - * - * @deprecated Instead use setLastUpdatedDate - * - * @param string $last_updated_date - * @return $this - */ - public function setLast_updated_date($last_updated_date) - { - $this->last_updated_date = $last_updated_date; - return $this; - } - - /** - * Date when the resource was last edited. - * @deprecated Instead use getLastUpdatedDate - * - * @return string - */ - public function getLast_updated_date() - { - return $this->last_updated_date; - } - /** * Email address of the account that last edited the resource. * @@ -288,31 +163,6 @@ class InvoicingMetaData extends PPModel return $this->last_updated_by; } - /** - * Email address of the account that last edited the resource. - * - * @deprecated Instead use setLastUpdatedBy - * - * @param string $last_updated_by - * @return $this - */ - public function setLast_updated_by($last_updated_by) - { - $this->last_updated_by = $last_updated_by; - return $this; - } - - /** - * Email address of the account that last edited the resource. - * @deprecated Instead use getLastUpdatedBy - * - * @return string - */ - public function getLast_updated_by() - { - return $this->last_updated_by; - } - /** * Date when the resource was first sent. * @@ -336,31 +186,6 @@ class InvoicingMetaData extends PPModel return $this->first_sent_date; } - /** - * Date when the resource was first sent. - * - * @deprecated Instead use setFirstSentDate - * - * @param string $first_sent_date - * @return $this - */ - public function setFirst_sent_date($first_sent_date) - { - $this->first_sent_date = $first_sent_date; - return $this; - } - - /** - * Date when the resource was first sent. - * @deprecated Instead use getFirstSentDate - * - * @return string - */ - public function getFirst_sent_date() - { - return $this->first_sent_date; - } - /** * Date when the resource was last sent. * @@ -384,31 +209,6 @@ class InvoicingMetaData extends PPModel return $this->last_sent_date; } - /** - * Date when the resource was last sent. - * - * @deprecated Instead use setLastSentDate - * - * @param string $last_sent_date - * @return $this - */ - public function setLast_sent_date($last_sent_date) - { - $this->last_sent_date = $last_sent_date; - return $this; - } - - /** - * Date when the resource was last sent. - * @deprecated Instead use getLastSentDate - * - * @return string - */ - public function getLast_sent_date() - { - return $this->last_sent_date; - } - /** * Email address of the account that last sent the resource. * @@ -432,31 +232,6 @@ class InvoicingMetaData extends PPModel return $this->last_sent_by; } - /** - * Email address of the account that last sent the resource. - * - * @deprecated Instead use setLastSentBy - * - * @param string $last_sent_by - * @return $this - */ - public function setLast_sent_by($last_sent_by) - { - $this->last_sent_by = $last_sent_by; - return $this; - } - - /** - * Email address of the account that last sent the resource. - * @deprecated Instead use getLastSentBy - * - * @return string - */ - public function getLast_sent_by() - { - return $this->last_sent_by; - } - /** * URL representing the payer's view of the invoice. * @@ -481,29 +256,4 @@ class InvoicingMetaData extends PPModel return $this->payer_view_url; } - /** - * URL representing the payer's view of the invoice. - * - * @deprecated Instead use setPayerViewUrl - * - * @param string $payer_view_url - * @return $this - */ - public function setPayer_view_url($payer_view_url) - { - $this->payer_view_url = $payer_view_url; - return $this; - } - - /** - * URL representing the payer's view of the invoice. - * @deprecated Instead use getPayerViewUrl - * - * @return string - */ - public function getPayer_view_url() - { - return $this->payer_view_url; - } - } diff --git a/lib/PayPal/Api/InvoicingNotification.php b/lib/PayPal/Api/InvoicingNotification.php index 1e1b0bd..e9a53d0 100644 --- a/lib/PayPal/Api/InvoicingNotification.php +++ b/lib/PayPal/Api/InvoicingNotification.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoicingNotification @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string note * @property bool send_to_merchant */ -class InvoicingNotification extends PPModel +class InvoicingNotification extends PayPalModel { /** * Subject of the notification. @@ -86,29 +86,4 @@ class InvoicingNotification extends PPModel return $this->send_to_merchant; } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @deprecated Instead use setSendToMerchant - * - * @param bool $send_to_merchant - * @return $this - */ - public function setSend_to_merchant($send_to_merchant) - { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * @deprecated Instead use getSendToMerchant - * - * @return bool - */ - public function getSend_to_merchant() - { - return $this->send_to_merchant; - } - } diff --git a/lib/PayPal/Api/InvoicingPaymentDetail.php b/lib/PayPal/Api/InvoicingPaymentDetail.php index 11ecc6a..c13a27d 100644 --- a/lib/PayPal/Api/InvoicingPaymentDetail.php +++ b/lib/PayPal/Api/InvoicingPaymentDetail.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoicingPaymentDetail @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property string method * @property string note */ -class InvoicingPaymentDetail extends PPModel +class InvoicingPaymentDetail extends PayPalModel { /** * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. @@ -67,31 +67,6 @@ class InvoicingPaymentDetail extends PPModel return $this->transaction_id; } - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @deprecated Instead use setTransactionId - * - * @param string $transaction_id - * @return $this - */ - public function setTransaction_id($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * @deprecated Instead use getTransactionId - * - * @return string - */ - public function getTransaction_id() - { - return $this->transaction_id; - } - /** * Type of the transaction. * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"] @@ -116,31 +91,6 @@ class InvoicingPaymentDetail extends PPModel return $this->transaction_type; } - /** - * Type of the transaction. - * - * @deprecated Instead use setTransactionType - * - * @param string $transaction_type - * @return $this - */ - public function setTransaction_type($transaction_type) - { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of the transaction. - * @deprecated Instead use getTransactionType - * - * @return string - */ - public function getTransaction_type() - { - return $this->transaction_type; - } - /** * Date when the invoice was paid. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * diff --git a/lib/PayPal/Api/InvoicingRefundDetail.php b/lib/PayPal/Api/InvoicingRefundDetail.php index 99ebbaa..3390a2a 100644 --- a/lib/PayPal/Api/InvoicingRefundDetail.php +++ b/lib/PayPal/Api/InvoicingRefundDetail.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class InvoicingRefundDetail @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string date * @property string note */ -class InvoicingRefundDetail extends PPModel +class InvoicingRefundDetail extends PayPalModel { /** * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. diff --git a/lib/PayPal/Api/Item.php b/lib/PayPal/Api/Item.php index 0faf5aa..7fcc5ca 100644 --- a/lib/PayPal/Api/Item.php +++ b/lib/PayPal/Api/Item.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Validation\UrlValidator; use PayPal\Validation\NumericValidator; -use PayPal\Common\FormatConverter; +use PayPal\Converter\FormatConverter; /** * Class Item @@ -27,7 +27,7 @@ use PayPal\Common\FormatConverter; * @property \PayPal\Api\NameValuePair supplementary_data * @property \PayPal\Api\NameValuePair postback_data */ -class Item extends PPModel +class Item extends PayPalModel { /** * Number of items. @@ -275,31 +275,6 @@ class Item extends PPModel return $this->supplementary_data; } - /** - * Set of optional data used for PayPal risk determination. - * - * @deprecated Instead use setSupplementaryData - * - * @param \PayPal\Api\NameValuePair $supplementary_data - * @return $this - */ - public function setSupplementary_data($supplementary_data) - { - $this->supplementary_data = $supplementary_data; - return $this; - } - - /** - * Set of optional data used for PayPal risk determination. - * @deprecated Instead use getSupplementaryData - * - * @return \PayPal\Api\NameValuePair - */ - public function getSupplementary_data() - { - return $this->supplementary_data; - } - /** * Set of optional data used for PayPal post-transaction notifications. * @@ -324,29 +299,4 @@ class Item extends PPModel return $this->postback_data; } - /** - * Set of optional data used for PayPal post-transaction notifications. - * - * @deprecated Instead use setPostbackData - * - * @param \PayPal\Api\NameValuePair $postback_data - * @return $this - */ - public function setPostback_data($postback_data) - { - $this->postback_data = $postback_data; - return $this; - } - - /** - * Set of optional data used for PayPal post-transaction notifications. - * @deprecated Instead use getPostbackData - * - * @return \PayPal\Api\NameValuePair - */ - public function getPostback_data() - { - return $this->postback_data; - } - } diff --git a/lib/PayPal/Api/ItemList.php b/lib/PayPal/Api/ItemList.php index 3504041..4e7666b 100644 --- a/lib/PayPal/Api/ItemList.php +++ b/lib/PayPal/Api/ItemList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -15,7 +15,7 @@ use PayPal\Rest\ApiContext; * @property \PayPal\Api\Item[] items * @property \PayPal\Api\ShippingAddress shipping_address */ -class ItemList extends PPModel +class ItemList extends PayPalModel { /** * Is this list empty? @@ -100,30 +100,4 @@ class ItemList extends PPModel return $this->shipping_address; } - /** - * Shipping address. - * - * @deprecated Instead use setShippingAddress - * - * @param \PayPal\Api\ShippingAddress $shipping_address - * @return $this - */ - public function setShipping_address($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * Shipping address. - * - * @deprecated Instead use getShippingAddress - * - * @return \PayPal\Api\ShippingAddress - */ - public function getShipping_address() - { - return $this->shipping_address; - } - } diff --git a/lib/PayPal/Api/Links.php b/lib/PayPal/Api/Links.php index 64c3841..7e00880 100644 --- a/lib/PayPal/Api/Links.php +++ b/lib/PayPal/Api/Links.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Links @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property string enctype * @property \PayPal\Api\HyperSchema schema */ -class Links extends PPModel +class Links extends PayPalModel { /** * Sets Href diff --git a/lib/PayPal/Api/MerchantInfo.php b/lib/PayPal/Api/MerchantInfo.php index 2389985..4d97d8c 100644 --- a/lib/PayPal/Api/MerchantInfo.php +++ b/lib/PayPal/Api/MerchantInfo.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class MerchantInfo @@ -22,7 +22,7 @@ use PayPal\Common\PPModel; * @property string tax_id * @property string additional_info */ -class MerchantInfo extends PPModel +class MerchantInfo extends PayPalModel { /** * Email address of the merchant. 260 characters max. @@ -70,31 +70,6 @@ class MerchantInfo extends PPModel return $this->first_name; } - /** - * First name of the merchant. 30 characters max. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the merchant. 30 characters max. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Last name of the merchant. 30 characters max. * @@ -118,31 +93,6 @@ class MerchantInfo extends PPModel return $this->last_name; } - /** - * Last name of the merchant. 30 characters max. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the merchant. 30 characters max. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Address of the merchant. * @@ -189,31 +139,6 @@ class MerchantInfo extends PPModel return $this->business_name; } - /** - * Company business name of the merchant. 100 characters max. - * - * @deprecated Instead use setBusinessName - * - * @param string $business_name - * @return $this - */ - public function setBusiness_name($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the merchant. 100 characters max. - * @deprecated Instead use getBusinessName - * - * @return string - */ - public function getBusiness_name() - { - return $this->business_name; - } - /** * Phone number of the merchant. * @@ -306,31 +231,6 @@ class MerchantInfo extends PPModel return $this->tax_id; } - /** - * Tax ID of the merchant. 100 characters max. - * - * @deprecated Instead use setTaxId - * - * @param string $tax_id - * @return $this - */ - public function setTax_id($tax_id) - { - $this->tax_id = $tax_id; - return $this; - } - - /** - * Tax ID of the merchant. 100 characters max. - * @deprecated Instead use getTaxId - * - * @return string - */ - public function getTax_id() - { - return $this->tax_id; - } - /** * Option to display additional information such as business hours. 40 characters max. * @@ -354,29 +254,4 @@ class MerchantInfo extends PPModel return $this->additional_info; } - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @deprecated Instead use setAdditionalInfo - * - * @param string $additional_info - * @return $this - */ - public function setAdditional_info($additional_info) - { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * @deprecated Instead use getAdditionalInfo - * - * @return string - */ - public function getAdditional_info() - { - return $this->additional_info; - } - } diff --git a/lib/PayPal/Api/MerchantPreferences.php b/lib/PayPal/Api/MerchantPreferences.php index 404eee0..b51d604 100644 --- a/lib/PayPal/Api/MerchantPreferences.php +++ b/lib/PayPal/Api/MerchantPreferences.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Validation\UrlValidator; /** @@ -23,7 +23,7 @@ use PayPal\Validation\UrlValidator; * @property string accepted_payment_type * @property string char_set */ -class MerchantPreferences extends PPModel +class MerchantPreferences extends PayPalModel { /** * Identifier of the merchant_preferences. 128 characters max. @@ -71,31 +71,6 @@ class MerchantPreferences extends PPModel return $this->setup_fee; } - /** - * Setup fee amount. Default is 0. - * - * @deprecated Instead use setSetupFee - * - * @param \PayPal\Api\Currency $setup_fee - * @return $this - */ - public function setSetup_fee($setup_fee) - { - $this->setup_fee = $setup_fee; - return $this; - } - - /** - * Setup fee amount. Default is 0. - * @deprecated Instead use getSetupFee - * - * @return \PayPal\Api\Currency - */ - public function getSetup_fee() - { - return $this->setup_fee; - } - /** * Redirect URL on cancellation of agreement request. 1000 characters max. * @@ -120,31 +95,6 @@ class MerchantPreferences extends PPModel return $this->cancel_url; } - /** - * Redirect URL on cancellation of agreement request. 1000 characters max. - * - * @deprecated Instead use setCancelUrl - * - * @param string $cancel_url - * @return $this - */ - public function setCancel_url($cancel_url) - { - $this->cancel_url = $cancel_url; - return $this; - } - - /** - * Redirect URL on cancellation of agreement request. 1000 characters max. - * @deprecated Instead use getCancelUrl - * - * @return string - */ - public function getCancel_url() - { - return $this->cancel_url; - } - /** * Redirect URL on creation of agreement request. 1000 characters max. * @@ -169,31 +119,6 @@ class MerchantPreferences extends PPModel return $this->return_url; } - /** - * Redirect URL on creation of agreement request. 1000 characters max. - * - * @deprecated Instead use setReturnUrl - * - * @param string $return_url - * @return $this - */ - public function setReturn_url($return_url) - { - $this->return_url = $return_url; - return $this; - } - - /** - * Redirect URL on creation of agreement request. 1000 characters max. - * @deprecated Instead use getReturnUrl - * - * @return string - */ - public function getReturn_url() - { - return $this->return_url; - } - /** * Notify URL on agreement creation. 1000 characters max. * @@ -218,31 +143,6 @@ class MerchantPreferences extends PPModel return $this->notify_url; } - /** - * Notify URL on agreement creation. 1000 characters max. - * - * @deprecated Instead use setNotifyUrl - * - * @param string $notify_url - * @return $this - */ - public function setNotify_url($notify_url) - { - $this->notify_url = $notify_url; - return $this; - } - - /** - * Notify URL on agreement creation. 1000 characters max. - * @deprecated Instead use getNotifyUrl - * - * @return string - */ - public function getNotify_url() - { - return $this->notify_url; - } - /** * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts. * @@ -266,31 +166,6 @@ class MerchantPreferences extends PPModel return $this->max_fail_attempts; } - /** - * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts. - * - * @deprecated Instead use setMaxFailAttempts - * - * @param string $max_fail_attempts - * @return $this - */ - public function setMax_fail_attempts($max_fail_attempts) - { - $this->max_fail_attempts = $max_fail_attempts; - return $this; - } - - /** - * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts. - * @deprecated Instead use getMaxFailAttempts - * - * @return string - */ - public function getMax_fail_attempts() - { - return $this->max_fail_attempts; - } - /** * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`. * @@ -314,31 +189,6 @@ class MerchantPreferences extends PPModel return $this->auto_bill_amount; } - /** - * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`. - * - * @deprecated Instead use setAutoBillAmount - * - * @param string $auto_bill_amount - * @return $this - */ - public function setAuto_bill_amount($auto_bill_amount) - { - $this->auto_bill_amount = $auto_bill_amount; - return $this; - } - - /** - * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`. - * @deprecated Instead use getAutoBillAmount - * - * @return string - */ - public function getAuto_bill_amount() - { - return $this->auto_bill_amount; - } - /** * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue. * @@ -362,31 +212,6 @@ class MerchantPreferences extends PPModel return $this->initial_fail_amount_action; } - /** - * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue. - * - * @deprecated Instead use setInitialFailAmountAction - * - * @param string $initial_fail_amount_action - * @return $this - */ - public function setInitial_fail_amount_action($initial_fail_amount_action) - { - $this->initial_fail_amount_action = $initial_fail_amount_action; - return $this; - } - - /** - * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue. - * @deprecated Instead use getInitialFailAmountAction - * - * @return string - */ - public function getInitial_fail_amount_action() - { - return $this->initial_fail_amount_action; - } - /** * Payment types that are accepted for this plan. * @@ -410,31 +235,6 @@ class MerchantPreferences extends PPModel return $this->accepted_payment_type; } - /** - * Payment types that are accepted for this plan. - * - * @deprecated Instead use setAcceptedPaymentType - * - * @param string $accepted_payment_type - * @return $this - */ - public function setAccepted_payment_type($accepted_payment_type) - { - $this->accepted_payment_type = $accepted_payment_type; - return $this; - } - - /** - * Payment types that are accepted for this plan. - * @deprecated Instead use getAcceptedPaymentType - * - * @return string - */ - public function getAccepted_payment_type() - { - return $this->accepted_payment_type; - } - /** * char_set for this plan. * @@ -458,29 +258,4 @@ class MerchantPreferences extends PPModel return $this->char_set; } - /** - * char_set for this plan. - * - * @deprecated Instead use setCharSet - * - * @param string $char_set - * @return $this - */ - public function setChar_set($char_set) - { - $this->char_set = $char_set; - return $this; - } - - /** - * char_set for this plan. - * @deprecated Instead use getCharSet - * - * @return string - */ - public function getChar_set() - { - return $this->char_set; - } - } diff --git a/lib/PayPal/Api/Metadata.php b/lib/PayPal/Api/Metadata.php index ffab420..d4f3eaf 100644 --- a/lib/PayPal/Api/Metadata.php +++ b/lib/PayPal/Api/Metadata.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Validation\UrlValidator; /** @@ -23,7 +23,7 @@ use PayPal\Validation\UrlValidator; * @property string last_sent_by * @property string payer_view_url */ -class Metadata extends PPModel +class Metadata extends PayPalModel { /** * Date when the resource was created. @@ -48,31 +48,6 @@ class Metadata extends PPModel return $this->created_date; } - /** - * Date when the resource was created. - * - * @deprecated Instead use setCreatedDate - * - * @param string $created_date - * @return $this - */ - public function setCreated_date($created_date) - { - $this->created_date = $created_date; - return $this; - } - - /** - * Date when the resource was created. - * @deprecated Instead use getCreatedDate - * - * @return string - */ - public function getCreated_date() - { - return $this->created_date; - } - /** * Email address of the account that created the resource. * @@ -96,31 +71,6 @@ class Metadata extends PPModel return $this->created_by; } - /** - * Email address of the account that created the resource. - * - * @deprecated Instead use setCreatedBy - * - * @param string $created_by - * @return $this - */ - public function setCreated_by($created_by) - { - $this->created_by = $created_by; - return $this; - } - - /** - * Email address of the account that created the resource. - * @deprecated Instead use getCreatedBy - * - * @return string - */ - public function getCreated_by() - { - return $this->created_by; - } - /** * Date when the resource was cancelled. * @@ -144,31 +94,6 @@ class Metadata extends PPModel return $this->cancelled_date; } - /** - * Date when the resource was cancelled. - * - * @deprecated Instead use setCancelledDate - * - * @param string $cancelled_date - * @return $this - */ - public function setCancelled_date($cancelled_date) - { - $this->cancelled_date = $cancelled_date; - return $this; - } - - /** - * Date when the resource was cancelled. - * @deprecated Instead use getCancelledDate - * - * @return string - */ - public function getCancelled_date() - { - return $this->cancelled_date; - } - /** * Actor who cancelled the resource. * @@ -192,31 +117,6 @@ class Metadata extends PPModel return $this->cancelled_by; } - /** - * Actor who cancelled the resource. - * - * @deprecated Instead use setCancelledBy - * - * @param string $cancelled_by - * @return $this - */ - public function setCancelled_by($cancelled_by) - { - $this->cancelled_by = $cancelled_by; - return $this; - } - - /** - * Actor who cancelled the resource. - * @deprecated Instead use getCancelledBy - * - * @return string - */ - public function getCancelled_by() - { - return $this->cancelled_by; - } - /** * Date when the resource was last edited. * @@ -240,31 +140,6 @@ class Metadata extends PPModel return $this->last_updated_date; } - /** - * Date when the resource was last edited. - * - * @deprecated Instead use setLastUpdatedDate - * - * @param string $last_updated_date - * @return $this - */ - public function setLast_updated_date($last_updated_date) - { - $this->last_updated_date = $last_updated_date; - return $this; - } - - /** - * Date when the resource was last edited. - * @deprecated Instead use getLastUpdatedDate - * - * @return string - */ - public function getLast_updated_date() - { - return $this->last_updated_date; - } - /** * Email address of the account that last edited the resource. * @@ -288,31 +163,6 @@ class Metadata extends PPModel return $this->last_updated_by; } - /** - * Email address of the account that last edited the resource. - * - * @deprecated Instead use setLastUpdatedBy - * - * @param string $last_updated_by - * @return $this - */ - public function setLast_updated_by($last_updated_by) - { - $this->last_updated_by = $last_updated_by; - return $this; - } - - /** - * Email address of the account that last edited the resource. - * @deprecated Instead use getLastUpdatedBy - * - * @return string - */ - public function getLast_updated_by() - { - return $this->last_updated_by; - } - /** * Date when the resource was first sent. * @@ -336,31 +186,6 @@ class Metadata extends PPModel return $this->first_sent_date; } - /** - * Date when the resource was first sent. - * - * @deprecated Instead use setFirstSentDate - * - * @param string $first_sent_date - * @return $this - */ - public function setFirst_sent_date($first_sent_date) - { - $this->first_sent_date = $first_sent_date; - return $this; - } - - /** - * Date when the resource was first sent. - * @deprecated Instead use getFirstSentDate - * - * @return string - */ - public function getFirst_sent_date() - { - return $this->first_sent_date; - } - /** * Date when the resource was last sent. * @@ -384,31 +209,6 @@ class Metadata extends PPModel return $this->last_sent_date; } - /** - * Date when the resource was last sent. - * - * @deprecated Instead use setLastSentDate - * - * @param string $last_sent_date - * @return $this - */ - public function setLast_sent_date($last_sent_date) - { - $this->last_sent_date = $last_sent_date; - return $this; - } - - /** - * Date when the resource was last sent. - * @deprecated Instead use getLastSentDate - * - * @return string - */ - public function getLast_sent_date() - { - return $this->last_sent_date; - } - /** * Email address of the account that last sent the resource. * @@ -432,31 +232,6 @@ class Metadata extends PPModel return $this->last_sent_by; } - /** - * Email address of the account that last sent the resource. - * - * @deprecated Instead use setLastSentBy - * - * @param string $last_sent_by - * @return $this - */ - public function setLast_sent_by($last_sent_by) - { - $this->last_sent_by = $last_sent_by; - return $this; - } - - /** - * Email address of the account that last sent the resource. - * @deprecated Instead use getLastSentBy - * - * @return string - */ - public function getLast_sent_by() - { - return $this->last_sent_by; - } - /** * URL representing the payer's view of the invoice. * @@ -481,29 +256,4 @@ class Metadata extends PPModel return $this->payer_view_url; } - /** - * URL representing the payer's view of the invoice. - * - * @deprecated Instead use setPayerViewUrl - * - * @param string $payer_view_url - * @return $this - */ - public function setPayer_view_url($payer_view_url) - { - $this->payer_view_url = $payer_view_url; - return $this; - } - - /** - * URL representing the payer's view of the invoice. - * @deprecated Instead use getPayerViewUrl - * - * @return string - */ - public function getPayer_view_url() - { - return $this->payer_view_url; - } - } diff --git a/lib/PayPal/Api/NameValuePair.php b/lib/PayPal/Api/NameValuePair.php index e62d4fc..2dffd50 100644 --- a/lib/PayPal/Api/NameValuePair.php +++ b/lib/PayPal/Api/NameValuePair.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -15,7 +15,7 @@ use PayPal\Rest\ApiContext; * @property string name * @property string value */ -class NameValuePair extends PPModel +class NameValuePair extends PayPalModel { /** * Key for the name value pair. The value name types should be correlated diff --git a/lib/PayPal/Api/Notification.php b/lib/PayPal/Api/Notification.php index 80f352d..743f001 100644 --- a/lib/PayPal/Api/Notification.php +++ b/lib/PayPal/Api/Notification.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Notification @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string note * @property bool send_to_merchant */ -class Notification extends PPModel +class Notification extends PayPalModel { /** * Subject of the notification. @@ -86,29 +86,4 @@ class Notification extends PPModel return $this->send_to_merchant; } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @deprecated Instead use setSendToMerchant - * - * @param bool $send_to_merchant - * @return $this - */ - public function setSend_to_merchant($send_to_merchant) - { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * @deprecated Instead use getSendToMerchant - * - * @return bool - */ - public function getSend_to_merchant() - { - return $this->send_to_merchant; - } - } diff --git a/lib/PayPal/Auth/Openid/PPOpenIdAddress.php b/lib/PayPal/Api/OpenIdAddress.php similarity index 91% rename from lib/PayPal/Auth/Openid/PPOpenIdAddress.php rename to lib/PayPal/Api/OpenIdAddress.php index 64486e7..4bfe2dd 100644 --- a/lib/PayPal/Auth/Openid/PPOpenIdAddress.php +++ b/lib/PayPal/Api/OpenIdAddress.php @@ -1,19 +1,20 @@ fromJson($json); return $token; } @@ -205,7 +211,7 @@ class PPOpenIdTokeninfo extends ResourceModel * (optional) grant_type is the Token grant type. Defaults to refresh_token * (optional) scope is an array that either the same or a subset of the scope passed to the authorization request * @param APIContext $apiContext Optional API Context - * @return PPOpenIdTokeninfo + * @return OpenIdTokeninfo */ public function createFromRefreshToken($params, $apiContext = null) { diff --git a/lib/PayPal/Auth/Openid/PPOpenIdUserinfo.php b/lib/PayPal/Api/OpenIdUserinfo.php similarity index 93% rename from lib/PayPal/Auth/Openid/PPOpenIdUserinfo.php rename to lib/PayPal/Api/OpenIdUserinfo.php index f49d343..445505a 100644 --- a/lib/PayPal/Auth/Openid/PPOpenIdUserinfo.php +++ b/lib/PayPal/Api/OpenIdUserinfo.php @@ -1,19 +1,20 @@ fromJson($json); return $ret; diff --git a/lib/PayPal/Api/Order.php b/lib/PayPal/Api/Order.php index 8f82e48..9db965b 100644 --- a/lib/PayPal/Api/Order.php +++ b/lib/PayPal/Api/Order.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -24,7 +24,7 @@ use PayPal\Rest\ApiContext; * @property string protection_eligibility_type * @property \PayPal\Api\Links links */ -class Order extends PPModel +class Order extends PayPalModel { /** * Identifier of the order transaction. @@ -74,31 +74,6 @@ class Order extends PPModel return $this->purchase_unit_reference_id; } - /** - * Identifier to the purchase unit associated with this object - * - * @deprecated Instead use setPurchaseUnitReferenceId - * - * @param string $purchase_unit_reference_id - * @return $this - */ - public function setPurchase_unit_reference_id($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Identifier to the purchase unit associated with this object - * @deprecated Instead use getPurchaseUnitReferenceId - * - * @return string - */ - public function getPurchase_unit_reference_id() - { - return $this->purchase_unit_reference_id; - } - /** * Time the resource was created in UTC ISO8601 format. * @@ -123,31 +98,6 @@ class Order extends PPModel return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated in UTC ISO8601 format. * @@ -172,31 +122,6 @@ class Order extends PPModel return $this->update_time; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Amount being collected. * @@ -245,31 +170,6 @@ class Order extends PPModel return $this->payment_mode; } - /** - * specifies payment mode of the transaction - * - * @deprecated Instead use setPaymentMode - * - * @param string $payment_mode - * @return $this - */ - public function setPayment_mode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * specifies payment mode of the transaction - * @deprecated Instead use getPaymentMode - * - * @return string - */ - public function getPayment_mode() - { - return $this->payment_mode; - } - /** * State of the order transaction. * Valid Values: ["PENDING", "COMPLETED", "REFUNDED", "PARTIALLY_REFUNDED"] @@ -318,31 +218,6 @@ class Order extends PPModel return $this->reason_code; } - /** - * Reason code for the transaction state being Pending or Reversed. - * - * @deprecated Instead use setReasonCode - * - * @param string $reason_code - * @return $this - */ - public function setReason_code($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * Reason code for the transaction state being Pending or Reversed. - * @deprecated Instead use getReasonCode - * - * @return string - */ - public function getReason_code() - { - return $this->reason_code; - } - /** * Protection Eligibility of the Payer * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] @@ -367,31 +242,6 @@ class Order extends PPModel return $this->{"protection-eligibility"}; } - /** - * Protection Eligibility of the Payer - * - * @deprecated Instead use setProtectionEligibility - * - * @param string $protection-eligibility - * @return $this - */ - public function setProtection_eligibility($protection_eligibility) - { - $this->{"protection-eligibility"} = $protection_eligibility; - return $this; - } - - /** - * Protection Eligibility of the Payer - * @deprecated Instead use getProtectionEligibility - * - * @return string - */ - public function getProtection_eligibility() - { - return $this->{"protection-eligibility"}; - } - /** * Protection Eligibility Type of the Payer * Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] @@ -416,31 +266,6 @@ class Order extends PPModel return $this->{"protection-eligibility_type"}; } - /** - * Protection Eligibility Type of the Payer - * - * @deprecated Instead use setProtectionEligibilityType - * - * @param string $protection-eligibility_type - * @return $this - */ - public function setProtection_eligibility_type($protection_eligibility_type) - { - $this->{"protection-eligibility_type"} = $protection_eligibility_type; - return $this; - } - - /** - * Protection Eligibility Type of the Payer - * @deprecated Instead use getProtectionEligibilityType - * - * @return string - */ - public function getProtection_eligibility_type() - { - return $this->{"protection-eligibility_type"}; - } - /** * Sets Links * diff --git a/lib/PayPal/Api/OverrideChargeModel.php b/lib/PayPal/Api/OverrideChargeModel.php index b720222..b911c17 100644 --- a/lib/PayPal/Api/OverrideChargeModel.php +++ b/lib/PayPal/Api/OverrideChargeModel.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class OverrideChargeModel @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property string charge_id * @property \PayPal\Api\Currency amount */ -class OverrideChargeModel extends PPModel +class OverrideChargeModel extends PayPalModel { /** * ID of charge model. @@ -39,31 +39,6 @@ class OverrideChargeModel extends PPModel return $this->charge_id; } - /** - * ID of charge model. - * - * @deprecated Instead use setChargeId - * - * @param string $charge_id - * @return $this - */ - public function setCharge_id($charge_id) - { - $this->charge_id = $charge_id; - return $this; - } - - /** - * ID of charge model. - * @deprecated Instead use getChargeId - * - * @return string - */ - public function getCharge_id() - { - return $this->charge_id; - } - /** * Updated Amount to be associated with this charge model. * diff --git a/lib/PayPal/Api/Patch.php b/lib/PayPal/Api/Patch.php index 5b1974b..0f68c70 100644 --- a/lib/PayPal/Api/Patch.php +++ b/lib/PayPal/Api/Patch.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Patch @@ -16,7 +16,7 @@ use PayPal\Common\PPModel; * @property mixed value * @property string from */ -class Patch extends PPModel +class Patch extends PayPalModel { /** * The operation to perform. diff --git a/lib/PayPal/Api/PatchRequest.php b/lib/PayPal/Api/PatchRequest.php index 74b4210..effc105 100644 --- a/lib/PayPal/Api/PatchRequest.php +++ b/lib/PayPal/Api/PatchRequest.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PatchRequest @@ -13,7 +13,7 @@ use PayPal\Common\PPModel; * * @property \PayPal\Api\Patch[] patches */ -class PatchRequest extends PPModel +class PatchRequest extends PayPalModel { /** * Placeholder for holding array of patch objects diff --git a/lib/PayPal/Api/Payee.php b/lib/PayPal/Api/Payee.php index 6d4400d..31344cd 100644 --- a/lib/PayPal/Api/Payee.php +++ b/lib/PayPal/Api/Payee.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -16,7 +16,7 @@ use PayPal\Rest\ApiContext; * @property string merchant_id * @property \PayPal\Api\Phone phone */ -class Payee extends PPModel +class Payee extends PayPalModel { /** * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. @@ -66,31 +66,6 @@ class Payee extends PPModel return $this->merchant_id; } - /** - * Encrypted PayPal Account identifier for the Payee. - * - * @deprecated Instead use setMerchantId - * - * @param string $merchant_id - * @return $this - */ - public function setMerchant_id($merchant_id) - { - $this->merchant_id = $merchant_id; - return $this; - } - - /** - * Encrypted PayPal Account identifier for the Payee. - * @deprecated Instead use getMerchantId - * - * @return string - */ - public function getMerchant_id() - { - return $this->merchant_id; - } - /** * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. * diff --git a/lib/PayPal/Api/Payer.php b/lib/PayPal/Api/Payer.php index d6d87d7..a012a74 100644 --- a/lib/PayPal/Api/Payer.php +++ b/lib/PayPal/Api/Payer.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Payer @@ -17,7 +17,7 @@ use PayPal\Common\PPModel; * @property string funding_option_id * @property \PayPal\Api\PayerInfo payer_info */ -class Payer extends PPModel +class Payer extends PayPalModel { /** * Payment method being used - PayPal Wallet payment, Bank Direct Debit, or Direct Credit card. @@ -43,31 +43,6 @@ class Payer extends PPModel return $this->payment_method; } - /** - * Payment method being used - PayPal Wallet payment, Bank Direct Debit, or Direct Credit card. - * - * @deprecated Instead use setPaymentMethod - * - * @param string $payment_method - * @return $this - */ - public function setPayment_method($payment_method) - { - $this->payment_method = $payment_method; - return $this; - } - - /** - * Payment method being used - PayPal Wallet payment, Bank Direct Debit, or Direct Credit card. - * @deprecated Instead use getPaymentMethod - * - * @return string - */ - public function getPayment_method() - { - return $this->payment_method; - } - /** * Status of Payer PayPal Account. * Valid Values: ["VERIFIED", "UNVERIFIED"] @@ -145,31 +120,6 @@ class Payer extends PPModel ); } - /** - * List of funding instruments from which the funds of the current payment come. Typically a credit card. - * - * @deprecated Instead use setFundingInstruments - * - * @param \PayPal\Api\FundingInstrument $funding_instruments - * @return $this - */ - public function setFunding_instruments($funding_instruments) - { - $this->funding_instruments = $funding_instruments; - return $this; - } - - /** - * List of funding instruments from which the funds of the current payment come. Typically a credit card. - * @deprecated Instead use getFundingInstruments - * - * @return \PayPal\Api\FundingInstrument - */ - public function getFunding_instruments() - { - return $this->funding_instruments; - } - /** * Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present. * @@ -193,31 +143,6 @@ class Payer extends PPModel return $this->funding_option_id; } - /** - * Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present. - * - * @deprecated Instead use setFundingOptionId - * - * @param string $funding_option_id - * @return $this - */ - public function setFunding_option_id($funding_option_id) - { - $this->funding_option_id = $funding_option_id; - return $this; - } - - /** - * Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present. - * @deprecated Instead use getFundingOptionId - * - * @return string - */ - public function getFunding_option_id() - { - return $this->funding_option_id; - } - /** * Information related to the Payer. * @@ -241,29 +166,4 @@ class Payer extends PPModel return $this->payer_info; } - /** - * Information related to the Payer. - * - * @deprecated Instead use setPayerInfo - * - * @param \PayPal\Api\PayerInfo $payer_info - * @return $this - */ - public function setPayer_info($payer_info) - { - $this->payer_info = $payer_info; - return $this; - } - - /** - * Information related to the Payer. - * @deprecated Instead use getPayerInfo - * - * @return \PayPal\Api\PayerInfo - */ - public function getPayer_info() - { - return $this->payer_info; - } - } diff --git a/lib/PayPal/Api/PayerInfo.php b/lib/PayPal/Api/PayerInfo.php index 0439117..f57ecb4 100644 --- a/lib/PayPal/Api/PayerInfo.php +++ b/lib/PayPal/Api/PayerInfo.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PayerInfo @@ -25,7 +25,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\Address billing_address * @property \PayPal\Api\ShippingAddress shipping_address */ -class PayerInfo extends PPModel +class PayerInfo extends PayPalModel { /** * Email address representing the Payer. @@ -73,31 +73,6 @@ class PayerInfo extends PPModel return $this->external_remember_me_id; } - /** - * External Remember Me id representing the Payer - * - * @deprecated Instead use setExternalRememberMeId - * - * @param string $external_remember_me_id - * @return $this - */ - public function setExternal_remember_me_id($external_remember_me_id) - { - $this->external_remember_me_id = $external_remember_me_id; - return $this; - } - - /** - * External Remember Me id representing the Payer - * @deprecated Instead use getExternalRememberMeId - * - * @return string - */ - public function getExternal_remember_me_id() - { - return $this->external_remember_me_id; - } - /** * Account Number representing the Payer * @@ -121,31 +96,6 @@ class PayerInfo extends PPModel return $this->buyer_account_number; } - /** - * Account Number representing the Payer - * - * @deprecated Instead use setBuyerAccountNumber - * - * @param string $buyer_account_number - * @return $this - */ - public function setBuyer_account_number($buyer_account_number) - { - $this->buyer_account_number = $buyer_account_number; - return $this; - } - - /** - * Account Number representing the Payer - * @deprecated Instead use getBuyerAccountNumber - * - * @return string - */ - public function getBuyer_account_number() - { - return $this->buyer_account_number; - } - /** * First Name of the Payer. * @@ -169,31 +119,6 @@ class PayerInfo extends PPModel return $this->first_name; } - /** - * First Name of the Payer. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First Name of the Payer. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Last Name of the Payer. * @@ -217,31 +142,6 @@ class PayerInfo extends PPModel return $this->last_name; } - /** - * Last Name of the Payer. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last Name of the Payer. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * PayPal assigned Payer ID. * @@ -265,31 +165,6 @@ class PayerInfo extends PPModel return $this->payer_id; } - /** - * PayPal assigned Payer ID. - * - * @deprecated Instead use setPayerId - * - * @param string $payer_id - * @return $this - */ - public function setPayer_id($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * PayPal assigned Payer ID. - * @deprecated Instead use getPayerId - * - * @return string - */ - public function getPayer_id() - { - return $this->payer_id; - } - /** * Phone number representing the Payer. * @@ -337,31 +212,6 @@ class PayerInfo extends PPModel return $this->phone_type; } - /** - * Phone type - * - * @deprecated Instead use setPhoneType - * - * @param string $phone_type - * @return $this - */ - public function setPhone_type($phone_type) - { - $this->phone_type = $phone_type; - return $this; - } - - /** - * Phone type - * @deprecated Instead use getPhoneType - * - * @return string - */ - public function getPhone_type() - { - return $this->phone_type; - } - /** * Birth date of the Payer in ISO8601 format (YYYY-MM-DD). * @@ -385,31 +235,6 @@ class PayerInfo extends PPModel return $this->birth_date; } - /** - * Birth date of the Payer in ISO8601 format (YYYY-MM-DD). - * - * @deprecated Instead use setBirthDate - * - * @param string $birth_date - * @return $this - */ - public function setBirth_date($birth_date) - { - $this->birth_date = $birth_date; - return $this; - } - - /** - * Birth date of the Payer in ISO8601 format (YYYY-MM-DD). - * @deprecated Instead use getBirthDate - * - * @return string - */ - public function getBirth_date() - { - return $this->birth_date; - } - /** * Payer's tax ID. * @@ -433,31 +258,6 @@ class PayerInfo extends PPModel return $this->tax_id; } - /** - * Payer's tax ID. - * - * @deprecated Instead use setTaxId - * - * @param string $tax_id - * @return $this - */ - public function setTax_id($tax_id) - { - $this->tax_id = $tax_id; - return $this; - } - - /** - * Payer's tax ID. - * @deprecated Instead use getTaxId - * - * @return string - */ - public function getTax_id() - { - return $this->tax_id; - } - /** * Payer's tax ID type. * Valid Values: ["BR_CPF", "BR_CNPJ"] @@ -482,31 +282,6 @@ class PayerInfo extends PPModel return $this->tax_id_type; } - /** - * Payer's tax ID type. - * - * @deprecated Instead use setTaxIdType - * - * @param string $tax_id_type - * @return $this - */ - public function setTax_id_type($tax_id_type) - { - $this->tax_id_type = $tax_id_type; - return $this; - } - - /** - * Payer's tax ID type. - * @deprecated Instead use getTaxIdType - * - * @return string - */ - public function getTax_id_type() - { - return $this->tax_id_type; - } - /** * Billing address of the Payer. * @@ -530,31 +305,6 @@ class PayerInfo extends PPModel return $this->billing_address; } - /** - * Billing address of the Payer. - * - * @deprecated Instead use setBillingAddress - * - * @param \PayPal\Api\Address $billing_address - * @return $this - */ - public function setBilling_address($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing address of the Payer. - * @deprecated Instead use getBillingAddress - * - * @return \PayPal\Api\Address - */ - public function getBilling_address() - { - return $this->billing_address; - } - /** * Obsolete. Use shipping address present in purchase unit. * @@ -578,29 +328,4 @@ class PayerInfo extends PPModel return $this->shipping_address; } - /** - * Obsolete. Use shipping address present in purchase unit. - * - * @deprecated Instead use setShippingAddress - * - * @param \PayPal\Api\ShippingAddress $shipping_address - * @return $this - */ - public function setShipping_address($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * Obsolete. Use shipping address present in purchase unit. - * @deprecated Instead use getShippingAddress - * - * @return \PayPal\Api\ShippingAddress - */ - public function getShipping_address() - { - return $this->shipping_address; - } - } diff --git a/lib/PayPal/Api/Payment.php b/lib/PayPal/Api/Payment.php index 6b7f00c..26ef4f0 100644 --- a/lib/PayPal/Api/Payment.php +++ b/lib/PayPal/Api/Payment.php @@ -2,12 +2,13 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalModel; +use PayPal\Common\PayPalResourceModel; +use PayPal\Core\PayPalConstants; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\PaymentHistory; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; /** @@ -26,29 +27,10 @@ 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 ResourceModel +class Payment extends PayPalResourceModel { - /** - * OAuth Credentials to use for this call - * - * @var \PayPal\Auth\OAuthTokenCredential $credential - */ - protected static $credential; - - /** - * Sets Credential - * - * @deprecated Pass ApiContext to create/get methods instead - * @param \PayPal\Auth\OAuthTokenCredential $credential - */ - public static function setCredential($credential) - { - self::$credential = $credential; - } - /** * Identifier of the payment resource created. * @@ -97,31 +79,6 @@ class Payment extends ResourceModel return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated in UTC ISO8601 format. * @@ -146,31 +103,6 @@ class Payment extends ResourceModel return $this->update_time; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Intent of the payment - Sale or Authorization or Order. * Valid Values: ["sale", "authorize", "order"] @@ -315,55 +247,6 @@ class Payment extends ResourceModel return $this->redirect_urls; } - /** - * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. - * - * @deprecated Instead use setRedirectUrls - * - * @param \PayPal\Api\RedirectUrls $redirect_urls - * @return $this - */ - public function setRedirect_urls($redirect_urls) - { - $this->redirect_urls = $redirect_urls; - return $this; - } - - /** - * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. - * @deprecated Instead use getRedirectUrls - * - * @return \PayPal\Api\RedirectUrls - */ - public function getRedirect_urls() - { - 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,12 +271,22 @@ class Payment extends ResourceModel { return $this->experience_profile_id; } + + /** + * Get Approval Link + * + * @return null|string + */ + public function getApprovalLink() + { + return $this->getLink(PayPalConstants::APPROVAL_URL); + } /** * Creates (and processes) a new Payment Resource. * * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Payment */ public function create($apiContext = null, $restCall = null) @@ -417,7 +310,7 @@ class Payment extends ResourceModel * * @param string $paymentId * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Payment */ public static function get($paymentId, $apiContext = null, $restCall = null) @@ -443,7 +336,7 @@ class Payment extends ResourceModel * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return boolean */ public function update($patchRequest, $apiContext = null, $restCall = null) @@ -467,7 +360,7 @@ class Payment extends ResourceModel * * @param PaymentExecution $paymentExecution * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Payment */ public function execute($paymentExecution, $apiContext = null, $restCall = null) @@ -493,7 +386,7 @@ class Payment extends ResourceModel * * @param array $params * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return PaymentHistory */ public static function all($params, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/PaymentCard.php b/lib/PayPal/Api/PaymentCard.php index 9e844b8..3a3152d 100644 --- a/lib/PayPal/Api/PaymentCard.php +++ b/lib/PayPal/Api/PaymentCard.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PaymentCard @@ -27,7 +27,7 @@ use PayPal\Common\PPModel; * @property string valid_until * @property \PayPal\Api\Links[] links */ -class PaymentCard extends PPModel +class PaymentCard extends PayPalModel { /** * ID of the credit card being saved for later use. @@ -122,31 +122,6 @@ class PaymentCard extends PPModel return $this->expire_month; } - /** - * 2 digit card expiry month. - * - * @deprecated Instead use setExpireMonth - * - * @param int $expire_month - * @return $this - */ - public function setExpire_month($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * 2 digit card expiry month. - * @deprecated Instead use getExpireMonth - * - * @return int - */ - public function getExpire_month() - { - return $this->expire_month; - } - /** * 4 digit card expiry year. * @@ -170,31 +145,6 @@ class PaymentCard extends PPModel return $this->expire_year; } - /** - * 4 digit card expiry year. - * - * @deprecated Instead use setExpireYear - * - * @param int $expire_year - * @return $this - */ - public function setExpire_year($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * 4 digit card expiry year. - * @deprecated Instead use getExpireYear - * - * @return int - */ - public function getExpire_year() - { - return $this->expire_year; - } - /** * 2 digit card start month. * @@ -218,31 +168,6 @@ class PaymentCard extends PPModel return $this->start_month; } - /** - * 2 digit card start month. - * - * @deprecated Instead use setStartMonth - * - * @param int $start_month - * @return $this - */ - public function setStart_month($start_month) - { - $this->start_month = $start_month; - return $this; - } - - /** - * 2 digit card start month. - * @deprecated Instead use getStartMonth - * - * @return int - */ - public function getStart_month() - { - return $this->start_month; - } - /** * 4 digit card start year. * @@ -266,31 +191,6 @@ class PaymentCard extends PPModel return $this->start_year; } - /** - * 4 digit card start year. - * - * @deprecated Instead use setStartYear - * - * @param int $start_year - * @return $this - */ - public function setStart_year($start_year) - { - $this->start_year = $start_year; - return $this; - } - - /** - * 4 digit card start year. - * @deprecated Instead use getStartYear - * - * @return int - */ - public function getStart_year() - { - return $this->start_year; - } - /** * Card validation code. Only supported when making a Payment, but not when saving a payment card for future use. * @@ -337,31 +237,6 @@ class PaymentCard extends PPModel return $this->first_name; } - /** - * Card holder's first name. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * Card holder's first name. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Card holder's last name. * @@ -385,31 +260,6 @@ class PaymentCard extends PPModel return $this->last_name; } - /** - * Card holder's last name. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Card holder's last name. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Billing Address associated with this card. * @@ -433,31 +283,6 @@ class PaymentCard extends PPModel return $this->billing_address; } - /** - * Billing Address associated with this card. - * - * @deprecated Instead use setBillingAddress - * - * @param \PayPal\Api\Address $billing_address - * @return $this - */ - public function setBilling_address($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing Address associated with this card. - * @deprecated Instead use getBillingAddress - * - * @return \PayPal\Api\Address - */ - public function getBilling_address() - { - return $this->billing_address; - } - /** * A unique identifier of the customer to whom this card account belongs. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. * @@ -481,31 +306,6 @@ class PaymentCard extends PPModel return $this->external_customer_id; } - /** - * A unique identifier of the customer to whom this card account belongs. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * A unique identifier of the customer to whom this card account belongs. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } - /** * State of the funding instrument. * Valid Values: ["EXPIRED", "ACTIVE"] @@ -553,31 +353,6 @@ class PaymentCard extends PPModel return $this->valid_until; } - /** - * Date/Time until this resource can be used to fund a payment. - * - * @deprecated Instead use setValidUntil - * - * @param string $valid_until - * @return $this - */ - public function setValid_until($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Date/Time until this resource can be used to fund a payment. - * @deprecated Instead use getValidUntil - * - * @return string - */ - public function getValid_until() - { - return $this->valid_until; - } - /** * Sets Links * diff --git a/lib/PayPal/Api/PaymentCardToken.php b/lib/PayPal/Api/PaymentCardToken.php index aa52cea..d5fbe6c 100644 --- a/lib/PayPal/Api/PaymentCardToken.php +++ b/lib/PayPal/Api/PaymentCardToken.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PaymentCardToken @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property int expire_month * @property int expire_year */ -class PaymentCardToken extends PPModel +class PaymentCardToken extends PayPalModel { /** * ID of a previously saved Payment Card resource. @@ -43,31 +43,6 @@ class PaymentCardToken extends PPModel return $this->payment_card_id; } - /** - * ID of a previously saved Payment Card resource. - * - * @deprecated Instead use setPaymentCardId - * - * @param string $payment_card_id - * @return $this - */ - public function setPayment_card_id($payment_card_id) - { - $this->payment_card_id = $payment_card_id; - return $this; - } - - /** - * ID of a previously saved Payment Card resource. - * @deprecated Instead use getPaymentCardId - * - * @return string - */ - public function getPayment_card_id() - { - return $this->payment_card_id; - } - /** * The unique identifier of the payer used when saving this payment card. * @@ -91,31 +66,6 @@ class PaymentCardToken extends PPModel return $this->external_customer_id; } - /** - * The unique identifier of the payer used when saving this payment card. - * - * @deprecated Instead use setExternalCustomerId - * - * @param string $external_customer_id - * @return $this - */ - public function setExternal_customer_id($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this payment card. - * @deprecated Instead use getExternalCustomerId - * - * @return string - */ - public function getExternal_customer_id() - { - return $this->external_customer_id; - } - /** * Last 4 digits of the card number from the saved card. * @@ -186,31 +136,6 @@ class PaymentCardToken extends PPModel return $this->expire_month; } - /** - * Expiry month from the saved card with value 1 - 12. - * - * @deprecated Instead use setExpireMonth - * - * @param int $expire_month - * @return $this - */ - public function setExpire_month($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * Expiry month from the saved card with value 1 - 12. - * @deprecated Instead use getExpireMonth - * - * @return int - */ - public function getExpire_month() - { - return $this->expire_month; - } - /** * Four digit expiry year from the saved card, represented as YYYY format. * @@ -234,29 +159,4 @@ class PaymentCardToken extends PPModel return $this->expire_year; } - /** - * Four digit expiry year from the saved card, represented as YYYY format. - * - * @deprecated Instead use setExpireYear - * - * @param int $expire_year - * @return $this - */ - public function setExpire_year($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * Four digit expiry year from the saved card, represented as YYYY format. - * @deprecated Instead use getExpireYear - * - * @return int - */ - public function getExpire_year() - { - return $this->expire_year; - } - } diff --git a/lib/PayPal/Api/PaymentDefinition.php b/lib/PayPal/Api/PaymentDefinition.php index e78245e..36cb799 100644 --- a/lib/PayPal/Api/PaymentDefinition.php +++ b/lib/PayPal/Api/PaymentDefinition.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PaymentDefinition @@ -20,7 +20,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\Currency amount * @property \PayPal\Api\ChargeModel[] charge_models */ -class PaymentDefinition extends PPModel +class PaymentDefinition extends PayPalModel { /** * Identifier of the payment_definition. 128 characters max. @@ -114,31 +114,6 @@ class PaymentDefinition extends PPModel return $this->frequency_interval; } - /** - * How frequently the customer should be charged. - * - * @deprecated Instead use setFrequencyInterval - * - * @param string $frequency_interval - * @return $this - */ - public function setFrequency_interval($frequency_interval) - { - $this->frequency_interval = $frequency_interval; - return $this; - } - - /** - * How frequently the customer should be charged. - * @deprecated Instead use getFrequencyInterval - * - * @return string - */ - public function getFrequency_interval() - { - return $this->frequency_interval; - } - /** * Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`. * @@ -261,29 +236,4 @@ class PaymentDefinition extends PPModel ); } - /** - * Array of charge_models for this payment definition. - * - * @deprecated Instead use setChargeModels - * - * @param \PayPal\Api\ChargeModel $charge_models - * @return $this - */ - public function setCharge_models($charge_models) - { - $this->charge_models = $charge_models; - return $this; - } - - /** - * Array of charge_models for this payment definition. - * @deprecated Instead use getChargeModels - * - * @return \PayPal\Api\ChargeModel - */ - public function getCharge_models() - { - return $this->charge_models; - } - } diff --git a/lib/PayPal/Api/PaymentDetail.php b/lib/PayPal/Api/PaymentDetail.php index c5c12ad..6cd29ea 100644 --- a/lib/PayPal/Api/PaymentDetail.php +++ b/lib/PayPal/Api/PaymentDetail.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PaymentDetail @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property string method * @property string note */ -class PaymentDetail extends PPModel +class PaymentDetail extends PayPalModel { /** * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. @@ -67,31 +67,6 @@ class PaymentDetail extends PPModel return $this->transaction_id; } - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @deprecated Instead use setTransactionId - * - * @param string $transaction_id - * @return $this - */ - public function setTransaction_id($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * @deprecated Instead use getTransactionId - * - * @return string - */ - public function getTransaction_id() - { - return $this->transaction_id; - } - /** * Type of the transaction. * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"] @@ -116,31 +91,6 @@ class PaymentDetail extends PPModel return $this->transaction_type; } - /** - * Type of the transaction. - * - * @deprecated Instead use setTransactionType - * - * @param string $transaction_type - * @return $this - */ - public function setTransaction_type($transaction_type) - { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of the transaction. - * @deprecated Instead use getTransactionType - * - * @return string - */ - public function getTransaction_type() - { - return $this->transaction_type; - } - /** * Date when the invoice was paid. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * diff --git a/lib/PayPal/Api/PaymentExecution.php b/lib/PayPal/Api/PaymentExecution.php index 6eabdef..6a814db 100644 --- a/lib/PayPal/Api/PaymentExecution.php +++ b/lib/PayPal/Api/PaymentExecution.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -15,7 +15,7 @@ use PayPal\Rest\ApiContext; * @property string payer_id * @property \PayPal\Api\Transactions transactions */ -class PaymentExecution extends PPModel +class PaymentExecution extends PayPalModel { /** * PayPal assigned Payer ID returned in the approval return url. @@ -41,31 +41,6 @@ class PaymentExecution extends PPModel return $this->payer_id; } - /** - * PayPal assigned Payer ID returned in the approval return url. - * - * @deprecated Instead use setPayerId - * - * @param string $payer_id - * @return $this - */ - public function setPayer_id($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * PayPal assigned Payer ID returned in the approval return url. - * @deprecated Instead use getPayerId - * - * @return string - */ - public function getPayer_id() - { - return $this->payer_id; - } - /** * If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element. * diff --git a/lib/PayPal/Api/PaymentHistory.php b/lib/PayPal/Api/PaymentHistory.php index 48d9f66..95c71ae 100644 --- a/lib/PayPal/Api/PaymentHistory.php +++ b/lib/PayPal/Api/PaymentHistory.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -16,7 +16,7 @@ use PayPal\Rest\ApiContext; * @property int count * @property string next_id */ -class PaymentHistory extends PPModel +class PaymentHistory extends PayPalModel { /** * A list of Payment resources @@ -90,29 +90,4 @@ class PaymentHistory extends PPModel return $this->next_id; } - /** - * Identifier of the next element to get the next range of results. - * - * @deprecated Instead use setNextId - * - * @param string $next_id - * @return $this - */ - public function setNext_id($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * @deprecated Instead use getNextId - * - * @return string - */ - public function getNext_id() - { - return $this->next_id; - } - } diff --git a/lib/PayPal/Api/PaymentOptions.php b/lib/PayPal/Api/PaymentOptions.php index 79285b9..5f46b22 100644 --- a/lib/PayPal/Api/PaymentOptions.php +++ b/lib/PayPal/Api/PaymentOptions.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -14,7 +14,7 @@ use PayPal\Rest\ApiContext; * * @property string allowed_payment_method */ -class PaymentOptions extends PPModel +class PaymentOptions extends PayPalModel { /** * Payment method requested for this purchase unit @@ -40,29 +40,4 @@ class PaymentOptions extends PPModel return $this->allowed_payment_method; } - /** - * Payment method requested for this purchase unit - * - * @deprecated Instead use setAllowedPaymentMethod - * - * @param string $allowed_payment_method - * @return $this - */ - public function setAllowed_payment_method($allowed_payment_method) - { - $this->allowed_payment_method = $allowed_payment_method; - return $this; - } - - /** - * Payment method requested for this purchase unit - * @deprecated Instead use getAllowedPaymentMethod - * - * @return string - */ - public function getAllowed_payment_method() - { - return $this->allowed_payment_method; - } - } diff --git a/lib/PayPal/Api/PaymentTerm.php b/lib/PayPal/Api/PaymentTerm.php index c5c6ed5..0a0dbab 100644 --- a/lib/PayPal/Api/PaymentTerm.php +++ b/lib/PayPal/Api/PaymentTerm.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PaymentTerm @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property string term_type * @property string due_date */ -class PaymentTerm extends PPModel +class PaymentTerm extends PayPalModel { /** * Terms by which the invoice payment is due. @@ -40,31 +40,6 @@ class PaymentTerm extends PPModel return $this->term_type; } - /** - * Terms by which the invoice payment is due. - * - * @deprecated Instead use setTermType - * - * @param string $term_type - * @return $this - */ - public function setTerm_type($term_type) - { - $this->term_type = $term_type; - return $this; - } - - /** - * Terms by which the invoice payment is due. - * @deprecated Instead use getTermType - * - * @return string - */ - public function getTerm_type() - { - return $this->term_type; - } - /** * Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -88,29 +63,4 @@ class PaymentTerm extends PPModel return $this->due_date; } - /** - * Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setDueDate - * - * @param string $due_date - * @return $this - */ - public function setDue_date($due_date) - { - $this->due_date = $due_date; - return $this; - } - - /** - * Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getDueDate - * - * @return string - */ - public function getDue_date() - { - return $this->due_date; - } - } diff --git a/lib/PayPal/Api/Payout.php b/lib/PayPal/Api/Payout.php new file mode 100644 index 0000000..44715da --- /dev/null +++ b/lib/PayPal/Api/Payout.php @@ -0,0 +1,166 @@ +sender_batch_header = $sender_batch_header; + return $this; + } + + /** + * The original batch header as provided by the payment sender. + * + * @return \PayPal\Api\PayoutSenderBatchHeader + */ + public function getSenderBatchHeader() + { + return $this->sender_batch_header; + } + + /** + * An array of payout items (that is, a set of individual payouts). + * + * @param \PayPal\Api\PayoutItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->items = $items; + return $this; + } + + /** + * An array of payout items (that is, a set of individual payouts). + * + * @return \PayPal\Api\PayoutItem[] + */ + public function getItems() + { + return $this->items; + } + + /** + * Append Items to the list. + * + * @param \PayPal\Api\PayoutItem $payoutItem + * @return $this + */ + public function addItem($payoutItem) + { + if (!$this->getItems()) { + return $this->setItems(array($payoutItem)); + } else { + return $this->setItems( + array_merge($this->getItems(), array($payoutItem)) + ); + } + } + + /** + * Remove Items from the list. + * + * @param \PayPal\Api\PayoutItem $payoutItem + * @return $this + */ + public function removeItem($payoutItem) + { + return $this->setItems( + array_diff($this->getItems(), array($payoutItem)) + ); + } + + /** + * Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items. + * + * @param array $params + * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls + * @return PayoutBatch + */ + public function create($params = array(), $apiContext = null, $restCall = null) + { + $params = $params ? $params : array(); + ArgumentValidator::validate($params, 'params'); + $payLoad = $this->toJSON(); + $allowedParams = array( + 'sync_mode' => 1, + ); + $json = self::executeCall( + "/v1/payments/payouts" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), + "POST", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new PayoutBatch(); + $ret->fromJson($json); + return $ret; + } + + /** + * You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment. + * + * @param ApiContext $apiContext + * @param PayPalRestCall $restCall + * @return PayoutBatch + */ + public function createSynchronous($apiContext = null, $restCall = null) + { + $params = array('sync_mode' => 'true'); + return $this->create($params, $apiContext, $restCall); + } + + /** + * Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status. + * + * @param string $payoutBatchId + * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls + * @return PayoutBatch + */ + public static function get($payoutBatchId, $apiContext = null, $restCall = null) + { + ArgumentValidator::validate($payoutBatchId, 'payoutBatchId'); + $payLoad = ""; + $json = self::executeCall( + "/v1/payments/payouts/$payoutBatchId", + "GET", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new PayoutBatch(); + $ret->fromJson($json); + return $ret; + } + +} diff --git a/lib/PayPal/Api/PayoutBatch.php b/lib/PayPal/Api/PayoutBatch.php new file mode 100644 index 0000000..47c1c03 --- /dev/null +++ b/lib/PayPal/Api/PayoutBatch.php @@ -0,0 +1,120 @@ +batch_header = $batch_header; + return $this; + } + + /** + * A batch header that includes the generated batch status. + * + * @return \PayPal\Api\PayoutBatchHeader + */ + public function getBatchHeader() + { + return $this->batch_header; + } + + /** + * Array of the items in a batch payout. + * + * @param \PayPal\Api\PayoutItemDetails[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->items = $items; + return $this; + } + + /** + * Array of the items in a batch payout. + * + * @return \PayPal\Api\PayoutItemDetails[] + */ + public function getItems() + { + return $this->items; + } + + /** + * Append Items to the list. + * + * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails + * @return $this + */ + public function addItem($payoutItemDetails) + { + if (!$this->getItems()) { + return $this->setItems(array($payoutItemDetails)); + } else { + return $this->setItems( + array_merge($this->getItems(), array($payoutItemDetails)) + ); + } + } + + /** + * Remove Items from the list. + * + * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails + * @return $this + */ + public function removeItem($payoutItemDetails) + { + return $this->setItems( + array_diff($this->getItems(), array($payoutItemDetails)) + ); + } + + + /** + * 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; + } + +} diff --git a/lib/PayPal/Api/PayoutBatchHeader.php b/lib/PayPal/Api/PayoutBatchHeader.php new file mode 100644 index 0000000..c46125c --- /dev/null +++ b/lib/PayPal/Api/PayoutBatchHeader.php @@ -0,0 +1,263 @@ +payout_batch_id = $payout_batch_id; + return $this; + } + + /** + * An ID for the batch payout. Generated by PayPal. 30 characters max. + * + * @return string + */ + public function getPayoutBatchId() + { + return $this->payout_batch_id; + } + + /** + * Generated batch status. + * + * @param string $batch_status + * + * @return $this + */ + public function setBatchStatus($batch_status) + { + $this->batch_status = $batch_status; + return $this; + } + + /** + * Generated batch status. + * + * @return string + */ + public function getBatchStatus() + { + return $this->batch_status; + } + + /** + * The time the batch entered processing. + * + * @param string $time_created + * + * @return $this + */ + public function setTimeCreated($time_created) + { + $this->time_created = $time_created; + return $this; + } + + /** + * The time the batch entered processing. + * + * @return string + */ + public function getTimeCreated() + { + return $this->time_created; + } + + /** + * The time that processing for the batch was completed. + * + * @param string $time_completed + * + * @return $this + */ + public function setTimeCompleted($time_completed) + { + $this->time_completed = $time_completed; + return $this; + } + + /** + * The time that processing for the batch was completed. + * + * @return string + */ + public function getTimeCompleted() + { + return $this->time_completed; + } + + /** + * The original batch header as provided by the payment sender. + * + * @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header + * + * @return $this + */ + public function setSenderBatchHeader($sender_batch_header) + { + $this->sender_batch_header = $sender_batch_header; + return $this; + } + + /** + * The original batch header as provided by the payment sender. + * + * @return \PayPal\Api\PayoutSenderBatchHeader + */ + public function getSenderBatchHeader() + { + return $this->sender_batch_header; + } + + /** + * Total amount, in U.S. dollars, requested for the applicable payouts. + * + * @param \PayPal\Api\Currency $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * Total amount, in U.S. dollars, requested for the applicable payouts. + * + * @return \PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Total estimate in U.S. dollars for the applicable payouts fees. + * + * @param \PayPal\Api\Currency $fees + * + * @return $this + */ + public function setFees($fees) + { + $this->fees = $fees; + return $this; + } + + /** + * Total estimate in U.S. dollars for the applicable payouts fees. + * + * @return \PayPal\Api\Currency + */ + public function getFees() + { + return $this->fees; + } + + /** + * Sets Errors + * + * @param \PayPal\Api\Error $errors + * + * @return $this + */ + public function setErrors($errors) + { + $this->errors = $errors; + return $this; + } + + /** + * Gets Errors + * + * @return \PayPal\Api\Error + */ + public function getErrors() + { + return $this->errors; + } + + /** + * 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)) + ); + } + +} diff --git a/lib/PayPal/Api/PayoutItem.php b/lib/PayPal/Api/PayoutItem.php new file mode 100644 index 0000000..4a97dd5 --- /dev/null +++ b/lib/PayPal/Api/PayoutItem.php @@ -0,0 +1,165 @@ +recipient_type = $recipient_type; + return $this; + } + + /** + * The type of identification for the payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * + * @return string + */ + public function getRecipientType() + { + return $this->recipient_type; + } + + /** + * The amount of money to pay a receiver. + * + * @param \PayPal\Api\Currency $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * The amount of money to pay a receiver. + * + * @return \PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. + * + * @param string $note + * + * @return $this + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. + * + * @return string + */ + public function getNote() + { + return $this->note; + } + + /** + * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. + * + * @param string $receiver + * + * @return $this + */ + public function setReceiver($receiver) + { + $this->receiver = $receiver; + return $this; + } + + /** + * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. + * + * @return string + */ + public function getReceiver() + { + return $this->receiver; + } + + /** + * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. + * + * @param string $sender_item_id + * + * @return $this + */ + public function setSenderItemId($sender_item_id) + { + $this->sender_item_id = $sender_item_id; + return $this; + } + + /** + * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. + * + * @return string + */ + public function getSenderItemId() + { + return $this->sender_item_id; + } + + /** + * Obtain the status of a payout item by passing the item ID to the request URI. + * + * @param string $payoutItemId + * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls + * @return PayoutItemDetails + */ + public static function get($payoutItemId, $apiContext = null, $restCall = null) + { + ArgumentValidator::validate($payoutItemId, 'payoutItemId'); + $payLoad = ""; + $json = self::executeCall( + "/v1/payments/payouts-item/$payoutItemId", + "GET", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new PayoutItemDetails(); + $ret->fromJson($json); + return $ret; + } + +} diff --git a/lib/PayPal/Api/PayoutItemDetails.php b/lib/PayPal/Api/PayoutItemDetails.php new file mode 100644 index 0000000..c674247 --- /dev/null +++ b/lib/PayPal/Api/PayoutItemDetails.php @@ -0,0 +1,287 @@ +payout_item_id = $payout_item_id; + return $this; + } + + /** + * An ID for an individual payout. Provided by PayPal, such as in the case of getting the status of a batch request. 30 characters max. + * + * @return string + */ + public function getPayoutItemId() + { + return $this->payout_item_id; + } + + /** + * Generated ID for the transaction. 30 characters max. + * + * @param string $transaction_id + * + * @return $this + */ + public function setTransactionId($transaction_id) + { + $this->transaction_id = $transaction_id; + return $this; + } + + /** + * Generated ID for the transaction. 30 characters max. + * + * @return string + */ + public function getTransactionId() + { + return $this->transaction_id; + } + + /** + * Status of a transaction. + * + * @param string $transaction_status + * + * @return $this + */ + public function setTransactionStatus($transaction_status) + { + $this->transaction_status = $transaction_status; + return $this; + } + + /** + * Status of a transaction. + * + * @return string + */ + public function getTransactionStatus() + { + return $this->transaction_status; + } + + /** + * Amount of money in U.S. dollars for fees. + * + * @param \PayPal\Api\Currency $payout_item_fee + * + * @return $this + */ + public function setPayoutItemFee($payout_item_fee) + { + $this->payout_item_fee = $payout_item_fee; + return $this; + } + + /** + * Amount of money in U.S. dollars for fees. + * + * @return \PayPal\Api\Currency + */ + public function getPayoutItemFee() + { + return $this->payout_item_fee; + } + + /** + * An ID for the batch payout. Generated by PayPal. 30 characters max. + * + * @param string $payout_batch_id + * + * @return $this + */ + public function setPayoutBatchId($payout_batch_id) + { + $this->payout_batch_id = $payout_batch_id; + return $this; + } + + /** + * An ID for the batch payout. Generated by PayPal. 30 characters max. + * + * @return string + */ + public function getPayoutBatchId() + { + return $this->payout_batch_id; + } + + /** + * Sender-created ID for tracking the batch in an accounting system. 30 characters max. + * + * @param string $sender_batch_id + * + * @return $this + */ + public function setSenderBatchId($sender_batch_id) + { + $this->sender_batch_id = $sender_batch_id; + return $this; + } + + /** + * Sender-created ID for tracking the batch in an accounting system. 30 characters max. + * + * @return string + */ + public function getSenderBatchId() + { + return $this->sender_batch_id; + } + + /** + * The data for a payout item that the sender initially provided. + * + * @param \PayPal\Api\PayoutItem $payout_item + * + * @return $this + */ + public function setPayoutItem($payout_item) + { + $this->payout_item = $payout_item; + return $this; + } + + /** + * The data for a payout item that the sender initially provided. + * + * @return \PayPal\Api\PayoutItem + */ + public function getPayoutItem() + { + return $this->payout_item; + } + + /** + * Time of the last processing for this item. + * + * @param string $time_processed + * + * @return $this + */ + public function setTimeProcessed($time_processed) + { + $this->time_processed = $time_processed; + return $this; + } + + /** + * Time of the last processing for this item. + * + * @return string + */ + public function getTimeProcessed() + { + return $this->time_processed; + } + + /** + * Sets Error + * + * @param \PayPal\Api\Error $error + * + * @return $this + */ + public function setErrors($error) + { + $this->errors = $error; + return $this; + } + + /** + * Gets Error + * + * @return \PayPal\Api\Error + */ + public function getErrors() + { + return $this->errors; + } + + /** + * 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)) + ); + } + +} diff --git a/lib/PayPal/Api/PayoutSenderBatchHeader.php b/lib/PayPal/Api/PayoutSenderBatchHeader.php new file mode 100644 index 0000000..2cd0f64 --- /dev/null +++ b/lib/PayPal/Api/PayoutSenderBatchHeader.php @@ -0,0 +1,89 @@ +sender_batch_id = $sender_batch_id; + return $this; + } + + /** + * Sender-created ID for tracking the batch payout in an accounting system. 30 characters max. + * + * @return string + */ + public function getSenderBatchId() + { + return $this->sender_batch_id; + } + + /** + * The subject line text for the email that PayPal sends when a payout item is completed. (The subject line is the same for all recipients.) Maximum of 255 single-byte alphanumeric characters. + * + * @param string $email_subject + * + * @return $this + */ + public function setEmailSubject($email_subject) + { + $this->email_subject = $email_subject; + return $this; + } + + /** + * The subject line text for the email that PayPal sends when a payout item is completed. (The subject line is the same for all recipients.) Maximum of 255 single-byte alphanumeric characters. + * + * @return string + */ + public function getEmailSubject() + { + return $this->email_subject; + } + + /** + * The type of ID for a payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * + * @param string $recipient_type + * + * @return $this + */ + public function setRecipientType($recipient_type) + { + $this->recipient_type = $recipient_type; + return $this; + } + + /** + * The type of ID for a payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * + * @return string + */ + public function getRecipientType() + { + return $this->recipient_type; + } + +} diff --git a/lib/PayPal/Api/Phone.php b/lib/PayPal/Api/Phone.php index 1c55e98..dab3701 100644 --- a/lib/PayPal/Api/Phone.php +++ b/lib/PayPal/Api/Phone.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Phone @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string national_number * @property string extension */ -class Phone extends PPModel +class Phone extends PayPalModel { /** * Country code (in E.164 format). Assume length is n. @@ -40,31 +40,6 @@ class Phone extends PPModel return $this->country_code; } - /** - * Country code (in E.164 format). Assume length is n. - * - * @deprecated Instead use setCountryCode - * - * @param string $country_code - * @return $this - */ - public function setCountry_code($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * Country code (in E.164 format). Assume length is n. - * @deprecated Instead use getCountryCode - * - * @return string - */ - public function getCountry_code() - { - return $this->country_code; - } - /** * In-country phone number (in E.164 format). Maximum (15 - n) digits. * @@ -88,31 +63,6 @@ class Phone extends PPModel return $this->national_number; } - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * - * @deprecated Instead use setNationalNumber - * - * @param string $national_number - * @return $this - */ - public function setNational_number($national_number) - { - $this->national_number = $national_number; - return $this; - } - - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * @deprecated Instead use getNationalNumber - * - * @return string - */ - public function getNational_number() - { - return $this->national_number; - } - /** * Phone extension * diff --git a/lib/PayPal/Api/Plan.php b/lib/PayPal/Api/Plan.php index 9e85ef2..4201903 100644 --- a/lib/PayPal/Api/Plan.php +++ b/lib/PayPal/Api/Plan.php @@ -2,12 +2,12 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\PlanList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class Plan @@ -26,9 +26,8 @@ use PayPal\Transport\PPRestCall; * @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 ResourceModel +class Plan extends PayPalResourceModel { /** * Identifier of the billing plan. 128 characters max. @@ -168,31 +167,6 @@ class Plan extends ResourceModel return $this->create_time; } - /** - * Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -216,31 +190,6 @@ class Plan extends ResourceModel return $this->update_time; } - /** - * Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Array of payment definitions for this billing plan. * @@ -294,31 +243,6 @@ class Plan extends ResourceModel ); } - /** - * Array of payment definitions for this billing plan. - * - * @deprecated Instead use setPaymentDefinitions - * - * @param \PayPal\Api\PaymentDefinition $payment_definitions - * @return $this - */ - public function setPayment_definitions($payment_definitions) - { - $this->payment_definitions = $payment_definitions; - return $this; - } - - /** - * Array of payment definitions for this billing plan. - * @deprecated Instead use getPaymentDefinitions - * - * @return \PayPal\Api\PaymentDefinition - */ - public function getPayment_definitions() - { - return $this->payment_definitions; - } - /** * Array of terms for this billing plan. * @@ -395,90 +319,12 @@ class Plan extends ResourceModel return $this->merchant_preferences; } - /** - * Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan. - * - * @deprecated Instead use setMerchantPreferences - * - * @param \PayPal\Api\MerchantPreferences $merchant_preferences - * @return $this - */ - public function setMerchant_preferences($merchant_preferences) - { - $this->merchant_preferences = $merchant_preferences; - return $this; - } - - /** - * Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan. - * @deprecated Instead use getMerchantPreferences - * - * @return \PayPal\Api\MerchantPreferences - */ - public function getMerchant_preferences() - { - 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. * * @param string $planId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Plan */ public static function get($planId, $apiContext = null, $restCall = null) @@ -502,7 +348,7 @@ class Plan extends ResourceModel * Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Plan */ public function create($apiContext = null, $restCall = null) @@ -525,7 +371,7 @@ class Plan extends ResourceModel * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function update($patchRequest, $apiContext = null, $restCall = null) @@ -548,7 +394,7 @@ class Plan extends ResourceModel * Delete a billing plan by passing the ID of the billing plan to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) @@ -556,7 +402,7 @@ class Plan extends ResourceModel ArgumentValidator::validate($this->getId(), "Id"); $patchRequest = new PatchRequest(); $patch = new Patch(); - $value = new PPModel('{ + $value = new PayPalModel('{ "state":"DELETED" }'); $patch->setOp('replace') @@ -571,7 +417,7 @@ class Plan extends ResourceModel * * @param array $params * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return PlanList */ public static function all($params, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/PlanList.php b/lib/PayPal/Api/PlanList.php index 9f4b3cd..495599b 100644 --- a/lib/PayPal/Api/PlanList.php +++ b/lib/PayPal/Api/PlanList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class PlanList @@ -16,7 +16,7 @@ use PayPal\Common\PPModel; * @property string total_pages * @property \PayPal\Api\Links[] links */ -class PlanList extends PPModel +class PlanList extends PayPalModel { /** * Array of billing plans. @@ -94,31 +94,6 @@ class PlanList extends PPModel return $this->total_items; } - /** - * Total number of items. - * - * @deprecated Instead use setTotalItems - * - * @param string $total_items - * @return $this - */ - public function setTotal_items($total_items) - { - $this->total_items = $total_items; - return $this; - } - - /** - * Total number of items. - * @deprecated Instead use getTotalItems - * - * @return string - */ - public function getTotal_items() - { - return $this->total_items; - } - /** * Total number of pages. * @@ -142,31 +117,6 @@ class PlanList extends PPModel return $this->total_pages; } - /** - * Total number of pages. - * - * @deprecated Instead use setTotalPages - * - * @param string $total_pages - * @return $this - */ - public function setTotal_pages($total_pages) - { - $this->total_pages = $total_pages; - return $this; - } - - /** - * Total number of pages. - * @deprecated Instead use getTotalPages - * - * @return string - */ - public function getTotal_pages() - { - return $this->total_pages; - } - /** * Sets Links * diff --git a/lib/PayPal/Api/Presentation.php b/lib/PayPal/Api/Presentation.php index a98ed70..e75aa80 100644 --- a/lib/PayPal/Api/Presentation.php +++ b/lib/PayPal/Api/Presentation.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Presentation @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string logo_image * @property string locale_code */ -class Presentation extends PPModel +class Presentation extends PayPalModel { /** * A label that overrides the business name in the PayPal account on the PayPal pages. @@ -41,31 +41,6 @@ class Presentation extends PPModel return $this->brand_name; } - /** - * A label that overrides the business name in the PayPal account on the PayPal pages. - * - * @deprecated Instead use setBrandName - * - * @param string $brand_name - * @return $this - */ - public function setBrand_name($brand_name) - { - $this->brand_name = $brand_name; - return $this; - } - - /** - * A label that overrides the business name in the PayPal account on the PayPal pages. - * @deprecated Instead use getBrandName - * - * @return string - */ - public function getBrand_name() - { - return $this->brand_name; - } - /** * A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`. * @@ -90,31 +65,6 @@ class Presentation extends PPModel return $this->logo_image; } - /** - * A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`. - * - * @deprecated Instead use setLogoImage - * - * @param string $logo_image - * @return $this - */ - public function setLogo_image($logo_image) - { - $this->logo_image = $logo_image; - return $this; - } - - /** - * A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`. - * @deprecated Instead use getLogoImage - * - * @return string - */ - public function getLogo_image() - { - return $this->logo_image; - } - /** * Locale of pages displayed by PayPal payment experience. * @@ -139,29 +89,4 @@ class Presentation extends PPModel return $this->locale_code; } - /** - * Locale of pages displayed by PayPal payment experience. - * - * @deprecated Instead use setLocaleCode - * - * @param string $locale_code - * @return $this - */ - public function setLocale_code($locale_code) - { - $this->locale_code = $locale_code; - return $this; - } - - /** - * Locale of pages displayed by PayPal payment experience. - * @deprecated Instead use getLocaleCode - * - * @return string - */ - public function getLocale_code() - { - return $this->locale_code; - } - } diff --git a/lib/PayPal/Api/RedirectUrls.php b/lib/PayPal/Api/RedirectUrls.php index b40921b..a07de52 100644 --- a/lib/PayPal/Api/RedirectUrls.php +++ b/lib/PayPal/Api/RedirectUrls.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Validation\UrlValidator; @@ -16,7 +16,7 @@ use PayPal\Validation\UrlValidator; * @property string return_url * @property string cancel_url */ -class RedirectUrls extends PPModel +class RedirectUrls extends PayPalModel { /** * Url where the payer would be redirected to after approving the payment. @@ -43,37 +43,12 @@ class RedirectUrls extends PPModel return $this->return_url; } - /** - * Url where the payer would be redirected to after approving the payment. - * - * @deprecated Instead use setReturnUrl - * - * @param string $return_url - * @return $this - */ - public function setReturn_url($return_url) - { - $this->return_url = $return_url; - return $this; - } - - /** - * Url where the payer would be redirected to after approving the payment. - * @deprecated Instead use getReturnUrl - * - * @return string - */ - public function getReturn_url() - { - return $this->return_url; - } - /** * Url where the payer would be redirected to after canceling the payment. * * * @param string $cancel_url - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * @return $this */ public function setCancelUrl($cancel_url) @@ -93,29 +68,4 @@ class RedirectUrls extends PPModel return $this->cancel_url; } - /** - * Url where the payer would be redirected to after canceling the payment. - * - * @deprecated Instead use setCancelUrl - * - * @param string $cancel_url - * @return $this - */ - public function setCancel_url($cancel_url) - { - $this->cancel_url = $cancel_url; - return $this; - } - - /** - * Url where the payer would be redirected to after canceling the payment. - * @deprecated Instead use getCancelUrl - * - * @return string - */ - public function getCancel_url() - { - return $this->cancel_url; - } - } diff --git a/lib/PayPal/Api/Refund.php b/lib/PayPal/Api/Refund.php index 92ad3c7..d2596ef 100644 --- a/lib/PayPal/Api/Refund.php +++ b/lib/PayPal/Api/Refund.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; /** @@ -26,25 +26,8 @@ use PayPal\Validation\ArgumentValidator; * @property string description * @property \PayPal\Api\Links links */ -class Refund extends PPModel implements IResource +class Refund extends PayPalModel implements IResource { - /** - * OAuth Credentials to use for this call - * - * @var \PayPal\Auth\OAuthTokenCredential $credential - */ - protected static $credential; - - /** - * Sets Credential - * - * @deprecated Pass ApiContext to create/get methods instead - * @param \PayPal\Auth\OAuthTokenCredential $credential - */ - public static function setCredential($credential) - { - self::$credential = $credential; - } /** * Identifier of the refund transaction in UTC ISO8601 format. @@ -94,31 +77,6 @@ class Refund extends PPModel implements IResource return $this->create_time; } - /** - * Time the resource was created in UTC ISO8601 format. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated in UTC ISO8601 format. * @@ -143,31 +101,6 @@ class Refund extends PPModel implements IResource return $this->update_time; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund. * @@ -240,31 +173,6 @@ class Refund extends PPModel implements IResource return $this->sale_id; } - /** - * ID of the Sale transaction being refunded. - * - * @deprecated Instead use setSaleId - * - * @param string $sale_id - * @return $this - */ - public function setSale_id($sale_id) - { - $this->sale_id = $sale_id; - return $this; - } - - /** - * ID of the Sale transaction being refunded. - * @deprecated Instead use getSaleId - * - * @return string - */ - public function getSale_id() - { - return $this->sale_id; - } - /** * ID of the Capture transaction being refunded. * @@ -289,31 +197,6 @@ class Refund extends PPModel implements IResource return $this->capture_id; } - /** - * ID of the Capture transaction being refunded. - * - * @deprecated Instead use setCaptureId - * - * @param string $capture_id - * @return $this - */ - public function setCapture_id($capture_id) - { - $this->capture_id = $capture_id; - return $this; - } - - /** - * ID of the Capture transaction being refunded. - * @deprecated Instead use getCaptureId - * - * @return string - */ - public function getCapture_id() - { - return $this->capture_id; - } - /** * ID of the Payment resource that this transaction is based on. * @@ -338,31 +221,6 @@ class Refund extends PPModel implements IResource return $this->parent_payment; } - /** - * ID of the Payment resource that this transaction is based on. - * - * @deprecated Instead use setParentPayment - * - * @param string $parent_payment - * @return $this - */ - public function setParent_payment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * @deprecated Instead use getParentPayment - * - * @return string - */ - public function getParent_payment() - { - return $this->parent_payment; - } - /** * Description of what is being refunded for. * @@ -426,8 +284,8 @@ class Refund extends PPModel implements IResource if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad); + $call = new PayPalRestCall($apiContext); + $json = $call->execute(array('PayPal\Handler\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad); $ret = new Refund(); $ret->fromJson($json); return $ret; diff --git a/lib/PayPal/Api/RefundDetail.php b/lib/PayPal/Api/RefundDetail.php index f95f8d7..26023b0 100644 --- a/lib/PayPal/Api/RefundDetail.php +++ b/lib/PayPal/Api/RefundDetail.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class RefundDetail @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property string date * @property string note */ -class RefundDetail extends PPModel +class RefundDetail extends PayPalModel { /** * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. diff --git a/lib/PayPal/Api/RelatedResources.php b/lib/PayPal/Api/RelatedResources.php index 761c03e..191a05c 100644 --- a/lib/PayPal/Api/RelatedResources.php +++ b/lib/PayPal/Api/RelatedResources.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -18,7 +18,7 @@ use PayPal\Rest\ApiContext; * @property \PayPal\Api\Capture capture * @property \PayPal\Api\Refund refund */ -class RelatedResources extends PPModel +class RelatedResources extends PayPalModel { /** * A sale transaction diff --git a/lib/PayPal/Api/Sale.php b/lib/PayPal/Api/Sale.php index 1ba5c00..fefeee6 100644 --- a/lib/PayPal/Api/Sale.php +++ b/lib/PayPal/Api/Sale.php @@ -2,10 +2,10 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Rest\ApiContext; use PayPal\Api\Refund; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; /** @@ -27,28 +27,9 @@ use PayPal\Validation\ArgumentValidator; * @property string protection_eligibility_type * @property string clearing_time * @property string parent_payment - * @property \PayPal\Api\Links links */ -class Sale extends ResourceModel +class Sale extends PayPalResourceModel { - /** - * OAuth Credentials to use for this call - * - * @var \PayPal\Auth\OAuthTokenCredential $credential - */ - protected static $credential; - - /** - * Sets Credential - * - * @deprecated Pass ApiContext to create/get methods instead - * @param \PayPal\Auth\OAuthTokenCredential $credential - */ - public static function setCredential($credential) - { - self::$credential = $credential; - } - /** * Identifier of the authorization transaction. * @@ -97,31 +78,6 @@ class Sale extends ResourceModel return $this->create_time; } - /** - * Time the resource was created. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Time the resource was last updated. * @@ -146,31 +102,6 @@ class Sale extends ResourceModel return $this->update_time; } - /** - * Time the resource was last updated. - * - * @deprecated Instead use setUpdateTime - * - * @param string $update_time - * @return $this - */ - public function setUpdate_time($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated. - * @deprecated Instead use getUpdateTime - * - * @return string - */ - public function getUpdate_time() - { - return $this->update_time; - } - /** * Amount being collected. * @@ -219,31 +150,6 @@ class Sale extends ResourceModel return $this->payment_mode; } - /** - * specifies payment mode of the transaction - * - * @deprecated Instead use setPaymentMode - * - * @param string $payment_mode - * @return $this - */ - public function setPayment_mode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * specifies payment mode of the transaction - * @deprecated Instead use getPaymentMode - * - * @return string - */ - public function getPayment_mode() - { - return $this->payment_mode; - } - /** * Reason of Pending transaction. * @@ -268,31 +174,6 @@ class Sale extends ResourceModel return $this->pending_reason; } - /** - * Reason of Pending transaction. - * - * @deprecated Instead use setPendingReason - * - * @param string $pending_reason - * @return $this - */ - public function setPending_reason($pending_reason) - { - $this->pending_reason = $pending_reason; - return $this; - } - - /** - * Reason of Pending transaction. - * @deprecated Instead use getPendingReason - * - * @return string - */ - public function getPending_reason() - { - return $this->pending_reason; - } - /** * State of the sale transaction. * Valid Values: ["pending", "completed", "refunded", "partially_refunded"] @@ -341,31 +222,6 @@ class Sale extends ResourceModel return $this->reason_code; } - /** - * Reason code for the transaction state being Pending or Reversed. - * - * @deprecated Instead use setReasonCode - * - * @param string $reason_code - * @return $this - */ - public function setReason_code($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * Reason code for the transaction state being Pending or Reversed. - * @deprecated Instead use getReasonCode - * - * @return string - */ - public function getReason_code() - { - return $this->reason_code; - } - /** * Protection Eligibility of the Payer * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] @@ -390,31 +246,6 @@ class Sale extends ResourceModel return $this->protection_eligibility; } - /** - * Protection Eligibility of the Payer - * - * @deprecated Instead use setProtectionEligibility - * - * @param string $protection_eligibility - * @return $this - */ - public function setProtection_eligibility($protection_eligibility) - { - $this->protection_eligibility = $protection_eligibility; - return $this; - } - - /** - * Protection Eligibility of the Payer - * @deprecated Instead use getProtectionEligibility - * - * @return string - */ - public function getProtection_eligibility() - { - return $this->protection_eligibility; - } - /** * Protection Eligibility Type of the Payer * Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] @@ -439,31 +270,6 @@ class Sale extends ResourceModel return $this->protection_eligibility_type; } - /** - * Protection Eligibility Type of the Payer - * - * @deprecated Instead use setProtectionEligibilityType - * - * @param string $protection_eligibility_type - * @return $this - */ - public function setProtection_eligibility_type($protection_eligibility_type) - { - $this->protection_eligibility_type = $protection_eligibility_type; - return $this; - } - - /** - * Protection Eligibility Type of the Payer - * @deprecated Instead use getProtectionEligibilityType - * - * @return string - */ - public function getProtection_eligibility_type() - { - return $this->protection_eligibility_type; - } - /** * Expected clearing time for eCheck Transactions * @@ -488,31 +294,6 @@ class Sale extends ResourceModel return $this->clearing_time; } - /** - * Expected clearing time for eCheck Transactions - * - * @deprecated Instead use setClearingTime - * - * @param string $clearing_time - * @return $this - */ - public function setClearing_time($clearing_time) - { - $this->clearing_time = $clearing_time; - return $this; - } - - /** - * Expected clearing time for eCheck Transactions - * @deprecated Instead use getClearingTime - * - * @return string - */ - public function getClearing_time() - { - return $this->clearing_time; - } - /** * ID of the Payment resource that this transaction is based on. * @@ -537,61 +318,12 @@ class Sale extends ResourceModel return $this->parent_payment; } - /** - * ID of the Payment resource that this transaction is based on. - * - * @deprecated Instead use setParentPayment - * - * @param string $parent_payment - * @return $this - */ - public function setParent_payment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * @deprecated Instead use getParentPayment - * - * @return string - */ - public function getParent_payment() - { - return $this->parent_payment; - } - - /** - * 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; - } - /** * Obtain the Sale transaction resource for the given identifier. * * @param string $saleId * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Sale */ public static function get($saleId, $apiContext = null, $restCall = null) @@ -617,7 +349,7 @@ class Sale extends ResourceModel * * @param Refund $refund * @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Refund */ public function refund($refund, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/Search.php b/lib/PayPal/Api/Search.php index 5b3d846..0594f9a 100644 --- a/lib/PayPal/Api/Search.php +++ b/lib/PayPal/Api/Search.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Search @@ -31,7 +31,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\number page_size * @property bool total_count_required */ -class Search extends PPModel +class Search extends PayPalModel { /** * Initial letters of the email address. @@ -79,31 +79,6 @@ class Search extends PPModel return $this->recipient_first_name; } - /** - * Initial letters of the recipient's first name. - * - * @deprecated Instead use setRecipientFirstName - * - * @param string $recipient_first_name - * @return $this - */ - public function setRecipient_first_name($recipient_first_name) - { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - - /** - * Initial letters of the recipient's first name. - * @deprecated Instead use getRecipientFirstName - * - * @return string - */ - public function getRecipient_first_name() - { - return $this->recipient_first_name; - } - /** * Initial letters of the recipient's last name. * @@ -127,31 +102,6 @@ class Search extends PPModel return $this->recipient_last_name; } - /** - * Initial letters of the recipient's last name. - * - * @deprecated Instead use setRecipientLastName - * - * @param string $recipient_last_name - * @return $this - */ - public function setRecipient_last_name($recipient_last_name) - { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - - /** - * Initial letters of the recipient's last name. - * @deprecated Instead use getRecipientLastName - * - * @return string - */ - public function getRecipient_last_name() - { - return $this->recipient_last_name; - } - /** * Initial letters of the recipient's business name. * @@ -175,31 +125,6 @@ class Search extends PPModel return $this->recipient_business_name; } - /** - * Initial letters of the recipient's business name. - * - * @deprecated Instead use setRecipientBusinessName - * - * @param string $recipient_business_name - * @return $this - */ - public function setRecipient_business_name($recipient_business_name) - { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - - /** - * Initial letters of the recipient's business name. - * @deprecated Instead use getRecipientBusinessName - * - * @return string - */ - public function getRecipient_business_name() - { - return $this->recipient_business_name; - } - /** * The invoice number that appears on the invoice. * @@ -270,31 +195,6 @@ class Search extends PPModel return $this->lower_total_amount; } - /** - * Lower limit of total amount. - * - * @deprecated Instead use setLowerTotalAmount - * - * @param \PayPal\Api\Currency $lower_total_amount - * @return $this - */ - public function setLower_total_amount($lower_total_amount) - { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - - /** - * Lower limit of total amount. - * @deprecated Instead use getLowerTotalAmount - * - * @return \PayPal\Api\Currency - */ - public function getLower_total_amount() - { - return $this->lower_total_amount; - } - /** * Upper limit of total amount. * @@ -318,31 +218,6 @@ class Search extends PPModel return $this->upper_total_amount; } - /** - * Upper limit of total amount. - * - * @deprecated Instead use setUpperTotalAmount - * - * @param \PayPal\Api\Currency $upper_total_amount - * @return $this - */ - public function setUpper_total_amount($upper_total_amount) - { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - - /** - * Upper limit of total amount. - * @deprecated Instead use getUpperTotalAmount - * - * @return \PayPal\Api\Currency - */ - public function getUpper_total_amount() - { - return $this->upper_total_amount; - } - /** * Start invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -366,31 +241,6 @@ class Search extends PPModel return $this->start_invoice_date; } - /** - * Start invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setStartInvoiceDate - * - * @param string $start_invoice_date - * @return $this - */ - public function setStart_invoice_date($start_invoice_date) - { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - - /** - * Start invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getStartInvoiceDate - * - * @return string - */ - public function getStart_invoice_date() - { - return $this->start_invoice_date; - } - /** * End invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -414,31 +264,6 @@ class Search extends PPModel return $this->end_invoice_date; } - /** - * End invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setEndInvoiceDate - * - * @param string $end_invoice_date - * @return $this - */ - public function setEnd_invoice_date($end_invoice_date) - { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - - /** - * End invoice date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getEndInvoiceDate - * - * @return string - */ - public function getEnd_invoice_date() - { - return $this->end_invoice_date; - } - /** * Start invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -462,31 +287,6 @@ class Search extends PPModel return $this->start_due_date; } - /** - * Start invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setStartDueDate - * - * @param string $start_due_date - * @return $this - */ - public function setStart_due_date($start_due_date) - { - $this->start_due_date = $start_due_date; - return $this; - } - - /** - * Start invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getStartDueDate - * - * @return string - */ - public function getStart_due_date() - { - return $this->start_due_date; - } - /** * End invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -510,31 +310,6 @@ class Search extends PPModel return $this->end_due_date; } - /** - * End invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setEndDueDate - * - * @param string $end_due_date - * @return $this - */ - public function setEnd_due_date($end_due_date) - { - $this->end_due_date = $end_due_date; - return $this; - } - - /** - * End invoice due date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getEndDueDate - * - * @return string - */ - public function getEnd_due_date() - { - return $this->end_due_date; - } - /** * Start invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -558,31 +333,6 @@ class Search extends PPModel return $this->start_payment_date; } - /** - * Start invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setStartPaymentDate - * - * @param string $start_payment_date - * @return $this - */ - public function setStart_payment_date($start_payment_date) - { - $this->start_payment_date = $start_payment_date; - return $this; - } - - /** - * Start invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getStartPaymentDate - * - * @return string - */ - public function getStart_payment_date() - { - return $this->start_payment_date; - } - /** * End invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -606,31 +356,6 @@ class Search extends PPModel return $this->end_payment_date; } - /** - * End invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setEndPaymentDate - * - * @param string $end_payment_date - * @return $this - */ - public function setEnd_payment_date($end_payment_date) - { - $this->end_payment_date = $end_payment_date; - return $this; - } - - /** - * End invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getEndPaymentDate - * - * @return string - */ - public function getEnd_payment_date() - { - return $this->end_payment_date; - } - /** * Start invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -654,31 +379,6 @@ class Search extends PPModel return $this->start_creation_date; } - /** - * Start invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setStartCreationDate - * - * @param string $start_creation_date - * @return $this - */ - public function setStart_creation_date($start_creation_date) - { - $this->start_creation_date = $start_creation_date; - return $this; - } - - /** - * Start invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getStartCreationDate - * - * @return string - */ - public function getStart_creation_date() - { - return $this->start_creation_date; - } - /** * End invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * @@ -702,31 +402,6 @@ class Search extends PPModel return $this->end_creation_date; } - /** - * End invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @deprecated Instead use setEndCreationDate - * - * @param string $end_creation_date - * @return $this - */ - public function setEnd_creation_date($end_creation_date) - { - $this->end_creation_date = $end_creation_date; - return $this; - } - - /** - * End invoice creation date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * @deprecated Instead use getEndCreationDate - * - * @return string - */ - public function getEnd_creation_date() - { - return $this->end_creation_date; - } - /** * Offset of the search results. * @@ -773,31 +448,6 @@ class Search extends PPModel return $this->page_size; } - /** - * Page size of the search results. - * - * @deprecated Instead use setPageSize - * - * @param \PayPal\Api\number $page_size - * @return $this - */ - public function setPage_size($page_size) - { - $this->page_size = $page_size; - return $this; - } - - /** - * Page size of the search results. - * @deprecated Instead use getPageSize - * - * @return \PayPal\Api\number - */ - public function getPage_size() - { - return $this->page_size; - } - /** * A flag indicating whether total count is required in the response. * @@ -821,29 +471,4 @@ class Search extends PPModel return $this->total_count_required; } - /** - * A flag indicating whether total count is required in the response. - * - * @deprecated Instead use setTotalCountRequired - * - * @param bool $total_count_required - * @return $this - */ - public function setTotal_count_required($total_count_required) - { - $this->total_count_required = $total_count_required; - return $this; - } - - /** - * A flag indicating whether total count is required in the response. - * @deprecated Instead use getTotalCountRequired - * - * @return bool - */ - public function getTotal_count_required() - { - return $this->total_count_required; - } - } diff --git a/lib/PayPal/Api/ShippingAddress.php b/lib/PayPal/Api/ShippingAddress.php index c04e5f1..ad89c9f 100644 --- a/lib/PayPal/Api/ShippingAddress.php +++ b/lib/PayPal/Api/ShippingAddress.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ShippingAddress @@ -63,31 +63,6 @@ class ShippingAddress extends Address return $this->recipient_name; } - /** - * Name of the recipient at this address. - * - * @deprecated Instead use setRecipientName - * - * @param string $recipient_name - * @return $this - */ - public function setRecipient_name($recipient_name) - { - $this->recipient_name = $recipient_name; - return $this; - } - - /** - * Name of the recipient at this address. - * @deprecated Instead use getRecipientName - * - * @return string - */ - public function getRecipient_name() - { - return $this->recipient_name; - } - /** * Default shipping address of the Payer. * @@ -111,29 +86,4 @@ class ShippingAddress extends Address return $this->default_address; } - /** - * Default shipping address of the Payer. - * - * @deprecated Instead use setDefaultAddress - * - * @param bool $default_address - * @return $this - */ - public function setDefault_address($default_address) - { - $this->default_address = $default_address; - return $this; - } - - /** - * Default shipping address of the Payer. - * @deprecated Instead use getDefaultAddress - * - * @return bool - */ - public function getDefault_address() - { - return $this->default_address; - } - } diff --git a/lib/PayPal/Api/ShippingCost.php b/lib/PayPal/Api/ShippingCost.php index e3a1651..b4beeb8 100644 --- a/lib/PayPal/Api/ShippingCost.php +++ b/lib/PayPal/Api/ShippingCost.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ShippingCost @@ -14,7 +14,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\Currency amount * @property \PayPal\Api\Tax tax */ -class ShippingCost extends PPModel +class ShippingCost extends PayPalModel { /** * Shipping cost in amount. Range of 0 to 999999.99. diff --git a/lib/PayPal/Api/ShippingInfo.php b/lib/PayPal/Api/ShippingInfo.php index 423f8ff..ed4b2a7 100644 --- a/lib/PayPal/Api/ShippingInfo.php +++ b/lib/PayPal/Api/ShippingInfo.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class ShippingInfo @@ -17,7 +17,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\Phone phone * @property \PayPal\Api\InvoiceAddress address */ -class ShippingInfo extends PPModel +class ShippingInfo extends PayPalModel { /** * First name of the invoice recipient. 30 characters max. @@ -42,31 +42,6 @@ class ShippingInfo extends PPModel return $this->first_name; } - /** - * First name of the invoice recipient. 30 characters max. - * - * @deprecated Instead use setFirstName - * - * @param string $first_name - * @return $this - */ - public function setFirst_name($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the invoice recipient. 30 characters max. - * @deprecated Instead use getFirstName - * - * @return string - */ - public function getFirst_name() - { - return $this->first_name; - } - /** * Last name of the invoice recipient. 30 characters max. * @@ -90,31 +65,6 @@ class ShippingInfo extends PPModel return $this->last_name; } - /** - * Last name of the invoice recipient. 30 characters max. - * - * @deprecated Instead use setLastName - * - * @param string $last_name - * @return $this - */ - public function setLast_name($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * @deprecated Instead use getLastName - * - * @return string - */ - public function getLast_name() - { - return $this->last_name; - } - /** * Company business name of the invoice recipient. 100 characters max. * @@ -138,31 +88,6 @@ class ShippingInfo extends PPModel return $this->business_name; } - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @deprecated Instead use setBusinessName - * - * @param string $business_name - * @return $this - */ - public function setBusiness_name($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * @deprecated Instead use getBusinessName - * - * @return string - */ - public function getBusiness_name() - { - return $this->business_name; - } - /** * * @@ -208,24 +133,4 @@ class ShippingInfo extends PPModel return $this->address; } - /** - * @deprecated This will not be supported soon. Kept for backward Compatibility - * - * @param string $email - */ - public function setEmail($email) - { - $this->email = $email; - } - - /** - * @deprecated This will not be supported soon. Kept for backward Compatibility - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - } diff --git a/lib/PayPal/Api/Tax.php b/lib/PayPal/Api/Tax.php index fc02674..d5b99ab 100644 --- a/lib/PayPal/Api/Tax.php +++ b/lib/PayPal/Api/Tax.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Tax @@ -16,7 +16,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\number percent * @property \PayPal\Api\Currency amount */ -class Tax extends PPModel +class Tax extends PayPalModel { /** * Identifier of the resource. diff --git a/lib/PayPal/Api/Terms.php b/lib/PayPal/Api/Terms.php index 20582ca..8bc1c84 100644 --- a/lib/PayPal/Api/Terms.php +++ b/lib/PayPal/Api/Terms.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class Terms @@ -18,7 +18,7 @@ use PayPal\Common\PPModel; * @property \PayPal\Api\Currency amount_range * @property string buyer_editable */ -class Terms extends PPModel +class Terms extends PayPalModel { /** * Identifier of the terms. 128 characters max. @@ -89,31 +89,6 @@ class Terms extends PPModel return $this->max_billing_amount; } - /** - * Max Amount associated with this term. - * - * @deprecated Instead use setMaxBillingAmount - * - * @param \PayPal\Api\Currency $max_billing_amount - * @return $this - */ - public function setMax_billing_amount($max_billing_amount) - { - $this->max_billing_amount = $max_billing_amount; - return $this; - } - - /** - * Max Amount associated with this term. - * @deprecated Instead use getMaxBillingAmount - * - * @return \PayPal\Api\Currency - */ - public function getMax_billing_amount() - { - return $this->max_billing_amount; - } - /** * How many times money can be pulled during this term. * @@ -160,31 +135,6 @@ class Terms extends PPModel return $this->amount_range; } - /** - * Amount_range associated with this term. - * - * @deprecated Instead use setAmountRange - * - * @param \PayPal\Api\Currency $amount_range - * @return $this - */ - public function setAmount_range($amount_range) - { - $this->amount_range = $amount_range; - return $this; - } - - /** - * Amount_range associated with this term. - * @deprecated Instead use getAmountRange - * - * @return \PayPal\Api\Currency - */ - public function getAmount_range() - { - return $this->amount_range; - } - /** * Buyer's ability to edit the amount in this term. * @@ -208,29 +158,4 @@ class Terms extends PPModel return $this->buyer_editable; } - /** - * Buyer's ability to edit the amount in this term. - * - * @deprecated Instead use setBuyerEditable - * - * @param string $buyer_editable - * @return $this - */ - public function setBuyer_editable($buyer_editable) - { - $this->buyer_editable = $buyer_editable; - return $this; - } - - /** - * Buyer's ability to edit the amount in this term. - * @deprecated Instead use getBuyerEditable - * - * @return string - */ - public function getBuyer_editable() - { - return $this->buyer_editable; - } - } diff --git a/lib/PayPal/Api/Transaction.php b/lib/PayPal/Api/Transaction.php index 33b8c63..48c5629 100644 --- a/lib/PayPal/Api/Transaction.php +++ b/lib/PayPal/Api/Transaction.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -12,7 +12,7 @@ use PayPal\Rest\ApiContext; * * @package PayPal\Api * - * @property self transactions + * @property Transaction transactions */ class Transaction extends TransactionBase { diff --git a/lib/PayPal/Api/TransactionBase.php b/lib/PayPal/Api/TransactionBase.php index 2b477c0..9038065 100644 --- a/lib/PayPal/Api/TransactionBase.php +++ b/lib/PayPal/Api/TransactionBase.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -40,29 +40,4 @@ class TransactionBase extends CartBase return $this->related_resources; } - /** - * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. - * - * @deprecated Instead use setRelatedResources - * - * @param \PayPal\Api\RelatedResources $related_resources - * @return $this - */ - public function setRelated_resources($related_resources) - { - $this->related_resources = $related_resources; - return $this; - } - - /** - * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. - * @deprecated Instead use getRelatedResources - * - * @return \PayPal\Api\RelatedResources - */ - public function getRelated_resources() - { - return $this->related_resources; - } - } diff --git a/lib/PayPal/Api/Transactions.php b/lib/PayPal/Api/Transactions.php index 8cb6e6a..100fff5 100644 --- a/lib/PayPal/Api/Transactions.php +++ b/lib/PayPal/Api/Transactions.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; /** @@ -14,7 +14,7 @@ use PayPal\Rest\ApiContext; * * @property \PayPal\Api\Amount amount */ -class Transactions extends PPModel +class Transactions extends PayPalModel { /** * Amount being collected. diff --git a/lib/PayPal/Api/WebProfile.php b/lib/PayPal/Api/WebProfile.php index 292975a..3f9c209 100644 --- a/lib/PayPal/Api/WebProfile.php +++ b/lib/PayPal/Api/WebProfile.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\CreateProfileResponse; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class WebProfile @@ -21,7 +21,7 @@ use PayPal\Transport\PPRestCall; * @property \PayPal\Api\InputFields input_fields * @property \PayPal\Api\Presentation presentation */ -class WebProfile extends ResourceModel +class WebProfile extends PayPalResourceModel { /** * ID of the web experience profile. @@ -95,31 +95,6 @@ class WebProfile extends ResourceModel return $this->flow_config; } - /** - * Parameters for flow configuration. - * - * @deprecated Instead use setFlowConfig - * - * @param \PayPal\Api\FlowConfig $flow_config - * @return $this - */ - public function setFlow_config($flow_config) - { - $this->flow_config = $flow_config; - return $this; - } - - /** - * Parameters for flow configuration. - * @deprecated Instead use getFlowConfig - * - * @return \PayPal\Api\FlowConfig - */ - public function getFlow_config() - { - return $this->flow_config; - } - /** * Parameters for input fields customization. * @@ -144,31 +119,6 @@ class WebProfile extends ResourceModel return $this->input_fields; } - /** - * Parameters for input fields customization. - * - * @deprecated Instead use setInputFields - * - * @param \PayPal\Api\InputFields $input_fields - * @return $this - */ - public function setInput_fields($input_fields) - { - $this->input_fields = $input_fields; - return $this; - } - - /** - * Parameters for input fields customization. - * @deprecated Instead use getInputFields - * - * @return \PayPal\Api\InputFields - */ - public function getInput_fields() - { - return $this->input_fields; - } - /** * Parameters for style and presentation. * @@ -197,7 +147,7 @@ class WebProfile extends ResourceModel * Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return CreateProfileResponse */ public function create($apiContext = null, $restCall = null) @@ -220,7 +170,7 @@ class WebProfile extends ResourceModel * Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function update($apiContext = null, $restCall = null) @@ -243,7 +193,7 @@ class WebProfile extends ResourceModel * * @param Patch[] $patch * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function partial_update($patch, $apiContext = null, $restCall = null) @@ -271,7 +221,7 @@ class WebProfile extends ResourceModel * * @param string $profileId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebProfile */ public static function get($profileId, $apiContext = null, $restCall = null) @@ -295,7 +245,7 @@ class WebProfile extends ResourceModel * Lists all web experience profiles that exist for a merchant (or subject). * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebProfile[] */ public static function get_list($apiContext = null, $restCall = null) @@ -316,7 +266,7 @@ class WebProfile extends ResourceModel * Delete an existing web experience profile by passing the profile ID to the request URI. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/Webhook.php b/lib/PayPal/Api/Webhook.php index fdaa559..d6098f4 100644 --- a/lib/PayPal/Api/Webhook.php +++ b/lib/PayPal/Api/Webhook.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\UrlValidator; /** @@ -19,9 +19,8 @@ use PayPal\Validation\UrlValidator; * @property string id * @property string url * @property \PayPal\Api\WebhookEventType[] event_types - * @property \PayPal\Api\Links[] links */ -class Webhook extends ResourceModel +class Webhook extends PayPalResourceModel { /** * Identifier of the webhook resource. @@ -123,89 +122,11 @@ class Webhook extends ResourceModel ); } - /** - * List of Webhooks event-types. - * - * @deprecated Instead use setEventTypes - * - * @param \PayPal\Api\WebhookEventType $event_types - * @return $this - */ - public function setEvent_types($event_types) - { - $this->event_types = $event_types; - return $this; - } - - /** - * List of Webhooks event-types. - * @deprecated Instead use getEventTypes - * - * @return \PayPal\Api\WebhookEventType - */ - public function getEvent_types() - { - return $this->event_types; - } - - /** - * 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)) - ); - } - /** * Creates the Webhook for the application associated with the access token. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Webhook */ public function create($apiContext = null, $restCall = null) @@ -228,7 +149,7 @@ class Webhook extends ResourceModel * * @param string $webhookId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Webhook */ public static function get($webhookId, $apiContext = null, $restCall = null) @@ -252,7 +173,7 @@ class Webhook extends ResourceModel * Retrieves all Webhooks for the application associated with access token. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookList */ public static function getAll($apiContext = null, $restCall = null) @@ -276,7 +197,7 @@ class Webhook extends ResourceModel * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return Webhook */ public function update($patchRequest, $apiContext = null, $restCall = null) @@ -300,7 +221,7 @@ class Webhook extends ResourceModel * Deletes the Webhook identified by webhook_id for the application associated with access token. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return bool */ public function delete($apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/WebhookEvent.php b/lib/PayPal/Api/WebhookEvent.php index cc69209..353f4e2 100644 --- a/lib/PayPal/Api/WebhookEvent.php +++ b/lib/PayPal/Api/WebhookEvent.php @@ -2,12 +2,12 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookEventList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class WebhookEvent @@ -22,9 +22,8 @@ use PayPal\Transport\PPRestCall; * @property string event_type * @property string summary * @property mixed resource - * @property \PayPal\Api\Links[] links */ -class WebhookEvent extends ResourceModel +class WebhookEvent extends PayPalResourceModel { /** * Identifier of the Webhooks event resource. @@ -72,31 +71,6 @@ class WebhookEvent extends ResourceModel return $this->create_time; } - /** - * Time the resource was created. - * - * @deprecated Instead use setCreateTime - * - * @param string $create_time - * @return $this - */ - public function setCreate_time($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created. - * @deprecated Instead use getCreateTime - * - * @return string - */ - public function getCreate_time() - { - return $this->create_time; - } - /** * Name of the resource contained in resource element. * @@ -120,31 +94,6 @@ class WebhookEvent extends ResourceModel return $this->resource_type; } - /** - * Name of the resource contained in resource element. - * - * @deprecated Instead use setResourceType - * - * @param string $resource_type - * @return $this - */ - public function setResource_type($resource_type) - { - $this->resource_type = $resource_type; - return $this; - } - - /** - * Name of the resource contained in resource element. - * @deprecated Instead use getResourceType - * - * @return string - */ - public function getResource_type() - { - return $this->resource_type; - } - /** * Name of the event type that occurred on resource, identified by data_resource element, to trigger the Webhooks event. * @@ -168,31 +117,6 @@ class WebhookEvent extends ResourceModel return $this->event_type; } - /** - * Name of the event type that occurred on resource, identified by data_resource element, to trigger the Webhooks event. - * - * @deprecated Instead use setEventType - * - * @param string $event_type - * @return $this - */ - public function setEvent_type($event_type) - { - $this->event_type = $event_type; - return $this; - } - - /** - * Name of the event type that occurred on resource, identified by data_resource element, to trigger the Webhooks event. - * @deprecated Instead use getEventType - * - * @return string - */ - public function getEvent_type() - { - return $this->event_type; - } - /** * A summary description of the event. E.g. A successful payment authorization was created for $$ * @@ -219,7 +143,7 @@ class WebhookEvent extends ResourceModel /** * This contains the resource that is identified by resource_type element. * - * @param \PayPal\Common\PPModel $resource + * @param \PayPal\Common\PayPalModel $resource * * @return $this */ @@ -232,72 +156,19 @@ class WebhookEvent extends ResourceModel /** * This contains the resource that is identified by resource_type element. * - * @return \PayPal\Common\PPModel + * @return \PayPal\Common\PayPalModel */ public function getResource() { return $this->resource; } - /** - * 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)) - ); - } - /** * Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event. * * @param string $eventId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookEvent */ public static function get($eventId, $apiContext = null, $restCall = null) @@ -321,7 +192,7 @@ class WebhookEvent extends ResourceModel * Resends the Webhooks event resource identified by event_id. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookEvent */ public function resend($apiContext = null, $restCall = null) @@ -345,7 +216,7 @@ class WebhookEvent extends ResourceModel * * @param array $params * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookEventList */ public static function all($params, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/WebhookEventList.php b/lib/PayPal/Api/WebhookEventList.php index eae4da6..3ad2d8a 100644 --- a/lib/PayPal/Api/WebhookEventList.php +++ b/lib/PayPal/Api/WebhookEventList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class WebhookEventList @@ -15,7 +15,7 @@ use PayPal\Common\PPModel; * @property int count * @property \PayPal\Api\Links[] links */ -class WebhookEventList extends PPModel +class WebhookEventList extends PayPalModel { /** * A list of Webhooks event resources diff --git a/lib/PayPal/Api/WebhookEventType.php b/lib/PayPal/Api/WebhookEventType.php index c0287ff..23dcbb6 100644 --- a/lib/PayPal/Api/WebhookEventType.php +++ b/lib/PayPal/Api/WebhookEventType.php @@ -2,11 +2,11 @@ namespace PayPal\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookEventList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; /** * Class WebhookEventType @@ -18,7 +18,7 @@ use PayPal\Transport\PPRestCall; * @property string name * @property string description */ -class WebhookEventType extends ResourceModel +class WebhookEventType extends PayPalResourceModel { /** * Unique event-type name. @@ -71,7 +71,7 @@ class WebhookEventType extends ResourceModel * * @param string $webhookId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookEventTypeList */ public static function subscribedEventTypes($webhookId, $apiContext = null, $restCall = null) @@ -95,7 +95,7 @@ class WebhookEventType extends ResourceModel * Retrieves the master list of available Webhooks events-types resources for any webhook to subscribe to. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookEventTypeList */ public static function availableEventTypes($apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/WebhookEventTypeList.php b/lib/PayPal/Api/WebhookEventTypeList.php index 867db39..61c0d65 100644 --- a/lib/PayPal/Api/WebhookEventTypeList.php +++ b/lib/PayPal/Api/WebhookEventTypeList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class WebhookEventTypeList @@ -13,7 +13,7 @@ use PayPal\Common\PPModel; * * @property \PayPal\Api\WebhookEventType[] event_types */ -class WebhookEventTypeList extends PPModel +class WebhookEventTypeList extends PayPalModel { /** * A list of Webhooks event-types @@ -68,29 +68,4 @@ class WebhookEventTypeList extends PPModel ); } - /** - * A list of Webhooks event-types - * - * @deprecated Instead use setEventTypes - * - * @param \PayPal\Api\WebhookEventType $event_types - * @return $this - */ - public function setEvent_types($event_types) - { - $this->event_types = $event_types; - return $this; - } - - /** - * A list of Webhooks event-types - * @deprecated Instead use getEventTypes - * - * @return \PayPal\Api\WebhookEventType - */ - public function getEvent_types() - { - return $this->event_types; - } - } diff --git a/lib/PayPal/Api/WebhookList.php b/lib/PayPal/Api/WebhookList.php index c0aa129..4bb5148 100644 --- a/lib/PayPal/Api/WebhookList.php +++ b/lib/PayPal/Api/WebhookList.php @@ -2,7 +2,7 @@ namespace PayPal\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; /** * Class WebhookList @@ -13,7 +13,7 @@ use PayPal\Common\PPModel; * * @property \PayPal\Api\Webhook[] webhooks */ -class WebhookList extends PPModel +class WebhookList extends PayPalModel { /** * A list of Webhooks diff --git a/lib/PayPal/Auth/OAuthTokenCredential.php b/lib/PayPal/Auth/OAuthTokenCredential.php index 52e1232..7d3356b 100644 --- a/lib/PayPal/Auth/OAuthTokenCredential.php +++ b/lib/PayPal/Auth/OAuthTokenCredential.php @@ -3,18 +3,18 @@ namespace PayPal\Auth; use PayPal\Cache\AuthorizationCache; -use PayPal\Common\ResourceModel; -use PayPal\Core\PPHttpConfig; -use PayPal\Core\PPHttpConnection; -use PayPal\Core\PPLoggingManager; -use PayPal\Exception\PPConfigurationException; -use PayPal\Handler\IPPHandler; +use PayPal\Common\PayPalResourceModel; +use PayPal\Core\PayPalHttpConfig; +use PayPal\Core\PayPalHttpConnection; +use PayPal\Core\PayPalLoggingManager; +use PayPal\Exception\PayPalConfigurationException; +use PayPal\Handler\IPayPalHandler; use PayPal\Rest\ApiContext; /** * Class OAuthTokenCredential */ -class OAuthTokenCredential extends ResourceModel +class OAuthTokenCredential extends PayPalResourceModel { public static $CACHE_PATH = '/../../../var/auth.cache'; @@ -22,7 +22,7 @@ class OAuthTokenCredential extends ResourceModel /** * @var string Default Auth Handler */ - public static $AUTH_HANDLER = 'PayPal\Rest\OauthHandler'; + public static $AUTH_HANDLER = 'PayPal\Handler\OauthHandler'; /** * Private Variable @@ -34,7 +34,7 @@ class OAuthTokenCredential extends ResourceModel /** * Private Variable * - * @var \PayPal\Core\PPLoggingManager $logger + * @var \PayPal\Core\PayPalLoggingManager $logger */ private $logger; @@ -83,7 +83,7 @@ class OAuthTokenCredential extends ResourceModel { $this->clientId = $clientId; $this->clientSecret = $clientSecret; - $this->logger = PPLoggingManager::getInstance(__CLASS__); + $this->logger = PayPalLoggingManager::getInstance(__CLASS__); } /** @@ -199,16 +199,16 @@ class OAuthTokenCredential extends ResourceModel * @param string $clientSecret * @param string $payload * @return mixed - * @throws PPConfigurationException - * @throws \PayPal\Exception\PPConnectionException + * @throws PayPalConfigurationException + * @throws \PayPal\Exception\PayPalConnectionException */ private function getToken($config, $clientId, $clientSecret, $payload) { - $httpConfig = new PPHttpConfig(null, 'POST'); + $httpConfig = new PayPalHttpConfig(null, 'POST'); $handlers = array(self::$AUTH_HANDLER); - /** @var IPPHandler $handler */ + /** @var IPayPalHandler $handler */ foreach ($handlers as $handler) { if (!is_object($handler)) { $fullHandler = "\\" . (string)$handler; @@ -217,7 +217,7 @@ class OAuthTokenCredential extends ResourceModel $handler->handle($httpConfig, $payload, array('clientId' => $clientId, 'clientSecret' => $clientSecret)); } - $connection = new PPHttpConnection($httpConfig, $config); + $connection = new PayPalHttpConnection($httpConfig, $config); $res = $connection->execute($payload); $response = json_decode($res, true); diff --git a/lib/PayPal/Cache/AuthorizationCache.php b/lib/PayPal/Cache/AuthorizationCache.php index 0f0be78..32649a2 100644 --- a/lib/PayPal/Cache/AuthorizationCache.php +++ b/lib/PayPal/Cache/AuthorizationCache.php @@ -2,7 +2,7 @@ namespace PayPal\Cache; -use PayPal\Core\PPConfigManager; +use PayPal\Core\PayPalConfigManager; use PayPal\Validation\JsonValidator; abstract class AuthorizationCache @@ -23,9 +23,10 @@ abstract class AuthorizationCache if (!self::isEnabled($config)) { return null; } $tokens = null; - if (file_exists(__DIR__ . self::$CACHE_PATH)) { + $cachePath = self::cachePath($config); + if (file_exists($cachePath)) { // Read from the file - $cachedToken = file_get_contents(__DIR__ . self::$CACHE_PATH); + $cachedToken = file_get_contents($cachePath); if ($cachedToken && JsonValidator::validate($cachedToken, true)) { $tokens = json_decode($cachedToken, true); if ($clientId && is_array($tokens) && array_key_exists($clientId, $tokens)) { @@ -54,8 +55,9 @@ abstract class AuthorizationCache // Return if not enabled if (!self::isEnabled($config)) { return; } - if (!is_dir(dirname(__DIR__ . self::$CACHE_PATH))) { - if (mkdir(dirname(__DIR__ . self::$CACHE_PATH), 0755, true) == false) { + $cachePath = self::cachePath($config); + if (!is_dir(dirname($cachePath))) { + if (mkdir(dirname($cachePath), 0755, true) == false) { return; } } @@ -71,7 +73,7 @@ abstract class AuthorizationCache 'tokenExpiresIn' => $tokenExpiresIn ); } - file_put_contents(__DIR__ . self::$CACHE_PATH, json_encode($tokens)); + file_put_contents($cachePath, json_encode($tokens)); } /** @@ -82,12 +84,34 @@ abstract class AuthorizationCache */ public static function isEnabled($config) { - $config = ($config && is_array($config)) ? $config : PPConfigManager::getInstance()->getConfigHashmap(); - if (array_key_exists("cache.enabled", $config)) { - $value = $config['cache.enabled']; - return (trim($value) == true || trim($value) == 'true') ? true : false; - } - return false; + $value = self::getConfigValue('cache.enabled', $config); + return empty($value) ? false : ((trim($value) == true || trim($value) == 'true') ? true : false); + } + + /** + * Returns the cache file path + * + * @param $config + * @return string + */ + public static function cachePath($config) + { + $cachePath = self::getConfigValue('cache.FileName', $config); + return empty($cachePath) ? __DIR__ . self::$CACHE_PATH : $cachePath; + } + + /** + * Returns the Value of the key if found in given config, or from PayPal Config Manager + * Returns null if not found + * + * @param $key + * @param $config + * @return null|string + */ + private static function getConfigValue($key, $config) + { + $config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap(); + return (array_key_exists($key, $config)) ? trim($config[$key]) : null; } diff --git a/lib/PayPal/Common/PPArrayUtil.php b/lib/PayPal/Common/ArrayUtil.php similarity index 90% rename from lib/PayPal/Common/PPArrayUtil.php rename to lib/PayPal/Common/ArrayUtil.php index 6b6342e..f36be34 100644 --- a/lib/PayPal/Common/PPArrayUtil.php +++ b/lib/PayPal/Common/ArrayUtil.php @@ -3,12 +3,12 @@ namespace PayPal\Common; /** - * Class PPArrayUtil + * Class ArrayUtil * Util Class for Arrays * * @package PayPal\Common */ -class PPArrayUtil +class ArrayUtil { /** @@ -25,4 +25,4 @@ class PPArrayUtil } return true; } -} \ No newline at end of file +} diff --git a/lib/PayPal/Common/PPModel.php b/lib/PayPal/Common/PayPalModel.php similarity index 89% rename from lib/PayPal/Common/PPModel.php rename to lib/PayPal/Common/PayPalModel.php index bdcf662..1f294a0 100644 --- a/lib/PayPal/Common/PPModel.php +++ b/lib/PayPal/Common/PayPalModel.php @@ -9,11 +9,29 @@ use PayPal\Validation\ModelAccessorValidator; * Stores all member data in a Hashmap that enables easy * JSON encoding/decoding */ -class PPModel +class PayPalModel { private $_propMap = array(); + /** + * OAuth Credentials to use for this call + * + * @var \PayPal\Auth\OAuthTokenCredential $credential + */ + protected static $credential; + + /** + * Sets Credential + * + * @deprecated Pass ApiContext to create/get methods instead + * @param \PayPal\Auth\OAuthTokenCredential $credential + */ + public static function setCredential($credential) + { + self::$credential = $credential; + } + /** * Default Constructor * @@ -52,7 +70,7 @@ class PPModel //Convert to Array if Json Data Sent $data = json_decode($data, true); } - if (!PPArrayUtil::isAssocArray($data)) { + if (!ArrayUtil::isAssocArray($data)) { $list = array(); //This means, root element is array foreach ($data as $k => $v) { @@ -136,7 +154,7 @@ class PPModel { $ret = array(); foreach ($param as $k => $v) { - if ($v instanceof PPModel) { + if ($v instanceof PayPalModel) { $ret[$k] = $v->toArray(); } else if (is_array($v)) { $ret[$k] = $this->_convertToArray($v); @@ -158,8 +176,8 @@ class PPModel if (!empty($arr)) { foreach ($arr as $k => $v) { if (is_array($v)) { - $clazz = PPReflectionUtil::getPropertyClass(get_class($this), $k); - if (PPArrayUtil::isAssocArray($v)) { + $clazz = ReflectionUtil::getPropertyClass(get_class($this), $k); + if (ArrayUtil::isAssocArray($v)) { /** @var self $o */ $o = new $clazz(); $o->fromArray($v); diff --git a/lib/PayPal/Common/PayPalResourceModel.php b/lib/PayPal/Common/PayPalResourceModel.php new file mode 100644 index 0000000..6b9ec01 --- /dev/null +++ b/lib/PayPal/Common/PayPalResourceModel.php @@ -0,0 +1,106 @@ +links = $links; + return $this; + } + + /** + * Gets Links + * + * @return \PayPal\Api\Links[] + */ + public function getLinks() + { + return $this->links; + } + + public function getLink($rel) + { + foreach ($this->links as $link) { + if ($link->getRel() == $rel) { + return $link->getHref(); + } + } + return null; + } + + /** + * 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)) + ); + } + + + /** + * Execute SDK Call to Paypal services + * + * @param string $url + * @param string $method + * @param string $payLoad + * @param array $headers + * @param ApiContext $apiContext + * @param PayPalRestCall $restCall + * @param array $handlers + * @return string json response of the object + */ + protected static function executeCall($url, $method, $payLoad, $headers = array(), $apiContext = null, $restCall = null, $handlers = array('PayPal\Handler\RestHandler')) + { + //Initialize the context and rest call object if not provided explicitly + $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); + $restCall = $restCall ? $restCall : new PayPalRestCall($apiContext); + + //Make the execution call + $json = $restCall->execute($handlers, $url, $method, $payLoad, $headers); + return $json; + } +} diff --git a/lib/PayPal/Common/PPUserAgent.php b/lib/PayPal/Common/PayPalUserAgent.php similarity index 92% rename from lib/PayPal/Common/PPUserAgent.php rename to lib/PayPal/Common/PayPalUserAgent.php index 1ce5655..d6adc47 100644 --- a/lib/PayPal/Common/PPUserAgent.php +++ b/lib/PayPal/Common/PayPalUserAgent.php @@ -3,12 +3,12 @@ namespace PayPal\Common; /** - * Class PPUserAgent - * PPUserAgent generates User Agent for curl requests + * Class PayPalUserAgent + * PayPalUserAgent generates User Agent for curl requests * * @package PayPal\Common */ -class PPUserAgent +class PayPalUserAgent { /** @@ -56,4 +56,4 @@ class PPUserAgent return PHP_INT_SIZE; } } -} \ No newline at end of file +} diff --git a/lib/PayPal/Common/PPReflectionUtil.php b/lib/PayPal/Common/ReflectionUtil.php similarity index 86% rename from lib/PayPal/Common/PPReflectionUtil.php rename to lib/PayPal/Common/ReflectionUtil.php index 9222bf6..55ee180 100644 --- a/lib/PayPal/Common/PPReflectionUtil.php +++ b/lib/PayPal/Common/ReflectionUtil.php @@ -1,13 +1,14 @@ execute($handlers, $url, $method, $payLoad, $headers); - return $json; - } -} diff --git a/lib/PayPal/Common/FormatConverter.php b/lib/PayPal/Converter/FormatConverter.php similarity index 86% rename from lib/PayPal/Common/FormatConverter.php rename to lib/PayPal/Converter/FormatConverter.php index e5db4b5..dd66eb8 100644 --- a/lib/PayPal/Common/FormatConverter.php +++ b/lib/PayPal/Converter/FormatConverter.php @@ -1,6 +1,6 @@ getConfigHashmap() : $config); + self::$instance = new self($config == null ? PayPalConfigManager::getInstance()->getConfigHashmap() : $config); } return self::$instance; } @@ -140,7 +140,7 @@ class PPCredentialManager * * @param null $userId * @return OAuthTokenCredential - * @throws PPInvalidCredentialException + * @throws PayPalInvalidCredentialException */ public function getCredentialObject($userId = null) { @@ -151,7 +151,7 @@ class PPCredentialManager } if (empty($credObj)) { - throw new PPInvalidCredentialException("Credential not found for " . ($userId ? $userId : " default user") . + throw new PayPalInvalidCredentialException("Credential not found for " . ($userId ? $userId : " default user") . ". Please make sure your configuration/APIContext has credential information"); } return $credObj; diff --git a/lib/PayPal/Core/PPHttpConfig.php b/lib/PayPal/Core/PayPalHttpConfig.php similarity index 95% rename from lib/PayPal/Core/PPHttpConfig.php rename to lib/PayPal/Core/PayPalHttpConfig.php index ced08ef..aed127d 100644 --- a/lib/PayPal/Core/PPHttpConfig.php +++ b/lib/PayPal/Core/PayPalHttpConfig.php @@ -2,19 +2,19 @@ namespace PayPal\Core; -use PayPal\Exception\PPConfigurationException; +use PayPal\Exception\PayPalConfigurationException; /** - * Class PPHttpConfig + * Class PayPalHttpConfig * Http Configuration Class * * @package PayPal\Core */ -class PPHttpConfig +class PayPalHttpConfig { /** * Some default options for curl - * These are typically overridden by PPConnectionManager + * These are typically overridden by PayPalConnectionManager * * @var array */ @@ -228,13 +228,13 @@ class PPHttpConfig * Set HTTP proxy information * * @param string $proxy - * @throws PPConfigurationException + * @throws PayPalConfigurationException */ public function setHttpProxy($proxy) { $urlParts = parse_url($proxy); if ($urlParts == false || !array_key_exists("host", $urlParts)) { - throw new PPConfigurationException("Invalid proxy configuration " . $proxy); + throw new PayPalConfigurationException("Invalid proxy configuration " . $proxy); } $this->curlOptions[CURLOPT_PROXY] = $urlParts["host"]; if (isset($urlParts["port"])) { diff --git a/lib/PayPal/Core/PPHttpConnection.php b/lib/PayPal/Core/PayPalHttpConnection.php similarity index 86% rename from lib/PayPal/Core/PPHttpConnection.php rename to lib/PayPal/Core/PayPalHttpConnection.php index 8554686..c3537ee 100644 --- a/lib/PayPal/Core/PPHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -2,19 +2,19 @@ namespace PayPal\Core; -use PayPal\Exception\PPConfigurationException; -use PayPal\Exception\PPConnectionException; +use PayPal\Exception\PayPalConfigurationException; +use PayPal\Exception\PayPalConnectionException; /** * A wrapper class based on the curl extension. * Requires the PHP curl module to be enabled. * See for full requirements the PHP manual: http://php.net/curl */ -class PPHttpConnection +class PayPalHttpConnection { /** - * @var PPHttpConfig + * @var PayPalHttpConfig */ private $httpConfig; @@ -28,24 +28,24 @@ class PPHttpConnection /** * LoggingManager * - * @var PPLoggingManager + * @var PayPalLoggingManager */ private $logger; /** * Default Constructor * - * @param PPHttpConfig $httpConfig + * @param PayPalHttpConfig $httpConfig * @param array $config - * @throws PPConfigurationException + * @throws PayPalConfigurationException */ - public function __construct(PPHttpConfig $httpConfig, array $config) + public function __construct(PayPalHttpConfig $httpConfig, array $config) { if (!function_exists("curl_init")) { - throw new PPConfigurationException("Curl module is not available on this system"); + throw new PayPalConfigurationException("Curl module is not available on this system"); } $this->httpConfig = $httpConfig; - $this->logger = PPLoggingManager::getInstance(__CLASS__); + $this->logger = PayPalLoggingManager::getInstance(__CLASS__); } /** @@ -67,14 +67,14 @@ class PPHttpConnection * Executes an HTTP request * * @param string $data query string OR POST content as a string - * @throws PPConnectionException + * @throws PayPalConnectionException */ /** * Executes an HTTP request * * @param string $data query string OR POST content as a string * @return mixed - * @throws PPConnectionException + * @throws PayPalConnectionException */ public function execute($data) { @@ -134,7 +134,7 @@ class PPHttpConnection //Throw Exception if Retries and Certificates doenst work if (curl_errno($ch)) { - $ex = new PPConnectionException( + $ex = new PayPalConnectionException( $this->httpConfig->getUrl(), curl_error($ch), curl_errno($ch) @@ -148,7 +148,7 @@ class PPHttpConnection $this->logger->fine(($result && $result != '' ? "Response : " . $result : "No Response Body") . "\n\n"); //More Exceptions based on HttpStatus Code if (in_array($httpStatus, self::$retryCodes)) { - $ex = new PPConnectionException( + $ex = new PayPalConnectionException( $this->httpConfig->getUrl(), "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . "Retried $retries times." @@ -156,7 +156,7 @@ class PPHttpConnection $ex->setData($result); throw $ex; } else if ($httpStatus < 200 || $httpStatus >= 300) { - $ex = new PPConnectionException( + $ex = new PayPalConnectionException( $this->httpConfig->getUrl(), "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.", $httpStatus diff --git a/lib/PayPal/Core/PPLoggingLevel.php b/lib/PayPal/Core/PayPalLoggingLevel.php similarity index 91% rename from lib/PayPal/Core/PPLoggingLevel.php rename to lib/PayPal/Core/PayPalLoggingLevel.php index af59287..98faad4 100644 --- a/lib/PayPal/Core/PPLoggingLevel.php +++ b/lib/PayPal/Core/PayPalLoggingLevel.php @@ -6,7 +6,7 @@ namespace PayPal\Core; * Logging Levels. * Class containing all the constants for Logging Levels. */ -class PPLoggingLevel +class PayPalLoggingLevel { // FINE Logging Level @@ -20,4 +20,4 @@ class PPLoggingLevel // ERROR Logging Level const ERROR = 0; -} \ No newline at end of file +} diff --git a/lib/PayPal/Core/PPLoggingManager.php b/lib/PayPal/Core/PayPalLoggingManager.php similarity index 80% rename from lib/PayPal/Core/PPLoggingManager.php rename to lib/PayPal/Core/PayPalLoggingManager.php index a2eda13..fc2565a 100644 --- a/lib/PayPal/Core/PPLoggingManager.php +++ b/lib/PayPal/Core/PayPalLoggingManager.php @@ -7,7 +7,7 @@ namespace PayPal\Core; * This does an error_log for now * Potential frameworks to use are PEAR logger, log4php from Apache */ -class PPLoggingManager +class PayPalLoggingManager { /** @@ -75,7 +75,7 @@ class PPLoggingManager date_default_timezone_set('GMT'); } - $config = PPConfigManager::getInstance()->getConfigHashmap(); + $config = PayPalConfigManager::getInstance()->getConfigHashmap(); $this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1'); @@ -83,9 +83,9 @@ class PPLoggingManager $this->loggerFile = ($config['log.FileName']) ? $config['log.FileName'] : ini_get('error_log'); $loggingLevel = strtoupper($config['log.LogLevel']); $this->loggingLevel = - (isset($loggingLevel) && defined(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel")) ? - constant(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel") : - PPLoggingManager::DEFAULT_LOGGING_LEVEL; + (isset($loggingLevel) && defined(__NAMESPACE__ . "\\PayPalLoggingLevel::$loggingLevel")) ? + constant(__NAMESPACE__ . "\\PayPalLoggingLevel::$loggingLevel") : + PayPalLoggingManager::DEFAULT_LOGGING_LEVEL; } } @@ -95,7 +95,7 @@ class PPLoggingManager * @param string $message * @param int $level */ - private function log($message, $level = PPLoggingLevel::INFO) + private function log($message, $level = PayPalLoggingLevel::INFO) { if ($this->isLoggingEnabled && ($level <= $this->loggingLevel)) { error_log("[" . date('d-m-Y h:i:s') . "] " . $this->loggerName . ": $message\n", 3, $this->loggerFile); @@ -109,7 +109,7 @@ class PPLoggingManager */ public function error($message) { - $this->log('ERROR: ' . $message, PPLoggingLevel::ERROR); + $this->log('ERROR: ' . $message, PayPalLoggingLevel::ERROR); } /** @@ -119,7 +119,7 @@ class PPLoggingManager */ public function warning($message) { - $this->log('WARNING: ' . $message, PPLoggingLevel::WARN); + $this->log('WARNING: ' . $message, PayPalLoggingLevel::WARN); } /** @@ -129,7 +129,7 @@ class PPLoggingManager */ public function info($message) { - $this->log('INFO: ' . $message, PPLoggingLevel::INFO); + $this->log('INFO: ' . $message, PayPalLoggingLevel::INFO); } /** @@ -139,7 +139,7 @@ class PPLoggingManager */ public function fine($message) { - $this->log('FINE: ' . $message, PPLoggingLevel::FINE); + $this->log('FINE: ' . $message, PayPalLoggingLevel::FINE); } } diff --git a/lib/PayPal/Exception/PPConfigurationException.php b/lib/PayPal/Exception/PayPalConfigurationException.php similarity index 76% rename from lib/PayPal/Exception/PPConfigurationException.php rename to lib/PayPal/Exception/PayPalConfigurationException.php index b17d2eb..5105747 100644 --- a/lib/PayPal/Exception/PPConfigurationException.php +++ b/lib/PayPal/Exception/PayPalConfigurationException.php @@ -3,11 +3,11 @@ namespace PayPal\Exception; /** - * Class PPConfigurationException + * Class PayPalConfigurationException * * @package PayPal\Exception */ -class PPConfigurationException extends \Exception +class PayPalConfigurationException extends \Exception { /** @@ -20,4 +20,4 @@ class PPConfigurationException extends \Exception { parent::__construct($message, $code); } -} \ No newline at end of file +} diff --git a/lib/PayPal/Exception/PPConnectionException.php b/lib/PayPal/Exception/PayPalConnectionException.php similarity index 91% rename from lib/PayPal/Exception/PPConnectionException.php rename to lib/PayPal/Exception/PayPalConnectionException.php index 69740eb..72eeafe 100644 --- a/lib/PayPal/Exception/PPConnectionException.php +++ b/lib/PayPal/Exception/PayPalConnectionException.php @@ -3,11 +3,11 @@ namespace PayPal\Exception; /** - * Class PPConnectionException + * Class PayPalConnectionException * * @package PayPal\Exception */ -class PPConnectionException extends \Exception +class PayPalConnectionException extends \Exception { /** * The url that was being connected to when the exception occured @@ -65,4 +65,4 @@ class PPConnectionException extends \Exception { return $this->url; } -} \ No newline at end of file +} diff --git a/lib/PayPal/Exception/PPInvalidCredentialException.php b/lib/PayPal/Exception/PayPalInvalidCredentialException.php similarity index 85% rename from lib/PayPal/Exception/PPInvalidCredentialException.php rename to lib/PayPal/Exception/PayPalInvalidCredentialException.php index 71b6f59..2531f5b 100644 --- a/lib/PayPal/Exception/PPInvalidCredentialException.php +++ b/lib/PayPal/Exception/PayPalInvalidCredentialException.php @@ -3,11 +3,11 @@ namespace PayPal\Exception; /** - * Class PPInvalidCredentialException + * Class PayPalInvalidCredentialException * * @package PayPal\Exception */ -class PPInvalidCredentialException extends \Exception +class PayPalInvalidCredentialException extends \Exception { /** @@ -33,4 +33,4 @@ class PPInvalidCredentialException extends \Exception return $errorMsg; } -} \ No newline at end of file +} diff --git a/lib/PayPal/Exception/PPMissingCredentialException.php b/lib/PayPal/Exception/PayPalMissingCredentialException.php similarity index 85% rename from lib/PayPal/Exception/PPMissingCredentialException.php rename to lib/PayPal/Exception/PayPalMissingCredentialException.php index a5ecae9..9fac996 100644 --- a/lib/PayPal/Exception/PPMissingCredentialException.php +++ b/lib/PayPal/Exception/PayPalMissingCredentialException.php @@ -3,11 +3,11 @@ namespace PayPal\Exception; /** - * Class PPMissingCredentialException + * Class PayPalMissingCredentialException * * @package PayPal\Exception */ -class PPMissingCredentialException extends \Exception +class PayPalMissingCredentialException extends \Exception { /** @@ -34,4 +34,4 @@ class PPMissingCredentialException extends \Exception return $errorMsg; } -} \ No newline at end of file +} diff --git a/lib/PayPal/Handler/IPPHandler.php b/lib/PayPal/Handler/IPayPalHandler.php similarity index 68% rename from lib/PayPal/Handler/IPPHandler.php rename to lib/PayPal/Handler/IPayPalHandler.php index dc57589..0d1c8ff 100644 --- a/lib/PayPal/Handler/IPPHandler.php +++ b/lib/PayPal/Handler/IPayPalHandler.php @@ -3,18 +3,18 @@ namespace PayPal\Handler; /** - * Interface IPPHandler + * Interface IPayPalHandler * * @package PayPal\Handler */ -interface IPPHandler +interface IPayPalHandler { /** * - * @param \Paypal\Core\PPHttpConfig $httpConfig + * @param \Paypal\Core\PayPalHttpConfig $httpConfig * @param string $request * @param mixed $options * @return mixed */ public function handle($httpConfig, $request, $options); -} \ No newline at end of file +} diff --git a/lib/PayPal/Rest/OauthHandler.php b/lib/PayPal/Handler/OauthHandler.php similarity index 66% rename from lib/PayPal/Rest/OauthHandler.php rename to lib/PayPal/Handler/OauthHandler.php index 1678a6d..f281eb0 100644 --- a/lib/PayPal/Rest/OauthHandler.php +++ b/lib/PayPal/Handler/OauthHandler.php @@ -3,20 +3,19 @@ * API handler for OAuth Token Request REST API calls */ -namespace PayPal\Rest; +namespace PayPal\Handler; -use PayPal\Common\PPUserAgent; -use PayPal\Core\PPConstants; -use PayPal\Core\PPHttpConfig; -use PayPal\Exception\PPConfigurationException; -use PayPal\Exception\PPInvalidCredentialException; -use PayPal\Exception\PPMissingCredentialException; -use PayPal\Handler\IPPHandler; +use PayPal\Common\PayPalUserAgent; +use PayPal\Core\PayPalConstants; +use PayPal\Core\PayPalHttpConfig; +use PayPal\Exception\PayPalConfigurationException; +use PayPal\Exception\PayPalInvalidCredentialException; +use PayPal\Exception\PayPalMissingCredentialException; /** * Class OauthHandler */ -class OauthHandler implements IPPHandler +class OauthHandler implements IPayPalHandler { /** * Private Variable @@ -36,13 +35,13 @@ class OauthHandler implements IPPHandler } /** - * @param PPHttpConfig $httpConfig + * @param PayPalHttpConfig $httpConfig * @param string $request * @param mixed $options * @return mixed|void - * @throws PPConfigurationException - * @throws PPInvalidCredentialException - * @throws PPMissingCredentialException + * @throws PayPalConfigurationException + * @throws PayPalInvalidCredentialException + * @throws PayPalMissingCredentialException */ public function handle($httpConfig, $request, $options) { @@ -54,7 +53,7 @@ class OauthHandler implements IPPHandler ); $headers = array( - "User-Agent" => PPUserAgent::getValue(PPConstants::SDK_NAME, PPConstants::SDK_VERSION), + "User-Agent" => PayPalUserAgent::getValue(PayPalConstants::SDK_NAME, PayPalConstants::SDK_VERSION), "Authorization" => "Basic " . base64_encode($options['clientId'] . ":" . $options['clientSecret']), "Accept" => "*/*" ); @@ -72,8 +71,8 @@ class OauthHandler implements IPPHandler * * @param array $config * - * @return PPHttpConfig - * @throws \PayPal\Exception\PPConfigurationException + * @return PayPalHttpConfig + * @throws \PayPal\Exception\PayPalConfigurationException */ private static function _getEndpoint($config) { @@ -84,17 +83,17 @@ class OauthHandler implements IPPHandler } else if (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': - $baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT; + $baseEndpoint = PayPalConstants::REST_SANDBOX_ENDPOINT; break; case 'LIVE': - $baseEndpoint = PPConstants::REST_LIVE_ENDPOINT; + $baseEndpoint = PayPalConstants::REST_LIVE_ENDPOINT; break; default: - throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live'); + throw new PayPalConfigurationException('The mode config parameter must be set to either sandbox/live'); } } else { // Defaulting to Sandbox - $baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT; + $baseEndpoint = PayPalConstants::REST_SANDBOX_ENDPOINT; } $baseEndpoint = rtrim(trim($baseEndpoint), '/') . "/v1/oauth2/token"; diff --git a/lib/PayPal/Rest/RestHandler.php b/lib/PayPal/Handler/RestHandler.php similarity index 67% rename from lib/PayPal/Rest/RestHandler.php rename to lib/PayPal/Handler/RestHandler.php index 7d82879..80c94e4 100644 --- a/lib/PayPal/Rest/RestHandler.php +++ b/lib/PayPal/Handler/RestHandler.php @@ -3,22 +3,21 @@ * API handler for all REST API calls */ -namespace PayPal\Rest; +namespace PayPal\Handler; use PayPal\Auth\OAuthTokenCredential; -use PayPal\Common\PPUserAgent; -use PayPal\Core\PPConstants; -use PayPal\Core\PPCredentialManager; -use PayPal\Core\PPHttpConfig; -use PayPal\Exception\PPConfigurationException; -use PayPal\Exception\PPInvalidCredentialException; -use PayPal\Exception\PPMissingCredentialException; -use PayPal\Handler\IPPHandler; +use PayPal\Common\PayPalUserAgent; +use PayPal\Core\PayPalConstants; +use PayPal\Core\PayPalCredentialManager; +use PayPal\Core\PayPalHttpConfig; +use PayPal\Exception\PayPalConfigurationException; +use PayPal\Exception\PayPalInvalidCredentialException; +use PayPal\Exception\PayPalMissingCredentialException; /** * Class RestHandler */ -class RestHandler implements IPPHandler +class RestHandler implements IPayPalHandler { /** * Private Variable @@ -38,13 +37,13 @@ class RestHandler implements IPPHandler } /** - * @param PPHttpConfig $httpConfig + * @param PayPalHttpConfig $httpConfig * @param string $request * @param mixed $options * @return mixed|void - * @throws PPConfigurationException - * @throws PPInvalidCredentialException - * @throws PPMissingCredentialException + * @throws PayPalConfigurationException + * @throws PayPalInvalidCredentialException + * @throws PayPalMissingCredentialException */ public function handle($httpConfig, $request, $options) { @@ -54,18 +53,18 @@ class RestHandler implements IPPHandler if ($credential == null) { // Try picking credentials from the config file - $credMgr = PPCredentialManager::getInstance($config); + $credMgr = PayPalCredentialManager::getInstance($config); $credValues = $credMgr->getCredentialObject(); if (!is_array($credValues)) { - throw new PPMissingCredentialException("Empty or invalid credentials passed"); + throw new PayPalMissingCredentialException("Empty or invalid credentials passed"); } $credential = new OAuthTokenCredential($credValues['clientId'], $credValues['clientSecret']); } if ($credential == null || !($credential instanceof OAuthTokenCredential)) { - throw new PPInvalidCredentialException("Invalid credentials passed"); + throw new PayPalInvalidCredentialException("Invalid credentials passed"); } $httpConfig->setUrl( @@ -74,7 +73,7 @@ class RestHandler implements IPPHandler ); if (!array_key_exists("User-Agent", $httpConfig->getHeaders())) { - $httpConfig->addHeader("User-Agent", PPUserAgent::getValue(PPConstants::SDK_NAME, PPConstants::SDK_VERSION)); + $httpConfig->addHeader("User-Agent", PayPalUserAgent::getValue(PayPalConstants::SDK_NAME, PayPalConstants::SDK_VERSION)); } if (!is_null($credential) && $credential instanceof OAuthTokenCredential && is_null($httpConfig->getHeader('Authorization'))) { @@ -97,7 +96,7 @@ class RestHandler implements IPPHandler * @param array $config * * @return string - * @throws \PayPal\Exception\PPConfigurationException + * @throws \PayPal\Exception\PayPalConfigurationException */ private function _getEndpoint($config) { @@ -106,18 +105,18 @@ class RestHandler implements IPPHandler } else if (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': - return PPConstants::REST_SANDBOX_ENDPOINT; + return PayPalConstants::REST_SANDBOX_ENDPOINT; break; case 'LIVE': - return PPConstants::REST_LIVE_ENDPOINT; + return PayPalConstants::REST_LIVE_ENDPOINT; break; default: - throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live'); + throw new PayPalConfigurationException('The mode config parameter must be set to either sandbox/live'); break; } } else { // Defaulting to Sandbox - return PPConstants::REST_SANDBOX_ENDPOINT; + return PayPalConstants::REST_SANDBOX_ENDPOINT; } } } diff --git a/lib/PayPal/Rest/ApiContext.php b/lib/PayPal/Rest/ApiContext.php index 3c8a81e..b691571 100644 --- a/lib/PayPal/Rest/ApiContext.php +++ b/lib/PayPal/Rest/ApiContext.php @@ -2,8 +2,8 @@ namespace PayPal\Rest; -use PayPal\Core\PPConfigManager; -use PayPal\Core\PPCredentialManager; +use PayPal\Core\PayPalConfigManager; +use PayPal\Core\PayPalCredentialManager; /** * Class ApiContext @@ -26,7 +26,7 @@ class ApiContext /** * This is a placeholder for holding credential for the request - * If the value is not set, it would get the value from @\PayPal\Core\PPCredentialManager + * If the value is not set, it would get the value from @\PayPal\Core\PayPalCredentialManager * * @var \Paypal\Auth\OAuthTokenCredential */ @@ -53,14 +53,14 @@ class ApiContext public function getCredential() { if ($this->credential == null) { - return PPCredentialManager::getInstance()->getCredentialObject(); + return PayPalCredentialManager::getInstance()->getCredentialObject(); } return $this->credential; } public function getRequestHeaders() { - $result = PPConfigManager::getInstance()->get('http.headers'); + $result = PayPalConfigManager::getInstance()->get('http.headers'); $headers = array(); foreach ($result as $header => $value) { $headerName = ltrim($header, 'http.headers'); @@ -75,7 +75,7 @@ class ApiContext if (!(substr($name, 0, strlen('http.headers')) === 'http.headers')) { $name = 'http.headers.' . $name; } - PPConfigManager::getInstance()->addConfigs(array($name => $value)); + PayPalConfigManager::getInstance()->addConfigs(array($name => $value)); } /** @@ -112,7 +112,7 @@ class ApiContext */ public function setConfig(array $config) { - PPConfigManager::getInstance()->addConfigs($config); + PayPalConfigManager::getInstance()->addConfigs($config); } /** @@ -122,7 +122,7 @@ class ApiContext */ public function getConfig() { - return PPConfigManager::getInstance()->getConfigHashmap(); + return PayPalConfigManager::getInstance()->getConfigHashmap(); } /** @@ -133,7 +133,7 @@ class ApiContext */ public function get($searchKey) { - return PPConfigManager::getInstance()->get($searchKey); + return PayPalConfigManager::getInstance()->get($searchKey); } /** diff --git a/lib/PayPal/Transport/PPRestCall.php b/lib/PayPal/Transport/PayPalRestCall.php similarity index 75% rename from lib/PayPal/Transport/PPRestCall.php rename to lib/PayPal/Transport/PayPalRestCall.php index cf3ad8b..09db90b 100644 --- a/lib/PayPal/Transport/PPRestCall.php +++ b/lib/PayPal/Transport/PayPalRestCall.php @@ -1,24 +1,24 @@ apiContext = $apiContext; - $this->logger = PPLoggingManager::getInstance(__CLASS__); + $this->logger = PayPalLoggingManager::getInstance(__CLASS__); } /** @@ -48,13 +48,13 @@ class PPRestCall * @param string $data Request payload * @param array $headers HTTP headers * @return mixed - * @throws \PayPal\Exception\PPConnectionException + * @throws \PayPal\Exception\PayPalConnectionException */ public function execute($handlers = array(), $path, $method, $data = '', $headers = array()) { $config = $this->apiContext->getConfig(); - $httpConfig = new PPHttpConfig(null, $method); + $httpConfig = new PayPalHttpConfig(null, $method); $headers = $headers ? $headers : array(); $httpConfig->setHeaders($headers + array( @@ -62,7 +62,7 @@ class PPRestCall ) ); - /** @var \Paypal\Handler\IPPHandler $handler */ + /** @var \Paypal\Handler\IPayPalHandler $handler */ foreach ($handlers as $handler) { if (!is_object($handler)) { $fullHandler = "\\" . (string)$handler; @@ -70,7 +70,7 @@ class PPRestCall } $handler->handle($httpConfig, $data, array('path' => $path, 'apiContext' => $this->apiContext)); } - $connection = new PPHttpConnection($httpConfig, $config); + $connection = new PayPalHttpConnection($httpConfig, $config); $response = $connection->execute($data); return $response; diff --git a/lib/PayPal/Validation/ModelAccessorValidator.php b/lib/PayPal/Validation/ModelAccessorValidator.php index b0b73be..15f9fe3 100644 --- a/lib/PayPal/Validation/ModelAccessorValidator.php +++ b/lib/PayPal/Validation/ModelAccessorValidator.php @@ -2,9 +2,9 @@ namespace PayPal\Validation; -use PayPal\Common\PPModel; -use PayPal\Core\PPConfigManager; -use PayPal\Core\PPLoggingManager; +use PayPal\Common\PayPalModel; +use PayPal\Core\PayPalConfigManager; +use PayPal\Core\PayPalLoggingManager; /** * Class ModelAccessorValidator @@ -16,18 +16,18 @@ class ModelAccessorValidator /** * Helper method for validating if the class contains accessor methods (getter and setter) for a given attribute * - * @param PPModel $class An object of PPModel + * @param PayPalModel $class An object of PayPalModel * @param string $attributeName Attribute name * @return bool */ - public static function validate(PPModel $class, $attributeName) + public static function validate(PayPalModel $class, $attributeName) { - $mode = PPConfigManager::getInstance()->get('validation.level'); + $mode = PayPalConfigManager::getInstance()->get('validation.level'); if ($mode != 'disabled') { //If the mode is disabled, bypass the validation foreach (array('set' . $attributeName, 'get' . $attributeName) as $methodName) { - if (get_class($class) == get_class(new PPModel())) { - // Silently return false on cases where you are using PPModel instance directly + if (get_class($class) == get_class(new PayPalModel())) { + // Silently return false on cases where you are using PayPalModel instance directly return false; } //Check if both getter and setter exists for given attribute @@ -35,7 +35,7 @@ class ModelAccessorValidator //Delegate the error based on the choice $className = is_object($class) ? get_class($class) : (string)$class; $errorMessage = "Missing Accessor: $className:$methodName. Please let us know by creating an issue at https://github.com/paypal/PayPal-PHP-SDK/issues"; - PPLoggingManager::getInstance(__CLASS__)->warning($errorMessage); + PayPalLoggingManager::getInstance(__CLASS__)->warning($errorMessage); if ($mode == 'strict') { trigger_error($errorMessage, E_USER_NOTICE); } diff --git a/release_notes.md b/release_notes.md index 7b88e49..b110911 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,46 @@ PayPal PHP SDK release notes ============================ +v1.0.0 +---- +* Enabled Payouts API Support +* Authorization Cache Custom Path Directory Configuration +* Helper Functions to retrieve specific HATEOS Links +* Default Mode set to Sandbox +* Enabled Rest SDK to work nicely with Classic SDKs. +* If missing annotation of return type in Getters, it throws a proper exception + +> ## Breaking Changes +* Removed Deprecated Getter Setters from all Model Classes + * All Camelcase getters and setters are removed. Please use first letter uppercase syntax + * E.g. instead of using get_notify_url(), use getNotifyUrl() instead +* Renamed Classes + * PayPal\Common\PPModel => PayPal\Common\PayPalModel + * PayPal\Common\ResourceModel => PayPal\Common\PayPalResourceModel + * PayPal\Common\PPUserAgent => PayPal\Common\PayPalUserAgent + * PayPal\Core\PPConfigManager => PayPal\Core\PayPalConfigManager + * PayPal\Core\PPConstants => PayPal\Core\PayPalConstants + * PayPal\Core\PPCredentialManager => PayPal\Core\PayPalCredentialManager + * PayPal\Core\PPHttpConfig => PayPal\Core\PayPalHttpConfig + * PayPal\Core\PPHttpConnection => PayPal\Core\PayPalHttpConnection + * PayPal\Core\PPLoggingLevel => PayPal\Core\PayPalLoggingLevel + * PayPal\Core\PPLoggingManager => PayPal\Core\PayPalLoggingManager + * PayPal\Exception\PPConfigurationException => PayPal\Exception\PayPalConfigurationException + * PayPal\Exception\PPConnectionException => PayPal\Exception\PayPalConnectionException + * PayPal\Exception\PPInvalidCredentialException => PayPal\Exception\PayPalInvalidCredentialException + * PayPal\Exception\PPMissingCredentialException => PayPal\Exception\PayPalMissingCredentialException + * PayPal\Handler\IPPHandler => PayPal\Handler\IPayPalHandler + * PayPal\Transport\PPRestCall => PayPal\Transport\PayPalRestCall +* Namespace Changes and Class Naming Convention + * PayPal\Common\FormatConverter => PayPal\Converter\FormatConverter + * PayPal\Rest\RestHandler => PayPal\Handler\RestHandler + * PayPal\Rest\OauthHandler => PayPal\Handler\OauthHandler + +v1.0.0-beta +---- +* Namespace Changes and Class Naming Convention +* Helper Functions to retrieve specific HATEOS Links +* Default Mode set to Sandbox + v0.16.1 ---- * Configurable Headers for all requests to PayPal diff --git a/sample/billing/CreateBillingAgreementWithPayPal.php b/sample/billing/CreateBillingAgreementWithPayPal.php index 6119d2e..7eb6f58 100644 --- a/sample/billing/CreateBillingAgreementWithPayPal.php +++ b/sample/billing/CreateBillingAgreementWithPayPal.php @@ -71,14 +71,9 @@ try { // ### Get redirect url // The API response provides the url that you must redirect - // the buyer to. Retrieve the url from the $agreement->getLinks() + // the buyer to. Retrieve the url from the $agreement->getApprovalLink() // method - foreach ($agreement->getLinks() as $link) { - if ($link->getRel() == 'approval_url') { - $approvalUrl = $link->getHref(); - break; - } - } +$approvalUrl = $agreement->getApprovalLink(); } catch (Exception $ex) { ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex); diff --git a/sample/billing/UpdatePlan.php b/sample/billing/UpdatePlan.php index 90712db..96e2692 100644 --- a/sample/billing/UpdatePlan.php +++ b/sample/billing/UpdatePlan.php @@ -16,11 +16,11 @@ $createdPlan = require 'CreatePlan.php'; use PayPal\Api\Plan; use PayPal\Api\PatchRequest; use PayPal\Api\Patch; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; try { $patch = new Patch(); - $value = new PPModel('{ + $value = new PayPalModel('{ "state":"ACTIVE" }'); diff --git a/sample/common.php b/sample/common.php index 09ccb36..ece651c 100644 --- a/sample/common.php +++ b/sample/common.php @@ -122,7 +122,7 @@ class ResultPrinter public static function printError($title, $objectName, $objectId = null, $request = null, $exception = null) { $data = null; - if ($exception instanceof \PayPal\Exception\PPConnectionException) { + if ($exception instanceof \PayPal\Exception\PayPalConnectionException) { $data = $exception->getData(); } self::printOutput($title, $objectName, $objectId, $request, $data, $exception->getMessage()); @@ -134,8 +134,8 @@ class ResultPrinter echo 'ERROR:'. $error; } if ($object) { - if (is_a($object, 'PayPal\Common\PPModel')) { - /** @var $object \PayPal\Common\PPModel */ + if (is_a($object, 'PayPal\Common\PayPalModel')) { + /** @var $object \PayPal\Common\PayPalModel */ echo $object->toJSON(128); } elseif (is_string($object) && \PayPal\Validation\JsonValidator::validate($object, true)) { echo str_replace('\\/', '/', json_encode(json_decode($object), 128)); @@ -157,8 +157,8 @@ class ResultPrinter '

'; } if ($object) { - if (is_a($object, 'PayPal\Common\PPModel')) { - /** @var $object \PayPal\Common\PPModel */ + if (is_a($object, 'PayPal\Common\PayPalModel')) { + /** @var $object \PayPal\Common\PayPalModel */ echo '
' . $object->toJSON(128) . "
"; } elseif (is_string($object) && \PayPal\Validation\JsonValidator::validate($object, true)) { echo '
'. str_replace('\\/', '/', json_encode(json_decode($object), 128)) . "
"; diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index fbc2bdb..041815d 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -1243,73 +1243,6 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "depth": 1, "children": [ { - "type": "file", - "data": { - "language": { - "nameMatchers": [{}, ".fbp"], - "pygmentsLexer": "php", - "singleLineComment": ["//"], - "ignorePrefix": "}", - "foldPrefix": "^", - "name": "PHP" - }, - "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/notifications/CreateWebhook.php", - "projectPath": "notifications/CreateWebhook.php", - "targetPath": "notifications/CreateWebhook", - "pageTitle": "notifications/CreateWebhook", - "title": "CreateWebhook" - }, - "depth": 2, - "outline": [ - { - "type": "heading", - "data": { - "level": 1, - "title": "Create Webhook Sample", - "slug": "create-webhook-sample" - }, - "depth": 1 - }, { - "type": "heading", - "data": { - "level": 1, - "title": "Basic Information", - "slug": "basic-information" - }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 4, - "title": "NOTE: Please note that you need an https url for paypal webhooks. You can however override the url with https, and accept", - "slug": "note-please-note-that-you-need-an-https-url-for-paypal-webhooks-you-can-however-override-the-url-with-https-and-accept" - }, - "depth": 4 - } - ] - }, { - "type": "heading", - "data": { - "level": 1, - "title": "Event Types", - "slug": "event-types" - }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 3, - "title": "Create Webhook", - "slug": "create-webhook" - }, - "depth": 3 - } - ] - } - ] - }, { "type": "file", "data": { "language": { @@ -1714,6 +1647,73 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/notifications/createWebhook.php", + "projectPath": "notifications/createWebhook.php", + "targetPath": "notifications/createWebhook", + "pageTitle": "notifications/createWebhook", + "title": "createWebhook" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Create Webhook Sample", + "slug": "create-webhook-sample" + }, + "depth": 1 + }, { + "type": "heading", + "data": { + "level": 1, + "title": "Basic Information", + "slug": "basic-information" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 4, + "title": "NOTE: Please note that you need an https url for paypal webhooks. You can however override the url with https, and accept", + "slug": "note-please-note-that-you-need-an-https-url-for-paypal-webhooks-you-can-however-override-the-url-with-https-and-accept" + }, + "depth": 4 + } + ] + }, { + "type": "heading", + "data": { + "level": 1, + "title": "Event Types", + "slug": "event-types" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Create Webhook", + "slug": "create-webhook" + }, + "depth": 3 + } + ] + } + ] } ] }, { @@ -2924,6 +2924,268 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "folder", + "data": { + "path": "payouts", + "title": "payouts" + }, + "depth": 1, + "children": [ + { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/payouts/CreateBatchPayout.php", + "projectPath": "payouts/CreateBatchPayout.php", + "targetPath": "payouts/CreateBatchPayout", + "pageTitle": "payouts/CreateBatchPayout", + "title": "CreateBatchPayout" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Create Bulk Payout Sample", + "slug": "create-bulk-payout-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "NOTE:", + "slug": "note" + }, + "depth": 3, + "children": [ + { + "type": "heading", + "data": { + "level": 4, + "title": "Batch Header Instance", + "slug": "batch-header-instance" + }, + "depth": 4 + }, { + "type": "heading", + "data": { + "level": 4, + "title": "Sender Item", + "slug": "sender-item" + }, + "depth": 4 + }, { + "type": "heading", + "data": { + "level": 4, + "title": "Sender Item 2", + "slug": "sender-item-2" + }, + "depth": 4 + }, { + "type": "heading", + "data": { + "level": 4, + "title": "Sender Item 3", + "slug": "sender-item-3" + }, + "depth": 4 + } + ] + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Payout", + "slug": "create-payout" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/payouts/CreateSinglePayout.php", + "projectPath": "payouts/CreateSinglePayout.php", + "targetPath": "payouts/CreateSinglePayout", + "pageTitle": "payouts/CreateSinglePayout", + "title": "CreateSinglePayout" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Create Single Synchronous Payout Sample", + "slug": "create-single-synchronous-payout-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "NOTE:", + "slug": "note" + }, + "depth": 3, + "children": [ + { + "type": "heading", + "data": { + "level": 4, + "title": "Batch Header Instance", + "slug": "batch-header-instance" + }, + "depth": 4 + }, { + "type": "heading", + "data": { + "level": 4, + "title": "Sender Item", + "slug": "sender-item" + }, + "depth": 4 + } + ] + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Payout", + "slug": "create-payout" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutBatchStatus.php", + "projectPath": "payouts/GetPayoutBatchStatus.php", + "targetPath": "payouts/GetPayoutBatchStatus", + "pageTitle": "payouts/GetPayoutBatchStatus", + "title": "GetPayoutBatchStatus" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Payout Batch Status Sample", + "slug": "get-payout-batch-status-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Payout Batch ID", + "slug": "payout-batch-id" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get Payout Batch Status", + "slug": "get-payout-batch-status" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutItemStatus.php", + "projectPath": "payouts/GetPayoutItemStatus.php", + "targetPath": "payouts/GetPayoutItemStatus", + "pageTitle": "payouts/GetPayoutItemStatus", + "title": "GetPayoutItemStatus" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Payout Item Status Sample", + "slug": "get-payout-item-status-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Payout Item ID", + "slug": "payout-item-id" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get Payout Item Status", + "slug": "get-payout-item-status" + }, + "depth": 3 + } + ] + } + ] + } + ] + } + ] }, { "type": "folder", "data": { diff --git a/sample/doc/billing/CreateBillingAgreementWithPayPal.html b/sample/doc/billing/CreateBillingAgreementWithPayPal.html index 765aadd..1e07903 100644 --- a/sample/doc/billing/CreateBillingAgreementWithPayPal.html +++ b/sample/doc/billing/CreateBillingAgreementWithPayPal.html @@ -46,13 +46,8 @@ Please note that the plan Id should be only set in this case.

'US'); $agreement->setShippingAddress($shippingAddress);

For Sample Purposes Only.

$request = clone $agreement;

Create Agreement

try {

Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.

$agreement = $agreement->create($apiContext);

Get redirect url

The API response provides the url that you must redirect -the buyer to. Retrieve the url from the $agreement->getLinks() -method

foreach ($agreement->getLinks() as $link) { - if ($link->getRel() == 'approval_url') { - $approvalUrl = $link->getHref(); - break; - } - } +the buyer to. Retrieve the url from the $agreement->getApprovalLink() +method

$approvalUrl = $agreement->getApprovalLink(); } catch (Exception $ex) { ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex); diff --git a/sample/doc/billing/UpdatePlan.html b/sample/doc/billing/UpdatePlan.html index 6158cfc..1dc562b 100644 --- a/sample/doc/billing/UpdatePlan.html +++ b/sample/doc/billing/UpdatePlan.html @@ -8,11 +8,11 @@ API used: /v1/payments/billing-plans/

use PayPal\Api\Plan; use PayPal\Api\PatchRequest; use PayPal\Api\Patch; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; try { $patch = new Patch(); - $value = new PPModel('{ + $value = new PayPalModel('{ "state":"ACTIVE" }'); diff --git a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html index 044cadb..0c38229 100644 --- a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html +++ b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html @@ -1,9 +1,9 @@ lipp/GenerateAccessTokenFromRefreshToken
lipp/GenerateAccessTokenFromRefreshToken.php
<?php

Obtain Access Token From Refresh Token

require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdTokeninfo;

You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token

$refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE'; +use PayPal\Api\OpenIdTokeninfo;

You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token

$refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE'; try { - $tokenInfo = new PPOpenIdTokeninfo(); + $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); } catch (Exception $ex) { diff --git a/sample/doc/lipp/GetUserInfo.html b/sample/doc/lipp/GetUserInfo.html index e82ce70..832ceec 100644 --- a/sample/doc/lipp/GetUserInfo.html +++ b/sample/doc/lipp/GetUserInfo.html @@ -1,7 +1,7 @@ lipp/GetUserInfo
lipp/GetUserInfo.php
<?php

Obtain Access Token From Refresh Token

require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdUserinfo; -use PayPal\Auth\Openid\PPOpenIdTokeninfo;

To obtain User Info, you have to follow three steps in general. +use PayPal\Api\OpenIdUserinfo; +use PayPal\Api\OpenIdTokeninfo;

To obtain User Info, you have to follow three steps in general. First, you need to obtain user's consent to retrieve the information you want. This is explained in the example "ObtainUserConsent.php".

Once you get the user's consent, the end result would be long lived refresh token. This refresh token should be stored in a permanent storage for later use.

Lastly, when you need to retrieve the user information, you need to generate the short lived access token @@ -10,11 +10,11 @@ to retreive the information. The short lived access token can be retrieved using try { - $tokenInfo = new PPOpenIdTokeninfo(); + $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); $params = array('access_token' => $tokenInfo->getAccessToken()); - $userInfo = PPOpenIdUserinfo::getUserinfo($params, $apiContext); + $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); } catch (Exception $ex) { ResultPrinter::printError("User Information", "User Info", null, $params, $ex); diff --git a/sample/doc/lipp/ObtainUserConsent.html b/sample/doc/lipp/ObtainUserConsent.html index 41a31b9..494f607 100644 --- a/sample/doc/lipp/ObtainUserConsent.html +++ b/sample/doc/lipp/ObtainUserConsent.html @@ -2,11 +2,11 @@ require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdSession; +use PayPal\Api\OpenIdSession; $baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true';

The clientId is stored in the bootstrap file

//Get Authorization URL returns the redirect URL that could be used to get user's consent -$redirectUrl = PPOpenIdSession::getAuthorizationUrl( +$redirectUrl = OpenIdSession::getAuthorizationUrl( $baseUrl, array('profile', 'email', 'phone'), null, diff --git a/sample/doc/lipp/UserConsentRedirect.html b/sample/doc/lipp/UserConsentRedirect.html index 5923243..3029533 100644 --- a/sample/doc/lipp/UserConsentRedirect.html +++ b/sample/doc/lipp/UserConsentRedirect.html @@ -2,8 +2,8 @@ require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdTokeninfo; -use PayPal\Exception\PPConnectionException; +use PayPal\Api\OpenIdTokeninfo; +use PayPal\Exception\PayPalConnectionException; session_start();

PayPal would redirect the user to the redirect_uri mentioned when creating the consent URL. @@ -11,8 +11,8 @@ The user would then able to retrieve the access token by getting the code, which $code = $_GET['code']; - try {

Obtain Authorization Code from Code, Client ID and Client Secret

$accessToken = PPOpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); - } catch (PPConnectionException $ex) { + try {

Obtain Authorization Code from Code, Client ID and Client Secret

$accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); + } catch (PayPalConnectionException $ex) { ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); exit(1); } diff --git a/sample/doc/notifications/createWebhook.html b/sample/doc/notifications/createWebhook.html index 0199839..059a74d 100644 --- a/sample/doc/notifications/createWebhook.html +++ b/sample/doc/notifications/createWebhook.html @@ -1,4 +1,4 @@ -notifications/CreateWebhook
notifications/CreateWebhook.php
<?php

Create Webhook Sample

+notifications/createWebhook
notifications/createWebhook.php
<?php

Create Webhook Sample

This sample code demonstrate how you can create a webhook, as documented here at: https://developer.paypal.com/webapps/developer/docs/api/#create-a-webhook API used: POST /v1/notifications/webhooks

require __DIR__ . '/../bootstrap.php';

Create a new instance of Webhook object

$webhook = new \PayPal\Api\Webhook();

Basic Information

@@ -33,7 +33,7 @@ be using this in production

$webhook->setEventTypes($webhookEventTypes);

For Sample Purposes Only.

$request = clone $webhook;

Create Webhook

try { $output = $webhook->create($apiContext); } catch (Exception $ex) {
// Ignore workflow code segment
// Ignore workflow code segment - if ($ex instanceof \PayPal\Exception\PPConnectionException) { + if ($ex instanceof \PayPal\Exception\PayPalConnectionException) { $data = $ex->getData(); ResultPrinter::printError("Created Webhook Failed. Checking if it is Webhook Number Limit Exceeded. Trying to delete all existing webhooks", "Webhook", "Please Use <a style='color: red;' href='DeleteAllWebhooks.php' >Delete All Webhooks</a> Sample to delete all existing webhooks in sample", $request, $ex); if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { diff --git a/sample/doc/payment-experience/CreateWebProfile.html b/sample/doc/payment-experience/CreateWebProfile.html index 50fe53c..8f1926c 100644 --- a/sample/doc/payment-experience/CreateWebProfile.html +++ b/sample/doc/payment-experience/CreateWebProfile.html @@ -6,7 +6,7 @@ Documentation available at
$flowConfig = new \PayPal\Api\FlowConfig();
$approvalUrl = $payment->getApprovalLink(); ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); diff --git a/sample/doc/payouts/CreateBatchPayout.html b/sample/doc/payouts/CreateBatchPayout.html new file mode 100644 index 0000000..0762272 --- /dev/null +++ b/sample/doc/payouts/CreateBatchPayout.html @@ -0,0 +1,93 @@ +payouts/CreateBatchPayout
payouts/CreateBatchPayout.php
<?php

Create a new instance of Payout object

$payouts = new \PayPal\Api\Payout();

This is how our body should look like:

/* + *{ + "sender_batch_header": { + "sender_batch_id": "random_uniq_id", + "email_subject": "You have a payment" + }, + "items": [ + { + "recipient_type": "EMAIL", + "amount": { + "value": 0.99, + "currency": "USD" + }, + "receiver": "shirt-supplier-one@mail.com", + "note": "Thank you.", + "sender_item_id": "item_1" + }, + { + "recipient_type": "EMAIL", + "amount": { + "value": 0.90, + "currency": "USD" + }, + "receiver": "shirt-supplier-two@mail.com", + "note": "Thank you.", + "sender_item_id": "item_2" + }, + { + "recipient_type": "EMAIL", + "amount": { + "value": 2.00, + "currency": "USD" + }, + "receiver": "shirt-supplier-three@mail.com", + "note": "Thank you.", + "sender_item_id": "item_3" + } + ] +} + */ + +$senderBatchHeader = new \PayPal\Api\PayoutSenderBatchHeader();

NOTE:

+

You can prevent duplicate batches from being processed. If you specify a sender_batch_id that was used in the last 30 days, the batch will not be processed. For items, you can specify a sender_item_id. If the value for the sender_item_id is a duplicate of a payout item that was processed in the last 30 days, the item will not be processed.

Batch Header Instance

$senderBatchHeader->setSenderBatchId(uniqid()) + ->setEmailSubject("You have a payment");

Sender Item

+

Please note that if you are using single payout with sync mode, you can only pass one Item in the request

$senderItem1 = new \PayPal\Api\PayoutItem(); +$senderItem1->setRecipientType('Email') + ->setNote('Thanks you.') + ->setReceiver('shirt-supplier-one@gmail.com') + ->setSenderItemId("item_1" . uniqid()) + ->setAmount(new \PayPal\Api\Currency('{ + "value":"0.99", + "currency":"USD" + }'));

Sender Item 2

+

There are many different ways of assigning values in PayPal SDK. Here is another way where you could directly inject json string.

$senderItem2 = new \PayPal\Api\PayoutItem( + '{ + "recipient_type": "EMAIL", + "amount": { + "value": 0.90, + "currency": "USD" + }, + "receiver": "shirt-supplier-two@mail.com", + "note": "Thank you.", + "sender_item_id": "item_2" + }' +);

Sender Item 3

+

One more way of assigning values in constructor when creating instance of PayPalModel object. Injecting array.

$senderItem3 = new \PayPal\Api\PayoutItem( + array( + "recipient_type" => "EMAIL", + "receiver" => "shirt-supplier-three@mail.com", + "note" => "Thank you.", + "sender_item_id" => uniqid(), + "amount" => array( + "value" => "0.90", + "currency" => "USD" + ) + + ) +); + +$payouts->setSenderBatchHeader($senderBatchHeader) + ->addItem($senderItem1)->addItem($senderItem2)->addItem($senderItem3);

For Sample Purposes Only.

$request = clone $payouts;

Create Payout

try { + $output = $payouts->create(null, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); + exit(1); +} + +ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); + +return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/CreateSinglePayout.html b/sample/doc/payouts/CreateSinglePayout.html new file mode 100644 index 0000000..90764ae --- /dev/null +++ b/sample/doc/payouts/CreateSinglePayout.html @@ -0,0 +1,48 @@ +payouts/CreateSinglePayout
payouts/CreateSinglePayout.php
<?php

Create Single Synchronous Payout Sample

+

This sample code demonstrate how you can create a synchronous payout sample, as documented here at: +https://developer.paypal.com/docs/integration/direct/create-single-payout/ +API used: /v1/payments/payouts?sync_mode=true

require __DIR__ . '/../bootstrap.php';

Create a new instance of Payout object

$payouts = new \PayPal\Api\Payout();

This is how our body should look like:

/* + * { + "sender_batch_header":{ + "sender_batch_id":"2014021801", + "email_subject":"You have a Payout!" + }, + "items":[ + { + "recipient_type":"EMAIL", + "amount":{ + "value":"1.0", + "currency":"USD" + }, + "note":"Thanks for your patronage!", + "sender_item_id":"2014031400023", + "receiver":"shirt-supplier-one@mail.com" + } + ] + } + */ + +$senderBatchHeader = new \PayPal\Api\PayoutSenderBatchHeader();

NOTE:

+

You can prevent duplicate batches from being processed. If you specify a sender_batch_id that was used in the last 30 days, the batch will not be processed. For items, you can specify a sender_item_id. If the value for the sender_item_id is a duplicate of a payout item that was processed in the last 30 days, the item will not be processed.

Batch Header Instance

$senderBatchHeader->setSenderBatchId(uniqid()) + ->setEmailSubject("You have a Payout!");

Sender Item

+

Please note that if you are using single payout with sync mode, you can only pass one Item in the request

$senderItem = new \PayPal\Api\PayoutItem(); +$senderItem->setRecipientType('Email') + ->setNote('Thanks for your patronage!') + ->setReceiver('shirt-supplier-one@gmail.com') + ->setSenderItemId("2014031400023") + ->setAmount(new \PayPal\Api\Currency('{ + "value":"1.0", + "currency":"USD" + }')); + +$payouts->setSenderBatchHeader($senderBatchHeader) + ->addItem($senderItem);

For Sample Purposes Only.

$request = clone $payouts;

Create Payout

try { + $output = $payouts->createSynchronous($apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex); + exit(1); +} + +ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); + +return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/GetPayoutBatchStatus.html b/sample/doc/payouts/GetPayoutBatchStatus.html new file mode 100644 index 0000000..570477e --- /dev/null +++ b/sample/doc/payouts/GetPayoutBatchStatus.html @@ -0,0 +1,15 @@ +payouts/GetPayoutBatchStatus
payouts/GetPayoutBatchStatus.php
<?php

Get Payout Batch Status Sample

+

This sample code demonstrate how you can get the batch payout status of a created batch payout, as documented here at: +https://developer.paypal.com/docs/api/#get-the-status-of-a-batch-payout +API used: GET /v1/payments/payouts/

/** @var \PayPal\Api\PayoutBatch $payoutBatch */ +$payoutBatch = require 'CreateBatchPayout.php';

Payout Batch ID

+

You can replace this with your Payout Batch Id on already created Payout.

$payoutBatchId = $payoutBatch->getBatchHeader()->getPayoutBatchId();

Get Payout Batch Status

try { + $output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); + +return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/GetPayoutItemStatus.html b/sample/doc/payouts/GetPayoutItemStatus.html new file mode 100644 index 0000000..3ae0f0a --- /dev/null +++ b/sample/doc/payouts/GetPayoutItemStatus.html @@ -0,0 +1,16 @@ +payouts/GetPayoutItemStatus
payouts/GetPayoutItemStatus.php
<?php

Get Payout Item Status Sample

+

Use this call to get data about a payout item, including the status, without retrieving an entire batch. You can get the status of an individual payout item in a batch in order to review the current status of a previously-unclaimed, or pending, payout item. +https://developer.paypal.com/docs/api/#get-the-status-of-a-payout-item +API used: GET /v1/payments/payouts-item/

/** @var \PayPal\Api\PayoutBatch $payoutBatch */ +$payoutBatch = require 'GetPayoutBatchStatus.php';

Payout Item ID

+

You can replace this with your Payout Batch Id on already created Payout.

$payoutItem = $payoutBatch->getItems()[0]; +$payoutItemId = $payoutItem->getPayoutItemId();

Get Payout Item Status

try { + $output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); + +return $output;
\ No newline at end of file diff --git a/sample/index.php b/sample/index.php index be1ecf3..bacf6ad 100644 --- a/sample/index.php +++ b/sample/index.php @@ -26,1109 +26,1165 @@ if (PHP_SAPI == 'cli') { } } ?> --> - - - - - - - - - + + + + + + + + + - PayPal REST API Samples + PayPal REST API Samples - - - - - - + body { + /* Margin bottom by footer height */ + margin-bottom: 60px; + } - - -
-
-
-
- -
-
-

REST API Samples

+ .footer { + position: absolute; + bottom: 0; + width: 100%; + min-height: 60px; + background: -webkit-linear-gradient(-9deg, #428bca 70%, white 25%); + } -

These examples are created to experiment with the PayPal-PHP-SDK capabilities. Each examples - are - designed to demonstrate the default use-cases in each segment. - Many examples should be executable, and should allow you to experience the default behavior - of our - sdk, to expedite your integration experience.

+ .footer-links, .footer-links li { + display: inline-block; + font-size: 110%; + padding-left: 0px; + padding-right: 0px; + } - + .fixed { + position: fixed; + } + + .nav a { + font-weight: bold; + } + + + + + + + + +
+
+
+
+ +
+
+

REST API Samples

+ +

These examples are created to experiment with the PayPal-PHP-SDK capabilities. Each examples + are + designed to demonstrate the default use-cases in each segment. + Many examples should be executable, and should allow you to experience the default behavior + of our + sdk, to expedite your integration experience.

+ +
-
+
+
-
- -
-
-
-

Payments

-
- - +
+ +
+
+

Payouts

+
+ + +
+ +
+ + + +
+ +
+
+

Sale

+
+ + +
+ +
+ + + +
+ +
+
+

Vault

+
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+
+

Invoice

+
+ + +
+ +
+ + +
- - - - - - +
+
+ +
+
+ +
+
+ + + + + + + + + diff --git a/sample/invoice/images/sample.png b/sample/invoice/images/sample.png index 2192f3e..4d0799e 100644 Binary files a/sample/invoice/images/sample.png and b/sample/invoice/images/sample.png differ diff --git a/sample/lipp/GenerateAccessTokenFromRefreshToken.php b/sample/lipp/GenerateAccessTokenFromRefreshToken.php index 711df11..2ee0100 100644 --- a/sample/lipp/GenerateAccessTokenFromRefreshToken.php +++ b/sample/lipp/GenerateAccessTokenFromRefreshToken.php @@ -3,14 +3,14 @@ // ### Obtain Access Token From Refresh Token require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdTokeninfo; +use PayPal\Api\OpenIdTokeninfo; // You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token $refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE'; try { - $tokenInfo = new PPOpenIdTokeninfo(); + $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); } catch (Exception $ex) { diff --git a/sample/lipp/GetUserInfo.php b/sample/lipp/GetUserInfo.php index 45911ff..4e7140d 100644 --- a/sample/lipp/GetUserInfo.php +++ b/sample/lipp/GetUserInfo.php @@ -3,8 +3,8 @@ // ### Obtain Access Token From Refresh Token require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdUserinfo; -use PayPal\Auth\Openid\PPOpenIdTokeninfo; +use PayPal\Api\OpenIdUserinfo; +use PayPal\Api\OpenIdTokeninfo; // To obtain User Info, you have to follow three steps in general. // First, you need to obtain user's consent to retrieve the information you want. @@ -22,11 +22,11 @@ $refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0b try { - $tokenInfo = new PPOpenIdTokeninfo(); + $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); $params = array('access_token' => $tokenInfo->getAccessToken()); - $userInfo = PPOpenIdUserinfo::getUserinfo($params, $apiContext); + $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); } catch (Exception $ex) { ResultPrinter::printError("User Information", "User Info", null, $params, $ex); diff --git a/sample/lipp/ObtainUserConsent.php b/sample/lipp/ObtainUserConsent.php index f677e17..a6387c4 100644 --- a/sample/lipp/ObtainUserConsent.php +++ b/sample/lipp/ObtainUserConsent.php @@ -2,7 +2,7 @@ require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdSession; +use PayPal\Api\OpenIdSession; $baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true'; @@ -10,7 +10,7 @@ $baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true'; // The clientId is stored in the bootstrap file //Get Authorization URL returns the redirect URL that could be used to get user's consent -$redirectUrl = PPOpenIdSession::getAuthorizationUrl( +$redirectUrl = OpenIdSession::getAuthorizationUrl( $baseUrl, array('profile', 'email', 'phone'), null, diff --git a/sample/lipp/UserConsentRedirect.php b/sample/lipp/UserConsentRedirect.php index 8ff487f..c97768f 100644 --- a/sample/lipp/UserConsentRedirect.php +++ b/sample/lipp/UserConsentRedirect.php @@ -2,8 +2,8 @@ require __DIR__ . '/../bootstrap.php'; -use PayPal\Auth\Openid\PPOpenIdTokeninfo; -use PayPal\Exception\PPConnectionException; +use PayPal\Api\OpenIdTokeninfo; +use PayPal\Exception\PayPalConnectionException; session_start(); @@ -16,8 +16,8 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { try { // Obtain Authorization Code from Code, Client ID and Client Secret - $accessToken = PPOpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); - } catch (PPConnectionException $ex) { + $accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); + } catch (PayPalConnectionException $ex) { ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); exit(1); } diff --git a/sample/notifications/createWebhook.php b/sample/notifications/createWebhook.php index af87d4c..b747e20 100644 --- a/sample/notifications/createWebhook.php +++ b/sample/notifications/createWebhook.php @@ -54,7 +54,7 @@ try { $output = $webhook->create($apiContext); } catch (Exception $ex) { // ^ Ignore workflow code segment - if ($ex instanceof \PayPal\Exception\PPConnectionException) { + if ($ex instanceof \PayPal\Exception\PayPalConnectionException) { $data = $ex->getData(); ResultPrinter::printError("Created Webhook Failed. Checking if it is Webhook Number Limit Exceeded. Trying to delete all existing webhooks", "Webhook", "Please Use Delete All Webhooks Sample to delete all existing webhooks in sample", $request, $ex); if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { diff --git a/sample/payment-experience/CreateWebProfile.php b/sample/payment-experience/CreateWebProfile.php index c2c769b..1b89adf 100644 --- a/sample/payment-experience/CreateWebProfile.php +++ b/sample/payment-experience/CreateWebProfile.php @@ -51,7 +51,7 @@ $request = clone $webProfile; try { // Use this call to create a profile. $createProfileResponse = $webProfile->create($apiContext); -} catch (\PayPal\Exception\PPConnectionException $ex) { +} catch (\PayPal\Exception\PayPalConnectionException $ex) { ResultPrinter::printError("Created Web Profile", "Web Profile", null, $request, $ex); exit(1); } diff --git a/sample/payment-experience/DeleteWebProfile.php b/sample/payment-experience/DeleteWebProfile.php index f1a3753..37b6a9e 100644 --- a/sample/payment-experience/DeleteWebProfile.php +++ b/sample/payment-experience/DeleteWebProfile.php @@ -18,7 +18,7 @@ $webProfile->setId($createProfileResponse->getId()); try { // Execute the delete method $webProfile->delete($apiContext); -} catch (\PayPal\Exception\PPConnectionException $ex) { +} catch (\PayPal\Exception\PayPalConnectionException $ex) { ResultPrinter::printError("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, $ex); exit(1); } diff --git a/sample/payment-experience/GetWebProfile.php b/sample/payment-experience/GetWebProfile.php index 23e9f07..4e1db6c 100644 --- a/sample/payment-experience/GetWebProfile.php +++ b/sample/payment-experience/GetWebProfile.php @@ -14,7 +14,7 @@ $createProfileResponse = require 'CreateWebProfile.php'; try { // If your request is successful, the API returns a web_profile object response that contains the profile details. $webProfile = \PayPal\Api\WebProfile::get($createProfileResponse->getId(), $apiContext); -} catch (\PayPal\Exception\PPConnectionException $ex) { +} catch (\PayPal\Exception\PayPalConnectionException $ex) { ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $ex); exit(1); } diff --git a/sample/payment-experience/ListWebProfiles.php b/sample/payment-experience/ListWebProfiles.php index eaaa96e..5f84198 100644 --- a/sample/payment-experience/ListWebProfiles.php +++ b/sample/payment-experience/ListWebProfiles.php @@ -10,7 +10,7 @@ $apiContext = require __DIR__ . '/../bootstrap.php'; // (See bootstrap.php for more on `ApiContext`) try { $list = \PayPal\Api\WebProfile::get_list($apiContext); -} catch (\PayPal\Exception\PPConnectionException $ex) { +} catch (\PayPal\Exception\PayPalConnectionException $ex) { ResultPrinter::printError("Get List of All Web Profiles", "Web Profiles", null, null, $ex); exit(1); } diff --git a/sample/payments/AuthorizePaymentUsingPayPal.php b/sample/payments/AuthorizePaymentUsingPayPal.php index 3c5f2c3..ceb91ad 100644 --- a/sample/payments/AuthorizePaymentUsingPayPal.php +++ b/sample/payments/AuthorizePaymentUsingPayPal.php @@ -108,12 +108,7 @@ try { // The API response provides the url that you must redirect // the buyer to. Retrieve the url from the $payment->getLinks() // method -foreach ($payment->getLinks() as $link) { - if ($link->getRel() == 'approval_url') { - $approvalUrl = $link->getHref(); - break; - } -} +$approvalUrl = $payment->getApprovalLink(); ResultPrinter::printResult("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", "$approvalUrl", $request, $payment); diff --git a/sample/payments/CreatePaymentUsingPayPal.php b/sample/payments/CreatePaymentUsingPayPal.php index 029f61b..0af37d5 100644 --- a/sample/payments/CreatePaymentUsingPayPal.php +++ b/sample/payments/CreatePaymentUsingPayPal.php @@ -104,14 +104,9 @@ try { // ### Get redirect url // The API response provides the url that you must redirect -// the buyer to. Retrieve the url from the $payment->getLinks() +// the buyer to. Retrieve the url from the $payment->getApprovalLink() // method -foreach ($payment->getLinks() as $link) { - if ($link->getRel() == 'approval_url') { - $approvalUrl = $link->getHref(); - break; - } -} +$approvalUrl = $payment->getApprovalLink(); ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); diff --git a/sample/payouts/CreateBatchPayout.php b/sample/payouts/CreateBatchPayout.php new file mode 100644 index 0000000..7e77800 --- /dev/null +++ b/sample/payouts/CreateBatchPayout.php @@ -0,0 +1,124 @@ +setSenderBatchId(uniqid()) + ->setEmailSubject("You have a payment"); + +// #### Sender Item +// Please note that if you are using single payout with sync mode, you can only pass one Item in the request +$senderItem1 = new \PayPal\Api\PayoutItem(); +$senderItem1->setRecipientType('Email') + ->setNote('Thanks you.') + ->setReceiver('shirt-supplier-one@gmail.com') + ->setSenderItemId("item_1" . uniqid()) + ->setAmount(new \PayPal\Api\Currency('{ + "value":"0.99", + "currency":"USD" + }')); + +// #### Sender Item 2 +// There are many different ways of assigning values in PayPal SDK. Here is another way where you could directly inject json string. +$senderItem2 = new \PayPal\Api\PayoutItem( + '{ + "recipient_type": "EMAIL", + "amount": { + "value": 0.90, + "currency": "USD" + }, + "receiver": "shirt-supplier-two@mail.com", + "note": "Thank you.", + "sender_item_id": "item_2" + }' +); + +// #### Sender Item 3 +// One more way of assigning values in constructor when creating instance of PayPalModel object. Injecting array. +$senderItem3 = new \PayPal\Api\PayoutItem( + array( + "recipient_type" => "EMAIL", + "receiver" => "shirt-supplier-three@mail.com", + "note" => "Thank you.", + "sender_item_id" => uniqid(), + "amount" => array( + "value" => "0.90", + "currency" => "USD" + ) + + ) +); + +$payouts->setSenderBatchHeader($senderBatchHeader) + ->addItem($senderItem1)->addItem($senderItem2)->addItem($senderItem3); + + +// For Sample Purposes Only. +$request = clone $payouts; + +// ### Create Payout +try { + $output = $payouts->create(null, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); + exit(1); +} + +ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); + +return $output; diff --git a/sample/payouts/CreateSinglePayout.php b/sample/payouts/CreateSinglePayout.php new file mode 100644 index 0000000..b00f626 --- /dev/null +++ b/sample/payouts/CreateSinglePayout.php @@ -0,0 +1,73 @@ +setSenderBatchId(uniqid()) + ->setEmailSubject("You have a Payout!"); + +// #### Sender Item +// Please note that if you are using single payout with sync mode, you can only pass one Item in the request +$senderItem = new \PayPal\Api\PayoutItem(); +$senderItem->setRecipientType('Email') + ->setNote('Thanks for your patronage!') + ->setReceiver('shirt-supplier-one@gmail.com') + ->setSenderItemId("2014031400023") + ->setAmount(new \PayPal\Api\Currency('{ + "value":"1.0", + "currency":"USD" + }')); + +$payouts->setSenderBatchHeader($senderBatchHeader) + ->addItem($senderItem); + + +// For Sample Purposes Only. +$request = clone $payouts; + +// ### Create Payout +try { + $output = $payouts->createSynchronous($apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex); + exit(1); +} + +ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); + +return $output; diff --git a/sample/payouts/GetPayoutBatchStatus.php b/sample/payouts/GetPayoutBatchStatus.php new file mode 100644 index 0000000..3044890 --- /dev/null +++ b/sample/payouts/GetPayoutBatchStatus.php @@ -0,0 +1,25 @@ + + +/** @var \PayPal\Api\PayoutBatch $payoutBatch */ +$payoutBatch = require 'CreateBatchPayout.php'; +// ## Payout Batch ID +// You can replace this with your Payout Batch Id on already created Payout. +$payoutBatchId = $payoutBatch->getBatchHeader()->getPayoutBatchId(); + +// ### Get Payout Batch Status +try { + $output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); + +return $output; diff --git a/sample/payouts/GetPayoutItemStatus.php b/sample/payouts/GetPayoutItemStatus.php new file mode 100644 index 0000000..bdd3414 --- /dev/null +++ b/sample/payouts/GetPayoutItemStatus.php @@ -0,0 +1,26 @@ + + +/** @var \PayPal\Api\PayoutBatch $payoutBatch */ +$payoutBatch = require 'GetPayoutBatchStatus.php'; +// ## Payout Item ID +// You can replace this with your Payout Batch Id on already created Payout. +$payoutItem = $payoutBatch->getItems()[0]; +$payoutItemId = $payoutItem->getPayoutItemId(); + +// ### Get Payout Item Status +try { + $output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); + +return $output; diff --git a/sample/sdk_config.ini b/sample/sdk_config.ini index 54a6a5a..223786d 100644 --- a/sample/sdk_config.ini +++ b/sample/sdk_config.ini @@ -38,7 +38,7 @@ log.LogLevel=FINE ;Validation Configuration [validation] -; If validation is set to strict, the PPModel would make sure that +; If validation is set to strict, the PayPalModel would make sure that ; there are proper accessors (Getters and Setters) for each model ; objects. Accepted value is ; 'log' : logs the error message to logger only (default) @@ -49,11 +49,17 @@ validation.level=log ;Caching Configuration [cache] ; If Cache is enabled, it stores the access token retrieved from ClientId and Secret from the -; server into a file provided in constant $CACHE_PATH in PayPal/Cache/AuthorizationCache. +; server into a file provided by the cache.FileName option or by using +; the constant $CACHE_PATH value in PayPal/Cache/AuthorizationCache if the option is omitted/empty. ; If the value is set to 'true', it would try to create a file and store the information. ; For any other value, it would disable it ; Please note, this is a very good performance improvement, and we would encourage you to ; set this up properly to reduce the number of calls, to almost 50% on normal use cases ; PLEASE NOTE: You may need to provide proper write permissions to /var directory under PayPal-PHP-SDK on -; your hosting server +; your hosting server or whichever custom directory you choose cache.enabled=true +; When using a relative path, the cache file is created +; relative to the .php file that is the entry point +; for this request. You can also provide an absolute +; path here +cache.FileName=../auth.cache diff --git a/tests/PayPal/Test/Api/AddressTest.php b/tests/PayPal/Test/Api/AddressTest.php index 39e1e39..7ae1ed0 100644 --- a/tests/PayPal/Test/Api/AddressTest.php +++ b/tests/PayPal/Test/Api/AddressTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Address; /** @@ -65,44 +65,4 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPhone(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Address $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCountry_code(), "TestSample"); - $this->assertEquals($obj->getPostal_code(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Address $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Country_code - $obj->setCountryCode(null); - $this->assertNull($obj->getCountry_code()); - $this->assertNull($obj->getCountryCode()); - $this->assertSame($obj->getCountryCode(), $obj->getCountry_code()); - $obj->setCountry_code("TestSample"); - $this->assertEquals($obj->getCountry_code(), "TestSample"); - - // Check for Postal_code - $obj->setPostalCode(null); - $this->assertNull($obj->getPostal_code()); - $this->assertNull($obj->getPostalCode()); - $this->assertSame($obj->getPostalCode(), $obj->getPostal_code()); - $obj->setPostal_code("TestSample"); - $this->assertEquals($obj->getPostal_code(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php index 08e7a2c..68508cb 100644 --- a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php +++ b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\AgreementStateDescriptor; /** @@ -55,26 +55,4 @@ class AgreementStateDescriptorTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param AgreementStateDescriptor $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param AgreementStateDescriptor $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/AgreementTest.php b/tests/PayPal/Test/Api/AgreementTest.php index 5e9a63f..d0d9b3b 100644 --- a/tests/PayPal/Test/Api/AgreementTest.php +++ b/tests/PayPal/Test/Api/AgreementTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\AgreementTransactions; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\Agreement; /** @@ -81,98 +81,23 @@ class AgreementTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Agreement $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getStart_date(), "TestSample"); - $this->assertEquals($obj->getShipping_address(), AddressTest::getObject()); - $this->assertEquals($obj->getOverride_merchant_preferences(), MerchantPreferencesTest::getObject()); - $this->assertEquals($obj->getOverride_charge_models(), OverrideChargeModelTest::getObject()); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Agreement $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Start_date - $obj->setStartDate(null); - $this->assertNull($obj->getStart_date()); - $this->assertNull($obj->getStartDate()); - $this->assertSame($obj->getStartDate(), $obj->getStart_date()); - $obj->setStart_date("TestSample"); - $this->assertEquals($obj->getStart_date(), "TestSample"); - - // Check for Shipping_address - $obj->setShippingAddress(null); - $this->assertNull($obj->getShipping_address()); - $this->assertNull($obj->getShippingAddress()); - $this->assertSame($obj->getShippingAddress(), $obj->getShipping_address()); - $obj->setShipping_address(AddressTest::getObject()); - $this->assertEquals($obj->getShipping_address(), AddressTest::getObject()); - - // Check for Override_merchant_preferences - $obj->setOverrideMerchantPreferences(null); - $this->assertNull($obj->getOverride_merchant_preferences()); - $this->assertNull($obj->getOverrideMerchantPreferences()); - $this->assertSame($obj->getOverrideMerchantPreferences(), $obj->getOverride_merchant_preferences()); - $obj->setOverride_merchant_preferences(MerchantPreferencesTest::getObject()); - $this->assertEquals($obj->getOverride_merchant_preferences(), MerchantPreferencesTest::getObject()); - - // Check for Override_charge_models - $obj->setOverrideChargeModels(null); - $this->assertNull($obj->getOverride_charge_models()); - $this->assertNull($obj->getOverrideChargeModels()); - $this->assertSame($obj->getOverrideChargeModels(), $obj->getOverride_charge_models()); - $obj->setOverride_charge_models(OverrideChargeModelTest::getObject()); - $this->assertEquals($obj->getOverride_charge_models(), OverrideChargeModelTest::getObject()); - - // Check for Create_time - $obj->setCreateTime(null); - $this->assertNull($obj->getCreate_time()); - $this->assertNull($obj->getCreateTime()); - $this->assertSame($obj->getCreateTime(), $obj->getCreate_time()); - $obj->setCreate_time("TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - - // Check for Update_time - $obj->setUpdateTime(null); - $this->assertNull($obj->getUpdate_time()); - $this->assertNull($obj->getUpdateTime()); - $this->assertSame($obj->getUpdateTime(), $obj->getUpdate_time()); - $obj->setUpdate_time("TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param Agreement $obj */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -181,17 +106,17 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testExecute($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->execute("123123", $mockApiContext, $mockPPRestCall); + $result = $obj->execute("123123", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -200,17 +125,17 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( AgreementTest::getJson() )); - $result = $obj->get("agreementId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("agreementId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -219,18 +144,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); $patchRequest = PatchRequestTest::getObject(); - $result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall); + $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -239,18 +164,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testSuspend($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $agreementStateDescriptor = AgreementStateDescriptorTest::getObject(); - $result = $obj->suspend($agreementStateDescriptor, $mockApiContext, $mockPPRestCall); + $result = $obj->suspend($agreementStateDescriptor, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -259,18 +184,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testReActivate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $agreementStateDescriptor = AgreementStateDescriptorTest::getObject(); - $result = $obj->reActivate($agreementStateDescriptor, $mockApiContext, $mockPPRestCall); + $result = $obj->reActivate($agreementStateDescriptor, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -279,18 +204,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testCancel($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $agreementStateDescriptor = AgreementStateDescriptorTest::getObject(); - $result = $obj->cancel($agreementStateDescriptor, $mockApiContext, $mockPPRestCall); + $result = $obj->cancel($agreementStateDescriptor, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -299,18 +224,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testBillBalance($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $agreementStateDescriptor = AgreementStateDescriptorTest::getObject(); - $result = $obj->billBalance($agreementStateDescriptor, $mockApiContext, $mockPPRestCall); + $result = $obj->billBalance($agreementStateDescriptor, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -319,18 +244,18 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testSetBalance($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $currency = CurrencyTest::getObject(); - $result = $obj->setBalance($currency, $mockApiContext, $mockPPRestCall); + $result = $obj->setBalance($currency, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -339,17 +264,17 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ public function testTransactions($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( AgreementTransactionsTest::getJson() )); - $result = $obj->transactions("agreementId", $mockApiContext, $mockPPRestCall); + $result = $obj->transactions("agreementId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/AgreementTransactionTest.php b/tests/PayPal/Test/Api/AgreementTransactionTest.php index a59b61d..ca2a741 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\AgreementTransaction; /** @@ -71,98 +71,4 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getTimeZone(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param AgreementTransaction $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getTransaction_id(), "TestSample"); - $this->assertEquals($obj->getTransaction_type(), "TestSample"); - $this->assertEquals($obj->getFee_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getNet_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getPayer_email(), "TestSample"); - $this->assertEquals($obj->getPayer_name(), "TestSample"); - $this->assertEquals($obj->getTime_updated(), "TestSample"); - $this->assertEquals($obj->getTime_zone(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param AgreementTransaction $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Transaction_id - $obj->setTransactionId(null); - $this->assertNull($obj->getTransaction_id()); - $this->assertNull($obj->getTransactionId()); - $this->assertSame($obj->getTransactionId(), $obj->getTransaction_id()); - $obj->setTransaction_id("TestSample"); - $this->assertEquals($obj->getTransaction_id(), "TestSample"); - - // Check for Transaction_type - $obj->setTransactionType(null); - $this->assertNull($obj->getTransaction_type()); - $this->assertNull($obj->getTransactionType()); - $this->assertSame($obj->getTransactionType(), $obj->getTransaction_type()); - $obj->setTransaction_type("TestSample"); - $this->assertEquals($obj->getTransaction_type(), "TestSample"); - - // Check for Fee_amount - $obj->setFeeAmount(null); - $this->assertNull($obj->getFee_amount()); - $this->assertNull($obj->getFeeAmount()); - $this->assertSame($obj->getFeeAmount(), $obj->getFee_amount()); - $obj->setFee_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getFee_amount(), CurrencyTest::getObject()); - - // Check for Net_amount - $obj->setNetAmount(null); - $this->assertNull($obj->getNet_amount()); - $this->assertNull($obj->getNetAmount()); - $this->assertSame($obj->getNetAmount(), $obj->getNet_amount()); - $obj->setNet_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getNet_amount(), CurrencyTest::getObject()); - - // Check for Payer_email - $obj->setPayerEmail(null); - $this->assertNull($obj->getPayer_email()); - $this->assertNull($obj->getPayerEmail()); - $this->assertSame($obj->getPayerEmail(), $obj->getPayer_email()); - $obj->setPayer_email("TestSample"); - $this->assertEquals($obj->getPayer_email(), "TestSample"); - - // Check for Payer_name - $obj->setPayerName(null); - $this->assertNull($obj->getPayer_name()); - $this->assertNull($obj->getPayerName()); - $this->assertSame($obj->getPayerName(), $obj->getPayer_name()); - $obj->setPayer_name("TestSample"); - $this->assertEquals($obj->getPayer_name(), "TestSample"); - - // Check for Time_updated - $obj->setTimeUpdated(null); - $this->assertNull($obj->getTime_updated()); - $this->assertNull($obj->getTimeUpdated()); - $this->assertSame($obj->getTimeUpdated(), $obj->getTime_updated()); - $obj->setTime_updated("TestSample"); - $this->assertEquals($obj->getTime_updated(), "TestSample"); - - // Check for Time_zone - $obj->setTimeZone(null); - $this->assertNull($obj->getTime_zone()); - $this->assertNull($obj->getTimeZone()); - $this->assertSame($obj->getTimeZone(), $obj->getTime_zone()); - $obj->setTime_zone("TestSample"); - $this->assertEquals($obj->getTime_zone(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/AgreementTransactionsTest.php b/tests/PayPal/Test/Api/AgreementTransactionsTest.php index 11457f0..df96665 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionsTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionsTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\AgreementTransactions; /** @@ -53,35 +53,4 @@ class AgreementTransactionsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAgreementTransactionList(), AgreementTransactionTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param AgreementTransactions $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getAgreement_transaction_list(), AgreementTransactionTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param AgreementTransactions $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Agreement_transaction_list - $obj->setAgreementTransactionList(null); - $this->assertNull($obj->getAgreement_transaction_list()); - $this->assertNull($obj->getAgreementTransactionList()); - $this->assertSame($obj->getAgreementTransactionList(), $obj->getAgreement_transaction_list()); - $obj->setAgreement_transaction_list(AgreementTransactionTest::getObject()); - $this->assertEquals($obj->getAgreement_transaction_list(), AgreementTransactionTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/AuthorizationTest.php b/tests/PayPal/Test/Api/AuthorizationTest.php index 111657c..2ba23c7 100644 --- a/tests/PayPal/Test/Api/AuthorizationTest.php +++ b/tests/PayPal/Test/Api/AuthorizationTest.php @@ -14,7 +14,7 @@ use PayPal\Api\CreditCard; use PayPal\Api\Payment; use PayPal\Api\FundingInstrument; use PayPal\Api\Transaction; -use PayPal\Exception\PPConnectionException; +use PayPal\Exception\PayPalConnectionException; class AuthorizationTest extends \PHPUnit_Framework_TestCase { @@ -165,7 +165,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase } catch (\InvalidArgumentException $ex) { $this->assertEquals($ex->getMessage(), "Id cannot be null"); } - } catch (PPConnectionException $ex) { + } catch (PayPalConnectionException $ex) { $this->markTestSkipped( 'Tests failing because of intermittent failures in Paypal Sandbox environment.' . $ex->getMessage() ); @@ -186,7 +186,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase $authorization->setAmount($amount); try { $authorization->reauthorize(); - } catch (PPConnectionException $ex) { + } catch (PayPalConnectionException $ex) { //var_dump($ex->getMessage()); $this->assertEquals(strpos($ex->getMessage(), "500"), false); } diff --git a/tests/PayPal/Test/Api/BankAccountTest.php b/tests/PayPal/Test/Api/BankAccountTest.php index dd8814b..1607d99 100644 --- a/tests/PayPal/Test/Api/BankAccountTest.php +++ b/tests/PayPal/Test/Api/BankAccountTest.php @@ -2,10 +2,10 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\BankAccount; /** @@ -102,233 +102,23 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param BankAccount $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getAccount_number(), "TestSample"); - $this->assertEquals($obj->getAccount_number_type(), "TestSample"); - $this->assertEquals($obj->getRouting_number(), "TestSample"); - $this->assertEquals($obj->getAccount_type(), "TestSample"); - $this->assertEquals($obj->getAccount_name(), "TestSample"); - $this->assertEquals($obj->getCheck_type(), "TestSample"); - $this->assertEquals($obj->getAuth_type(), "TestSample"); - $this->assertEquals($obj->getAuth_capture_timestamp(), "TestSample"); - $this->assertEquals($obj->getBank_name(), "TestSample"); - $this->assertEquals($obj->getCountry_code(), "TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBirth_date(), "TestSample"); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - $this->assertEquals($obj->getConfirmation_status(), "TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - $this->assertEquals($obj->getMerchant_id(), "TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param BankAccount $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Account_number - $obj->setAccountNumber(null); - $this->assertNull($obj->getAccount_number()); - $this->assertNull($obj->getAccountNumber()); - $this->assertSame($obj->getAccountNumber(), $obj->getAccount_number()); - $obj->setAccount_number("TestSample"); - $this->assertEquals($obj->getAccount_number(), "TestSample"); - - // Check for Account_number_type - $obj->setAccountNumberType(null); - $this->assertNull($obj->getAccount_number_type()); - $this->assertNull($obj->getAccountNumberType()); - $this->assertSame($obj->getAccountNumberType(), $obj->getAccount_number_type()); - $obj->setAccount_number_type("TestSample"); - $this->assertEquals($obj->getAccount_number_type(), "TestSample"); - - // Check for Routing_number - $obj->setRoutingNumber(null); - $this->assertNull($obj->getRouting_number()); - $this->assertNull($obj->getRoutingNumber()); - $this->assertSame($obj->getRoutingNumber(), $obj->getRouting_number()); - $obj->setRouting_number("TestSample"); - $this->assertEquals($obj->getRouting_number(), "TestSample"); - - // Check for Account_type - $obj->setAccountType(null); - $this->assertNull($obj->getAccount_type()); - $this->assertNull($obj->getAccountType()); - $this->assertSame($obj->getAccountType(), $obj->getAccount_type()); - $obj->setAccount_type("TestSample"); - $this->assertEquals($obj->getAccount_type(), "TestSample"); - - // Check for Account_name - $obj->setAccountName(null); - $this->assertNull($obj->getAccount_name()); - $this->assertNull($obj->getAccountName()); - $this->assertSame($obj->getAccountName(), $obj->getAccount_name()); - $obj->setAccount_name("TestSample"); - $this->assertEquals($obj->getAccount_name(), "TestSample"); - - // Check for Check_type - $obj->setCheckType(null); - $this->assertNull($obj->getCheck_type()); - $this->assertNull($obj->getCheckType()); - $this->assertSame($obj->getCheckType(), $obj->getCheck_type()); - $obj->setCheck_type("TestSample"); - $this->assertEquals($obj->getCheck_type(), "TestSample"); - - // Check for Auth_type - $obj->setAuthType(null); - $this->assertNull($obj->getAuth_type()); - $this->assertNull($obj->getAuthType()); - $this->assertSame($obj->getAuthType(), $obj->getAuth_type()); - $obj->setAuth_type("TestSample"); - $this->assertEquals($obj->getAuth_type(), "TestSample"); - - // Check for Auth_capture_timestamp - $obj->setAuthCaptureTimestamp(null); - $this->assertNull($obj->getAuth_capture_timestamp()); - $this->assertNull($obj->getAuthCaptureTimestamp()); - $this->assertSame($obj->getAuthCaptureTimestamp(), $obj->getAuth_capture_timestamp()); - $obj->setAuth_capture_timestamp("TestSample"); - $this->assertEquals($obj->getAuth_capture_timestamp(), "TestSample"); - - // Check for Bank_name - $obj->setBankName(null); - $this->assertNull($obj->getBank_name()); - $this->assertNull($obj->getBankName()); - $this->assertSame($obj->getBankName(), $obj->getBank_name()); - $obj->setBank_name("TestSample"); - $this->assertEquals($obj->getBank_name(), "TestSample"); - - // Check for Country_code - $obj->setCountryCode(null); - $this->assertNull($obj->getCountry_code()); - $this->assertNull($obj->getCountryCode()); - $this->assertSame($obj->getCountryCode(), $obj->getCountry_code()); - $obj->setCountry_code("TestSample"); - $this->assertEquals($obj->getCountry_code(), "TestSample"); - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Birth_date - $obj->setBirthDate(null); - $this->assertNull($obj->getBirth_date()); - $this->assertNull($obj->getBirthDate()); - $this->assertSame($obj->getBirthDate(), $obj->getBirth_date()); - $obj->setBirth_date("TestSample"); - $this->assertEquals($obj->getBirth_date(), "TestSample"); - - // Check for Billing_address - $obj->setBillingAddress(null); - $this->assertNull($obj->getBilling_address()); - $this->assertNull($obj->getBillingAddress()); - $this->assertSame($obj->getBillingAddress(), $obj->getBilling_address()); - $obj->setBilling_address(AddressTest::getObject()); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - - // Check for Confirmation_status - $obj->setConfirmationStatus(null); - $this->assertNull($obj->getConfirmation_status()); - $this->assertNull($obj->getConfirmationStatus()); - $this->assertSame($obj->getConfirmationStatus(), $obj->getConfirmation_status()); - $obj->setConfirmation_status("TestSample"); - $this->assertEquals($obj->getConfirmation_status(), "TestSample"); - - // Check for Payer_id - $obj->setPayerId(null); - $this->assertNull($obj->getPayer_id()); - $this->assertNull($obj->getPayerId()); - $this->assertSame($obj->getPayerId(), $obj->getPayer_id()); - $obj->setPayer_id("TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - - // Check for External_customer_id - $obj->setExternalCustomerId(null); - $this->assertNull($obj->getExternal_customer_id()); - $this->assertNull($obj->getExternalCustomerId()); - $this->assertSame($obj->getExternalCustomerId(), $obj->getExternal_customer_id()); - $obj->setExternal_customer_id("TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - - // Check for Merchant_id - $obj->setMerchantId(null); - $this->assertNull($obj->getMerchant_id()); - $this->assertNull($obj->getMerchantId()); - $this->assertSame($obj->getMerchantId(), $obj->getMerchant_id()); - $obj->setMerchant_id("TestSample"); - $this->assertEquals($obj->getMerchant_id(), "TestSample"); - - // Check for Create_time - $obj->setCreateTime(null); - $this->assertNull($obj->getCreate_time()); - $this->assertNull($obj->getCreateTime()); - $this->assertSame($obj->getCreateTime(), $obj->getCreate_time()); - $obj->setCreate_time("TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - - // Check for Update_time - $obj->setUpdateTime(null); - $this->assertNull($obj->getUpdate_time()); - $this->assertNull($obj->getUpdateTime()); - $this->assertSame($obj->getUpdateTime(), $obj->getUpdate_time()); - $obj->setUpdate_time("TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - - // Check for Valid_until - $obj->setValidUntil(null); - $this->assertNull($obj->getValid_until()); - $this->assertNull($obj->getValidUntil()); - $this->assertSame($obj->getValidUntil(), $obj->getValid_until()); - $obj->setValid_until("TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param BankAccount $obj */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -337,17 +127,17 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( BankAccountTest::getJson() )); - $result = $obj->get("bankAccountId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("bankAccountId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -356,17 +146,17 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPPRestCall); + $result = $obj->delete($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -375,18 +165,18 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); $patchRequest = PatchRequestTest::getObject(); - $result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall); + $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/BankAccountsListTest.php b/tests/PayPal/Test/Api/BankAccountsListTest.php index 010498d..51d80ea 100644 --- a/tests/PayPal/Test/Api/BankAccountsListTest.php +++ b/tests/PayPal/Test/Api/BankAccountsListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\BankAccountsList; /** @@ -57,44 +57,4 @@ class BankAccountsListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getNextId(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param BankAccountsList $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getBank_accounts(), BankAccountTest::getObject()); - $this->assertEquals($obj->getNext_id(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param BankAccountsList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Bank_accounts - $obj->setBankAccounts(null); - $this->assertNull($obj->getBank_accounts()); - $this->assertNull($obj->getBankAccounts()); - $this->assertSame($obj->getBankAccounts(), $obj->getBank_accounts()); - $obj->setBank_accounts(BankAccountTest::getObject()); - $this->assertEquals($obj->getBank_accounts(), BankAccountTest::getObject()); - - // Check for Next_id - $obj->setNextId(null); - $this->assertNull($obj->getNext_id()); - $this->assertNull($obj->getNextId()); - $this->assertSame($obj->getNextId(), $obj->getNext_id()); - $obj->setNext_id("TestSample"); - $this->assertEquals($obj->getNext_id(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/BankTokenTest.php b/tests/PayPal/Test/Api/BankTokenTest.php index e462af3..aa3de98 100644 --- a/tests/PayPal/Test/Api/BankTokenTest.php +++ b/tests/PayPal/Test/Api/BankTokenTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\BankToken; /** @@ -57,53 +57,4 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param BankToken $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getBank_id(), "TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - $this->assertEquals($obj->getMandate_reference_number(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param BankToken $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Bank_id - $obj->setBankId(null); - $this->assertNull($obj->getBank_id()); - $this->assertNull($obj->getBankId()); - $this->assertSame($obj->getBankId(), $obj->getBank_id()); - $obj->setBank_id("TestSample"); - $this->assertEquals($obj->getBank_id(), "TestSample"); - - // Check for External_customer_id - $obj->setExternalCustomerId(null); - $this->assertNull($obj->getExternal_customer_id()); - $this->assertNull($obj->getExternalCustomerId()); - $this->assertSame($obj->getExternalCustomerId(), $obj->getExternal_customer_id()); - $obj->setExternal_customer_id("TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - - // Check for Mandate_reference_number - $obj->setMandateReferenceNumber(null); - $this->assertNull($obj->getMandate_reference_number()); - $this->assertNull($obj->getMandateReferenceNumber()); - $this->assertSame($obj->getMandateReferenceNumber(), $obj->getMandate_reference_number()); - $obj->setMandate_reference_number("TestSample"); - $this->assertEquals($obj->getMandate_reference_number(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/BillingInfoTest.php b/tests/PayPal/Test/Api/BillingInfoTest.php index 2e02be2..2d7de85 100644 --- a/tests/PayPal/Test/Api/BillingInfoTest.php +++ b/tests/PayPal/Test/Api/BillingInfoTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\BillingInfo; /** @@ -69,71 +69,4 @@ class BillingInfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPhone(), PhoneTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param BillingInfo $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - $this->assertEquals($obj->getAdditional_info(), "TestSample"); - $this->assertEquals($obj->getNotification_channel(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param BillingInfo $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Business_name - $obj->setBusinessName(null); - $this->assertNull($obj->getBusiness_name()); - $this->assertNull($obj->getBusinessName()); - $this->assertSame($obj->getBusinessName(), $obj->getBusiness_name()); - $obj->setBusiness_name("TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - - // Check for Additional_info - $obj->setAdditionalInfo(null); - $this->assertNull($obj->getAdditional_info()); - $this->assertNull($obj->getAdditionalInfo()); - $this->assertSame($obj->getAdditionalInfo(), $obj->getAdditional_info()); - $obj->setAdditional_info("TestSample"); - $this->assertEquals($obj->getAdditional_info(), "TestSample"); - - // Check for Notification_channel - $obj->setNotificationChannel(null); - $this->assertNull($obj->getNotification_channel()); - $this->assertNull($obj->getNotificationChannel()); - $this->assertSame($obj->getNotificationChannel(), $obj->getNotification_channel()); - $obj->setNotification_channel("TestSample"); - $this->assertEquals($obj->getNotification_channel(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CancelNotificationTest.php b/tests/PayPal/Test/Api/CancelNotificationTest.php index b3136e3..d3c0376 100644 --- a/tests/PayPal/Test/Api/CancelNotificationTest.php +++ b/tests/PayPal/Test/Api/CancelNotificationTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\CancelNotification; /** @@ -59,44 +59,4 @@ class CancelNotificationTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getSendToPayer(), true); } - /** - * @depends testSerializationDeserialization - * @param CancelNotification $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getSend_to_merchant(), true); - $this->assertEquals($obj->getSend_to_payer(), true); - } - - /** - * @depends testSerializationDeserialization - * @param CancelNotification $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Send_to_merchant - $obj->setSendToMerchant(null); - $this->assertNull($obj->getSend_to_merchant()); - $this->assertNull($obj->getSendToMerchant()); - $this->assertSame($obj->getSendToMerchant(), $obj->getSend_to_merchant()); - $obj->setSend_to_merchant(true); - $this->assertEquals($obj->getSend_to_merchant(), true); - - // Check for Send_to_payer - $obj->setSendToPayer(null); - $this->assertNull($obj->getSend_to_payer()); - $this->assertNull($obj->getSendToPayer()); - $this->assertSame($obj->getSendToPayer(), $obj->getSend_to_payer()); - $obj->setSend_to_payer(true); - $this->assertEquals($obj->getSend_to_payer(), true); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CaptureTest.php b/tests/PayPal/Test/Api/CaptureTest.php index 8cc8748..2a1fba3 100644 --- a/tests/PayPal/Test/Api/CaptureTest.php +++ b/tests/PayPal/Test/Api/CaptureTest.php @@ -5,7 +5,7 @@ use PayPal\Api\Capture; use PayPal\Api\Refund; use PayPal\Api\Authorization; use PayPal\Api\Amount; -use PayPal\Exception\PPConnectionException; +use PayPal\Exception\PayPalConnectionException; use PayPal\Test\Constants; class CaptureTest extends \PHPUnit_Framework_TestCase @@ -91,7 +91,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase $retund = $capture->refund($refund); $this->assertNotNull($retund->getId()); - } catch (PPConnectionException $ex) { + } catch (PayPalConnectionException $ex) { $this->markTestSkipped( 'Tests failing because of intermittent failures in Paypal Sandbox environment.' . $ex->getMessage() ); diff --git a/tests/PayPal/Test/Api/ChargeModelTest.php b/tests/PayPal/Test/Api/ChargeModelTest.php index be3e005..ed78c22 100644 --- a/tests/PayPal/Test/Api/ChargeModelTest.php +++ b/tests/PayPal/Test/Api/ChargeModelTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ChargeModel; /** @@ -57,26 +57,4 @@ class ChargeModelTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param ChargeModel $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param ChargeModel $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CostTest.php b/tests/PayPal/Test/Api/CostTest.php index dfd623c..89f38df 100644 --- a/tests/PayPal/Test/Api/CostTest.php +++ b/tests/PayPal/Test/Api/CostTest.php @@ -2,8 +2,8 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; -use PayPal\Common\FormatConverter; +use PayPal\Common\PayPalModel; +use PayPal\Converter\FormatConverter; use PayPal\Validation\NumericValidator; use PayPal\Api\Cost; @@ -56,27 +56,5 @@ class CostTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPercent(), "12.34"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - - /** - * @depends testSerializationDeserialization - * @param Cost $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Cost $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - + } diff --git a/tests/PayPal/Test/Api/CreateProfileResponseTest.php b/tests/PayPal/Test/Api/CreateProfileResponseTest.php index 5656eb6..05f3f5e 100644 --- a/tests/PayPal/Test/Api/CreateProfileResponseTest.php +++ b/tests/PayPal/Test/Api/CreateProfileResponseTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\CreateProfileResponse; /** @@ -53,26 +53,4 @@ class CreateProfileResponseTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getId(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param CreateProfileResponse $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param CreateProfileResponse $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CreditCardListTest.php b/tests/PayPal/Test/Api/CreditCardListTest.php index e3467cd..285d046 100644 --- a/tests/PayPal/Test/Api/CreditCardListTest.php +++ b/tests/PayPal/Test/Api/CreditCardListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\CreditCardList; /** @@ -57,44 +57,4 @@ class CreditCardListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getNextId(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param CreditCardList $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCredit_cards(), CreditCardTest::getObject()); - $this->assertEquals($obj->getNext_id(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param CreditCardList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Credit_cards - $obj->setCreditCards(null); - $this->assertNull($obj->getCredit_cards()); - $this->assertNull($obj->getCreditCards()); - $this->assertSame($obj->getCreditCards(), $obj->getCredit_cards()); - $obj->setCredit_cards(CreditCardTest::getObject()); - $this->assertEquals($obj->getCredit_cards(), CreditCardTest::getObject()); - - // Check for Next_id - $obj->setNextId(null); - $this->assertNull($obj->getNext_id()); - $this->assertNull($obj->getNextId()); - $this->assertSame($obj->getNextId(), $obj->getNext_id()); - $obj->setNext_id("TestSample"); - $this->assertEquals($obj->getNext_id(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CreditCardTest.php b/tests/PayPal/Test/Api/CreditCardTest.php index a10b458..00782d9 100644 --- a/tests/PayPal/Test/Api/CreditCardTest.php +++ b/tests/PayPal/Test/Api/CreditCardTest.php @@ -2,10 +2,10 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\CreditCard; /** @@ -84,125 +84,23 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param CreditCard $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getExpire_month(), 123); - $this->assertEquals($obj->getExpire_year(), 123); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param CreditCard $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Expire_month - $obj->setExpireMonth(null); - $this->assertNull($obj->getExpire_month()); - $this->assertNull($obj->getExpireMonth()); - $this->assertSame($obj->getExpireMonth(), $obj->getExpire_month()); - $obj->setExpire_month(123); - $this->assertEquals($obj->getExpire_month(), 123); - - // Check for Expire_year - $obj->setExpireYear(null); - $this->assertNull($obj->getExpire_year()); - $this->assertNull($obj->getExpireYear()); - $this->assertSame($obj->getExpireYear(), $obj->getExpire_year()); - $obj->setExpire_year(123); - $this->assertEquals($obj->getExpire_year(), 123); - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Billing_address - $obj->setBillingAddress(null); - $this->assertNull($obj->getBilling_address()); - $this->assertNull($obj->getBillingAddress()); - $this->assertSame($obj->getBillingAddress(), $obj->getBilling_address()); - $obj->setBilling_address(AddressTest::getObject()); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - - // Check for External_customer_id - $obj->setExternalCustomerId(null); - $this->assertNull($obj->getExternal_customer_id()); - $this->assertNull($obj->getExternalCustomerId()); - $this->assertSame($obj->getExternalCustomerId(), $obj->getExternal_customer_id()); - $obj->setExternal_customer_id("TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - - // Check for Valid_until - $obj->setValidUntil(null); - $this->assertNull($obj->getValid_until()); - $this->assertNull($obj->getValidUntil()); - $this->assertSame($obj->getValidUntil(), $obj->getValid_until()); - $obj->setValid_until("TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - - // Check for Create_time - $obj->setCreateTime(null); - $this->assertNull($obj->getCreate_time()); - $this->assertNull($obj->getCreateTime()); - $this->assertSame($obj->getCreateTime(), $obj->getCreate_time()); - $obj->setCreate_time("TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - - // Check for Update_time - $obj->setUpdateTime(null); - $this->assertNull($obj->getUpdate_time()); - $this->assertNull($obj->getUpdateTime()); - $this->assertSame($obj->getUpdateTime(), $obj->getUpdate_time()); - $obj->setUpdate_time("TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param CreditCard $obj */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -211,17 +109,17 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( CreditCardTest::getJson() )); - $result = $obj->get("creditCardId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("creditCardId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -230,17 +128,17 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPPRestCall); + $result = $obj->delete($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -249,17 +147,17 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->update($mockApiContext, $mockPPRestCall); + $result = $obj->update($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/CreditCardTokenTest.php b/tests/PayPal/Test/Api/CreditCardTokenTest.php index 24abf6e..f6cb7c8 100644 --- a/tests/PayPal/Test/Api/CreditCardTokenTest.php +++ b/tests/PayPal/Test/Api/CreditCardTokenTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\CreditCardToken; /** @@ -63,62 +63,4 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getExpireYear(), 123); } - /** - * @depends testSerializationDeserialization - * @param CreditCardToken $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCredit_card_id(), "TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - $this->assertEquals($obj->getExpire_month(), 123); - $this->assertEquals($obj->getExpire_year(), 123); - } - - /** - * @depends testSerializationDeserialization - * @param CreditCardToken $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Credit_card_id - $obj->setCreditCardId(null); - $this->assertNull($obj->getCredit_card_id()); - $this->assertNull($obj->getCreditCardId()); - $this->assertSame($obj->getCreditCardId(), $obj->getCredit_card_id()); - $obj->setCredit_card_id("TestSample"); - $this->assertEquals($obj->getCredit_card_id(), "TestSample"); - - // Check for Payer_id - $obj->setPayerId(null); - $this->assertNull($obj->getPayer_id()); - $this->assertNull($obj->getPayerId()); - $this->assertSame($obj->getPayerId(), $obj->getPayer_id()); - $obj->setPayer_id("TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - - // Check for Expire_month - $obj->setExpireMonth(null); - $this->assertNull($obj->getExpire_month()); - $this->assertNull($obj->getExpireMonth()); - $this->assertSame($obj->getExpireMonth(), $obj->getExpire_month()); - $obj->setExpire_month(123); - $this->assertEquals($obj->getExpire_month(), 123); - - // Check for Expire_year - $obj->setExpireYear(null); - $this->assertNull($obj->getExpire_year()); - $this->assertNull($obj->getExpireYear()); - $this->assertSame($obj->getExpireYear(), $obj->getExpire_year()); - $obj->setExpire_year(123); - $this->assertEquals($obj->getExpire_year(), 123); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CreditTest.php b/tests/PayPal/Test/Api/CreditTest.php index 419cb80..fa5352a 100644 --- a/tests/PayPal/Test/Api/CreditTest.php +++ b/tests/PayPal/Test/Api/CreditTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Credit; /** @@ -57,26 +57,4 @@ class CreditTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getTerms(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Credit $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Credit $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CurrencyTest.php b/tests/PayPal/Test/Api/CurrencyTest.php index bb941d7..328190a 100644 --- a/tests/PayPal/Test/Api/CurrencyTest.php +++ b/tests/PayPal/Test/Api/CurrencyTest.php @@ -2,8 +2,8 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; -use PayPal\Common\FormatConverter; +use PayPal\Common\PayPalModel; +use PayPal\Converter\FormatConverter; use PayPal\Validation\NumericValidator; use PayPal\Api\Currency; @@ -57,26 +57,4 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getValue(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Currency $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Currency $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/CustomAmountTest.php b/tests/PayPal/Test/Api/CustomAmountTest.php index a870479..fa765f5 100644 --- a/tests/PayPal/Test/Api/CustomAmountTest.php +++ b/tests/PayPal/Test/Api/CustomAmountTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\CustomAmount; /** @@ -55,26 +55,4 @@ class CustomAmountTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param CustomAmount $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param CustomAmount $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ErrorDetailsTest.php b/tests/PayPal/Test/Api/ErrorDetailsTest.php index f49c199..1643d04 100644 --- a/tests/PayPal/Test/Api/ErrorDetailsTest.php +++ b/tests/PayPal/Test/Api/ErrorDetailsTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ErrorDetails; /** @@ -55,26 +55,4 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getIssue(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param ErrorDetails $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param ErrorDetails $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ErrorTest.php b/tests/PayPal/Test/Api/ErrorTest.php index 1270e27..de97617 100644 --- a/tests/PayPal/Test/Api/ErrorTest.php +++ b/tests/PayPal/Test/Api/ErrorTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Error; /** @@ -63,44 +63,4 @@ class ErrorTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Error $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getDebug_id(), "TestSample"); - $this->assertEquals($obj->getInformation_link(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Error $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Debug_id - $obj->setDebugId(null); - $this->assertNull($obj->getDebug_id()); - $this->assertNull($obj->getDebugId()); - $this->assertSame($obj->getDebugId(), $obj->getDebug_id()); - $obj->setDebug_id("TestSample"); - $this->assertEquals($obj->getDebug_id(), "TestSample"); - - // Check for Information_link - $obj->setInformationLink(null); - $this->assertNull($obj->getInformation_link()); - $this->assertNull($obj->getInformationLink()); - $this->assertSame($obj->getInformationLink(), $obj->getInformation_link()); - $obj->setInformation_link("TestSample"); - $this->assertEquals($obj->getInformation_link(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ExtendedBankAccountTest.php b/tests/PayPal/Test/Api/ExtendedBankAccountTest.php index 533006c..7a8d83e 100644 --- a/tests/PayPal/Test/Api/ExtendedBankAccountTest.php +++ b/tests/PayPal/Test/Api/ExtendedBankAccountTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ExtendedBankAccount; /** @@ -53,35 +53,4 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param ExtendedBankAccount $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getMandate_reference_number(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param ExtendedBankAccount $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Mandate_reference_number - $obj->setMandateReferenceNumber(null); - $this->assertNull($obj->getMandate_reference_number()); - $this->assertNull($obj->getMandateReferenceNumber()); - $this->assertSame($obj->getMandateReferenceNumber(), $obj->getMandate_reference_number()); - $obj->setMandate_reference_number("TestSample"); - $this->assertEquals($obj->getMandate_reference_number(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/FlowConfigTest.php b/tests/PayPal/Test/Api/FlowConfigTest.php index 8df6953..5c47b90 100644 --- a/tests/PayPal/Test/Api/FlowConfigTest.php +++ b/tests/PayPal/Test/Api/FlowConfigTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\FlowConfig; /** @@ -55,36 +55,6 @@ class FlowConfigTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getBankTxnPendingUrl(), "http://www.google.com"); } - /** - * @depends testSerializationDeserialization - * @param FlowConfig $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getLanding_page_type(), "TestSample"); - $this->assertEquals($obj->getBank_txn_pending_url(), "http://www.google.com"); - } - - /** - * @depends testSerializationDeserialization - * @param FlowConfig $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Landing_page_type - $obj->setLandingPageType(null); - $this->assertNull($obj->getLanding_page_type()); - $this->assertNull($obj->getLandingPageType()); - $this->assertSame($obj->getLandingPageType(), $obj->getLanding_page_type()); - $obj->setLanding_page_type("TestSample"); - $this->assertEquals($obj->getLanding_page_type(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage BankTxnPendingUrl is not a fully qualified URL @@ -95,11 +65,4 @@ class FlowConfigTest extends \PHPUnit_Framework_TestCase $obj->setBankTxnPendingUrl(null); } - public function testUrlValidationForBankTxnPendingUrlDeprecated() - { - $obj = new FlowConfig(); - $obj->setBank_txn_pending_url(null); - $this->assertNull($obj->getBank_txn_pending_url()); - } - } diff --git a/tests/PayPal/Test/Api/FundingInstrumentTest.php b/tests/PayPal/Test/Api/FundingInstrumentTest.php index 1844cd9..d64ca5b 100644 --- a/tests/PayPal/Test/Api/FundingInstrumentTest.php +++ b/tests/PayPal/Test/Api/FundingInstrumentTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\FundingInstrument; /** @@ -65,80 +65,5 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getCredit(), CreditTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param FundingInstrument $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCredit_card(), CreditCardTest::getObject()); - $this->assertEquals($obj->getCredit_card_token(), CreditCardTokenTest::getObject()); - $this->assertEquals($obj->getPayment_card(), PaymentCardTest::getObject()); - $this->assertEquals($obj->getPayment_card_token(), PaymentCardTokenTest::getObject()); - $this->assertEquals($obj->getBank_account(), ExtendedBankAccountTest::getObject()); - $this->assertEquals($obj->getBank_account_token(), BankTokenTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param FundingInstrument $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Credit_card - $obj->setCreditCard(null); - $this->assertNull($obj->getCredit_card()); - $this->assertNull($obj->getCreditCard()); - $this->assertSame($obj->getCreditCard(), $obj->getCredit_card()); - $obj->setCredit_card(CreditCardTest::getObject()); - $this->assertEquals($obj->getCredit_card(), CreditCardTest::getObject()); - - // Check for Credit_card_token - $obj->setCreditCardToken(null); - $this->assertNull($obj->getCredit_card_token()); - $this->assertNull($obj->getCreditCardToken()); - $this->assertSame($obj->getCreditCardToken(), $obj->getCredit_card_token()); - $obj->setCredit_card_token(CreditCardTokenTest::getObject()); - $this->assertEquals($obj->getCredit_card_token(), CreditCardTokenTest::getObject()); - - // Check for Payment_card - $obj->setPaymentCard(null); - $this->assertNull($obj->getPayment_card()); - $this->assertNull($obj->getPaymentCard()); - $this->assertSame($obj->getPaymentCard(), $obj->getPayment_card()); - $obj->setPayment_card(PaymentCardTest::getObject()); - $this->assertEquals($obj->getPayment_card(), PaymentCardTest::getObject()); - - // Check for Payment_card_token - $obj->setPaymentCardToken(null); - $this->assertNull($obj->getPayment_card_token()); - $this->assertNull($obj->getPaymentCardToken()); - $this->assertSame($obj->getPaymentCardToken(), $obj->getPayment_card_token()); - $obj->setPayment_card_token(PaymentCardTokenTest::getObject()); - $this->assertEquals($obj->getPayment_card_token(), PaymentCardTokenTest::getObject()); - - // Check for Bank_account - $obj->setBankAccount(null); - $this->assertNull($obj->getBank_account()); - $this->assertNull($obj->getBankAccount()); - $this->assertSame($obj->getBankAccount(), $obj->getBank_account()); - $obj->setBank_account(ExtendedBankAccountTest::getObject()); - $this->assertEquals($obj->getBank_account(), ExtendedBankAccountTest::getObject()); - - // Check for Bank_account_token - $obj->setBankAccountToken(null); - $this->assertNull($obj->getBank_account_token()); - $this->assertNull($obj->getBankAccountToken()); - $this->assertSame($obj->getBankAccountToken(), $obj->getBank_account_token()); - $obj->setBank_account_token(BankTokenTest::getObject()); - $this->assertEquals($obj->getBank_account_token(), BankTokenTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - } diff --git a/tests/PayPal/Test/Api/HyperSchemaTest.php b/tests/PayPal/Test/Api/HyperSchemaTest.php index 6a8a724..a9be72a 100644 --- a/tests/PayPal/Test/Api/HyperSchemaTest.php +++ b/tests/PayPal/Test/Api/HyperSchemaTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\HyperSchema; /** @@ -63,26 +63,4 @@ class HyperSchemaTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getMediaType(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param HyperSchema $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param HyperSchema $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ImageTest.php b/tests/PayPal/Test/Api/ImageTest.php index 7d93ad7..f96901d 100644 --- a/tests/PayPal/Test/Api/ImageTest.php +++ b/tests/PayPal/Test/Api/ImageTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Image; /** @@ -53,26 +53,4 @@ class ImageTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getImage(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Image $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Image $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/InputFieldsTest.php b/tests/PayPal/Test/Api/InputFieldsTest.php index a19be98..cef0319 100644 --- a/tests/PayPal/Test/Api/InputFieldsTest.php +++ b/tests/PayPal/Test/Api/InputFieldsTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\InputFields; /** @@ -57,53 +57,4 @@ class InputFieldsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAddressOverride(), 123); } - /** - * @depends testSerializationDeserialization - * @param InputFields $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getAllow_note(), true); - $this->assertEquals($obj->getNo_shipping(), 123); - $this->assertEquals($obj->getAddress_override(), 123); - } - - /** - * @depends testSerializationDeserialization - * @param InputFields $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Allow_note - $obj->setAllowNote(null); - $this->assertNull($obj->getAllow_note()); - $this->assertNull($obj->getAllowNote()); - $this->assertSame($obj->getAllowNote(), $obj->getAllow_note()); - $obj->setAllow_note(true); - $this->assertEquals($obj->getAllow_note(), true); - - // Check for No_shipping - $obj->setNoShipping(null); - $this->assertNull($obj->getNo_shipping()); - $this->assertNull($obj->getNoShipping()); - $this->assertSame($obj->getNoShipping(), $obj->getNo_shipping()); - $obj->setNo_shipping(123); - $this->assertEquals($obj->getNo_shipping(), 123); - - // Check for Address_override - $obj->setAddressOverride(null); - $this->assertNull($obj->getAddress_override()); - $this->assertNull($obj->getAddressOverride()); - $this->assertSame($obj->getAddressOverride(), $obj->getAddress_override()); - $obj->setAddress_override(123); - $this->assertEquals($obj->getAddress_override(), 123); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/InvoiceAddressTest.php b/tests/PayPal/Test/Api/InvoiceAddressTest.php index 109e08f..dd47fc2 100644 --- a/tests/PayPal/Test/Api/InvoiceAddressTest.php +++ b/tests/PayPal/Test/Api/InvoiceAddressTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\InvoiceAddress; /** @@ -65,44 +65,4 @@ class InvoiceAddressTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPhone(), PhoneTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param InvoiceAddress $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCountry_code(), "TestSample"); - $this->assertEquals($obj->getPostal_code(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param InvoiceAddress $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Country_code - $obj->setCountryCode(null); - $this->assertNull($obj->getCountry_code()); - $this->assertNull($obj->getCountryCode()); - $this->assertSame($obj->getCountryCode(), $obj->getCountry_code()); - $obj->setCountry_code("TestSample"); - $this->assertEquals($obj->getCountry_code(), "TestSample"); - - // Check for Postal_code - $obj->setPostalCode(null); - $this->assertNull($obj->getPostal_code()); - $this->assertNull($obj->getPostalCode()); - $this->assertSame($obj->getPostalCode(), $obj->getPostal_code()); - $obj->setPostal_code("TestSample"); - $this->assertEquals($obj->getPostal_code(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/InvoiceItemTest.php b/tests/PayPal/Test/Api/InvoiceItemTest.php index 28ee892..15e0e6c 100644 --- a/tests/PayPal/Test/Api/InvoiceItemTest.php +++ b/tests/PayPal/Test/Api/InvoiceItemTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\InvoiceItem; /** @@ -65,35 +65,4 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getDiscount(), CostTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param InvoiceItem $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getUnit_price(), CurrencyTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param InvoiceItem $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Unit_price - $obj->setUnitPrice(null); - $this->assertNull($obj->getUnit_price()); - $this->assertNull($obj->getUnitPrice()); - $this->assertSame($obj->getUnitPrice(), $obj->getUnit_price()); - $obj->setUnit_price(CurrencyTest::getObject()); - $this->assertEquals($obj->getUnit_price(), CurrencyTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php b/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php index d45effa..3d1503d 100644 --- a/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php +++ b/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\InvoiceSearchResponse; /** @@ -55,35 +55,4 @@ class InvoiceSearchResponseTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getInvoices(), InvoiceTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param InvoiceSearchResponse $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getTotal_count(), 123); - } - - /** - * @depends testSerializationDeserialization - * @param InvoiceSearchResponse $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Total_count - $obj->setTotalCount(null); - $this->assertNull($obj->getTotal_count()); - $this->assertNull($obj->getTotalCount()); - $this->assertSame($obj->getTotalCount(), $obj->getTotal_count()); - $obj->setTotal_count(123); - $this->assertEquals($obj->getTotal_count(), 123); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/InvoiceTest.php b/tests/PayPal/Test/Api/InvoiceTest.php index 41b1e3a..9a4a9ce 100644 --- a/tests/PayPal/Test/Api/InvoiceTest.php +++ b/tests/PayPal/Test/Api/InvoiceTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\InvoiceSearchResponse; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\Invoice; /** @@ -103,144 +103,6 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAdditionalData(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Invoice $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getMerchant_info(), MerchantInfoTest::getObject()); - $this->assertEquals($obj->getBilling_info(), BillingInfoTest::getObject()); - $this->assertEquals($obj->getShipping_info(), ShippingInfoTest::getObject()); - $this->assertEquals($obj->getInvoice_date(), "TestSample"); - $this->assertEquals($obj->getPayment_term(), PaymentTermTest::getObject()); - $this->assertEquals($obj->getShipping_cost(), ShippingCostTest::getObject()); - $this->assertEquals($obj->getTax_calculated_after_discount(), true); - $this->assertEquals($obj->getTax_inclusive(), true); - $this->assertEquals($obj->getMerchant_memo(), "TestSample"); - $this->assertEquals($obj->getLogo_url(), "http://www.google.com"); - $this->assertEquals($obj->getTotal_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getPayment_details(), PaymentDetailTest::getObject()); - $this->assertEquals($obj->getRefund_details(), RefundDetailTest::getObject()); - $this->assertEquals($obj->getAdditional_data(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Invoice $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Merchant_info - $obj->setMerchantInfo(null); - $this->assertNull($obj->getMerchant_info()); - $this->assertNull($obj->getMerchantInfo()); - $this->assertSame($obj->getMerchantInfo(), $obj->getMerchant_info()); - $obj->setMerchant_info(MerchantInfoTest::getObject()); - $this->assertEquals($obj->getMerchant_info(), MerchantInfoTest::getObject()); - - // Check for Billing_info - $obj->setBillingInfo(null); - $this->assertNull($obj->getBilling_info()); - $this->assertNull($obj->getBillingInfo()); - $this->assertSame($obj->getBillingInfo(), $obj->getBilling_info()); - $obj->setBilling_info(BillingInfoTest::getObject()); - $this->assertEquals($obj->getBilling_info(), BillingInfoTest::getObject()); - - // Check for Shipping_info - $obj->setShippingInfo(null); - $this->assertNull($obj->getShipping_info()); - $this->assertNull($obj->getShippingInfo()); - $this->assertSame($obj->getShippingInfo(), $obj->getShipping_info()); - $obj->setShipping_info(ShippingInfoTest::getObject()); - $this->assertEquals($obj->getShipping_info(), ShippingInfoTest::getObject()); - - // Check for Invoice_date - $obj->setInvoiceDate(null); - $this->assertNull($obj->getInvoice_date()); - $this->assertNull($obj->getInvoiceDate()); - $this->assertSame($obj->getInvoiceDate(), $obj->getInvoice_date()); - $obj->setInvoice_date("TestSample"); - $this->assertEquals($obj->getInvoice_date(), "TestSample"); - - // Check for Payment_term - $obj->setPaymentTerm(null); - $this->assertNull($obj->getPayment_term()); - $this->assertNull($obj->getPaymentTerm()); - $this->assertSame($obj->getPaymentTerm(), $obj->getPayment_term()); - $obj->setPayment_term(PaymentTermTest::getObject()); - $this->assertEquals($obj->getPayment_term(), PaymentTermTest::getObject()); - - // Check for Shipping_cost - $obj->setShippingCost(null); - $this->assertNull($obj->getShipping_cost()); - $this->assertNull($obj->getShippingCost()); - $this->assertSame($obj->getShippingCost(), $obj->getShipping_cost()); - $obj->setShipping_cost(ShippingCostTest::getObject()); - $this->assertEquals($obj->getShipping_cost(), ShippingCostTest::getObject()); - - // Check for Tax_calculated_after_discount - $obj->setTaxCalculatedAfterDiscount(null); - $this->assertNull($obj->getTax_calculated_after_discount()); - $this->assertNull($obj->getTaxCalculatedAfterDiscount()); - $this->assertSame($obj->getTaxCalculatedAfterDiscount(), $obj->getTax_calculated_after_discount()); - $obj->setTax_calculated_after_discount(true); - $this->assertEquals($obj->getTax_calculated_after_discount(), true); - - // Check for Tax_inclusive - $obj->setTaxInclusive(null); - $this->assertNull($obj->getTax_inclusive()); - $this->assertNull($obj->getTaxInclusive()); - $this->assertSame($obj->getTaxInclusive(), $obj->getTax_inclusive()); - $obj->setTax_inclusive(true); - $this->assertEquals($obj->getTax_inclusive(), true); - - // Check for Merchant_memo - $obj->setMerchantMemo(null); - $this->assertNull($obj->getMerchant_memo()); - $this->assertNull($obj->getMerchantMemo()); - $this->assertSame($obj->getMerchantMemo(), $obj->getMerchant_memo()); - $obj->setMerchant_memo("TestSample"); - $this->assertEquals($obj->getMerchant_memo(), "TestSample"); - - // Check for Total_amount - $obj->setTotalAmount(null); - $this->assertNull($obj->getTotal_amount()); - $this->assertNull($obj->getTotalAmount()); - $this->assertSame($obj->getTotalAmount(), $obj->getTotal_amount()); - $obj->setTotal_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getTotal_amount(), CurrencyTest::getObject()); - - // Check for Payment_details - $obj->setPaymentDetails(null); - $this->assertNull($obj->getPayment_details()); - $this->assertNull($obj->getPaymentDetails()); - $this->assertSame($obj->getPaymentDetails(), $obj->getPayment_details()); - $obj->setPayment_details(PaymentDetailTest::getObject()); - $this->assertEquals($obj->getPayment_details(), PaymentDetailTest::getObject()); - - // Check for Refund_details - $obj->setRefundDetails(null); - $this->assertNull($obj->getRefund_details()); - $this->assertNull($obj->getRefundDetails()); - $this->assertSame($obj->getRefundDetails(), $obj->getRefund_details()); - $obj->setRefund_details(RefundDetailTest::getObject()); - $this->assertEquals($obj->getRefund_details(), RefundDetailTest::getObject()); - - // Check for Additional_data - $obj->setAdditionalData(null); - $this->assertNull($obj->getAdditional_data()); - $this->assertNull($obj->getAdditionalData()); - $this->assertSame($obj->getAdditionalData(), $obj->getAdditional_data()); - $obj->setAdditional_data("TestSample"); - $this->assertEquals($obj->getAdditional_data(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage LogoUrl is not a fully qualified URL @@ -251,29 +113,23 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase $obj->setLogoUrl(null); } - public function testUrlValidationForLogoUrlDeprecated() - { - $obj = new Invoice(); - $obj->setLogo_url(null); - $this->assertNull($obj->getLogo_url()); - } /** * @dataProvider mockProvider * @param Invoice $obj */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -282,18 +138,18 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testSearch($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( InvoiceSearchResponseTest::getJson() )); $search = SearchTest::getObject(); - $result = $obj->search($search, $mockApiContext, $mockPPRestCall); + $result = $obj->search($search, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -302,17 +158,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testSend($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->send($mockApiContext, $mockPPRestCall); + $result = $obj->send($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -321,18 +177,18 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testRemind($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $notification = NotificationTest::getObject(); - $result = $obj->remind($notification, $mockApiContext, $mockPPRestCall); + $result = $obj->remind($notification, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -341,18 +197,18 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testCancel($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $cancelNotification = CancelNotificationTest::getObject(); - $result = $obj->cancel($cancelNotification, $mockApiContext, $mockPPRestCall); + $result = $obj->cancel($cancelNotification, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -361,18 +217,18 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testRecordPayment($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $paymentDetail = PaymentDetailTest::getObject(); - $result = $obj->recordPayment($paymentDetail, $mockApiContext, $mockPPRestCall); + $result = $obj->recordPayment($paymentDetail, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -381,18 +237,18 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testRecordRefund($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $refundDetail = RefundDetailTest::getObject(); - $result = $obj->recordRefund($refundDetail, $mockApiContext, $mockPPRestCall); + $result = $obj->recordRefund($refundDetail, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -401,17 +257,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( InvoiceTest::getJson() )); - $result = $obj->get("invoiceId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("invoiceId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -420,17 +276,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testGetAll($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( InvoiceSearchResponseTest::getJson() )); - $result = $obj->getAll(array(), $mockApiContext, $mockPPRestCall); + $result = $obj->getAll(array(), $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -439,17 +295,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->update($mockApiContext, $mockPPRestCall); + $result = $obj->update($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -458,17 +314,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPPRestCall); + $result = $obj->delete($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -477,17 +333,17 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ public function testQrCode($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( ImageTest::getJson() )); - $result = $obj->qrCode("invoiceId", array(), $mockApiContext, $mockPPRestCall); + $result = $obj->qrCode("invoiceId", array(), $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/LinksTest.php b/tests/PayPal/Test/Api/LinksTest.php index 793826e..d9b23c3 100644 --- a/tests/PayPal/Test/Api/LinksTest.php +++ b/tests/PayPal/Test/Api/LinksTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Links; /** @@ -63,26 +63,4 @@ class LinksTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getSchema(), HyperSchemaTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Links $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Links $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/MerchantInfoTest.php b/tests/PayPal/Test/Api/MerchantInfoTest.php index 11186e6..56da4fd 100644 --- a/tests/PayPal/Test/Api/MerchantInfoTest.php +++ b/tests/PayPal/Test/Api/MerchantInfoTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\MerchantInfo; /** @@ -71,71 +71,4 @@ class MerchantInfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAdditionalInfo(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param MerchantInfo $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - $this->assertEquals($obj->getTax_id(), "TestSample"); - $this->assertEquals($obj->getAdditional_info(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param MerchantInfo $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Business_name - $obj->setBusinessName(null); - $this->assertNull($obj->getBusiness_name()); - $this->assertNull($obj->getBusinessName()); - $this->assertSame($obj->getBusinessName(), $obj->getBusiness_name()); - $obj->setBusiness_name("TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - - // Check for Tax_id - $obj->setTaxId(null); - $this->assertNull($obj->getTax_id()); - $this->assertNull($obj->getTaxId()); - $this->assertSame($obj->getTaxId(), $obj->getTax_id()); - $obj->setTax_id("TestSample"); - $this->assertEquals($obj->getTax_id(), "TestSample"); - - // Check for Additional_info - $obj->setAdditionalInfo(null); - $this->assertNull($obj->getAdditional_info()); - $this->assertNull($obj->getAdditionalInfo()); - $this->assertSame($obj->getAdditionalInfo(), $obj->getAdditional_info()); - $obj->setAdditional_info("TestSample"); - $this->assertEquals($obj->getAdditional_info(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/MerchantPreferencesTest.php b/tests/PayPal/Test/Api/MerchantPreferencesTest.php index f7b925e..4583e1c 100644 --- a/tests/PayPal/Test/Api/MerchantPreferencesTest.php +++ b/tests/PayPal/Test/Api/MerchantPreferencesTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\MerchantPreferences; /** @@ -71,83 +71,6 @@ class MerchantPreferencesTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getCharSet(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param MerchantPreferences $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getSetup_fee(), CurrencyTest::getObject()); - $this->assertEquals($obj->getCancel_url(), "http://www.google.com"); - $this->assertEquals($obj->getReturn_url(), "http://www.google.com"); - $this->assertEquals($obj->getNotify_url(), "http://www.google.com"); - $this->assertEquals($obj->getMax_fail_attempts(), "TestSample"); - $this->assertEquals($obj->getAuto_bill_amount(), "TestSample"); - $this->assertEquals($obj->getInitial_fail_amount_action(), "TestSample"); - $this->assertEquals($obj->getAccepted_payment_type(), "TestSample"); - $this->assertEquals($obj->getChar_set(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param MerchantPreferences $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Setup_fee - $obj->setSetupFee(null); - $this->assertNull($obj->getSetup_fee()); - $this->assertNull($obj->getSetupFee()); - $this->assertSame($obj->getSetupFee(), $obj->getSetup_fee()); - $obj->setSetup_fee(CurrencyTest::getObject()); - $this->assertEquals($obj->getSetup_fee(), CurrencyTest::getObject()); - - // Check for Max_fail_attempts - $obj->setMaxFailAttempts(null); - $this->assertNull($obj->getMax_fail_attempts()); - $this->assertNull($obj->getMaxFailAttempts()); - $this->assertSame($obj->getMaxFailAttempts(), $obj->getMax_fail_attempts()); - $obj->setMax_fail_attempts("TestSample"); - $this->assertEquals($obj->getMax_fail_attempts(), "TestSample"); - - // Check for Auto_bill_amount - $obj->setAutoBillAmount(null); - $this->assertNull($obj->getAuto_bill_amount()); - $this->assertNull($obj->getAutoBillAmount()); - $this->assertSame($obj->getAutoBillAmount(), $obj->getAuto_bill_amount()); - $obj->setAuto_bill_amount("TestSample"); - $this->assertEquals($obj->getAuto_bill_amount(), "TestSample"); - - // Check for Initial_fail_amount_action - $obj->setInitialFailAmountAction(null); - $this->assertNull($obj->getInitial_fail_amount_action()); - $this->assertNull($obj->getInitialFailAmountAction()); - $this->assertSame($obj->getInitialFailAmountAction(), $obj->getInitial_fail_amount_action()); - $obj->setInitial_fail_amount_action("TestSample"); - $this->assertEquals($obj->getInitial_fail_amount_action(), "TestSample"); - - // Check for Accepted_payment_type - $obj->setAcceptedPaymentType(null); - $this->assertNull($obj->getAccepted_payment_type()); - $this->assertNull($obj->getAcceptedPaymentType()); - $this->assertSame($obj->getAcceptedPaymentType(), $obj->getAccepted_payment_type()); - $obj->setAccepted_payment_type("TestSample"); - $this->assertEquals($obj->getAccepted_payment_type(), "TestSample"); - - // Check for Char_set - $obj->setCharSet(null); - $this->assertNull($obj->getChar_set()); - $this->assertNull($obj->getCharSet()); - $this->assertSame($obj->getCharSet(), $obj->getChar_set()); - $obj->setChar_set("TestSample"); - $this->assertEquals($obj->getChar_set(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage CancelUrl is not a fully qualified URL @@ -179,20 +102,20 @@ class MerchantPreferencesTest extends \PHPUnit_Framework_TestCase public function testUrlValidationForCancelUrlDeprecated() { $obj = new MerchantPreferences(); - $obj->setCancel_url(null); - $this->assertNull($obj->getCancel_url()); + $obj->setCancelUrl(null); + $this->assertNull($obj->getCancelUrl()); } public function testUrlValidationForReturnUrlDeprecated() { $obj = new MerchantPreferences(); - $obj->setReturn_url(null); - $this->assertNull($obj->getReturn_url()); + $obj->setReturnUrl(null); + $this->assertNull($obj->getReturnUrl()); } public function testUrlValidationForNotifyUrlDeprecated() { $obj = new MerchantPreferences(); - $obj->setNotify_url(null); - $this->assertNull($obj->getNotify_url()); + $obj->setNotifyUrl(null); + $this->assertNull($obj->getNotifyUrl()); } } diff --git a/tests/PayPal/Test/Api/MetadataTest.php b/tests/PayPal/Test/Api/MetadataTest.php index bce0d61..47f2835 100644 --- a/tests/PayPal/Test/Api/MetadataTest.php +++ b/tests/PayPal/Test/Api/MetadataTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Metadata; /** @@ -71,108 +71,6 @@ class MetadataTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPayerViewUrl(), "http://www.google.com"); } - /** - * @depends testSerializationDeserialization - * @param Metadata $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCreated_date(), "TestSample"); - $this->assertEquals($obj->getCreated_by(), "TestSample"); - $this->assertEquals($obj->getCancelled_date(), "TestSample"); - $this->assertEquals($obj->getCancelled_by(), "TestSample"); - $this->assertEquals($obj->getLast_updated_date(), "TestSample"); - $this->assertEquals($obj->getLast_updated_by(), "TestSample"); - $this->assertEquals($obj->getFirst_sent_date(), "TestSample"); - $this->assertEquals($obj->getLast_sent_date(), "TestSample"); - $this->assertEquals($obj->getLast_sent_by(), "TestSample"); - $this->assertEquals($obj->getPayer_view_url(), "http://www.google.com"); - } - - /** - * @depends testSerializationDeserialization - * @param Metadata $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Created_date - $obj->setCreatedDate(null); - $this->assertNull($obj->getCreated_date()); - $this->assertNull($obj->getCreatedDate()); - $this->assertSame($obj->getCreatedDate(), $obj->getCreated_date()); - $obj->setCreated_date("TestSample"); - $this->assertEquals($obj->getCreated_date(), "TestSample"); - - // Check for Created_by - $obj->setCreatedBy(null); - $this->assertNull($obj->getCreated_by()); - $this->assertNull($obj->getCreatedBy()); - $this->assertSame($obj->getCreatedBy(), $obj->getCreated_by()); - $obj->setCreated_by("TestSample"); - $this->assertEquals($obj->getCreated_by(), "TestSample"); - - // Check for Cancelled_date - $obj->setCancelledDate(null); - $this->assertNull($obj->getCancelled_date()); - $this->assertNull($obj->getCancelledDate()); - $this->assertSame($obj->getCancelledDate(), $obj->getCancelled_date()); - $obj->setCancelled_date("TestSample"); - $this->assertEquals($obj->getCancelled_date(), "TestSample"); - - // Check for Cancelled_by - $obj->setCancelledBy(null); - $this->assertNull($obj->getCancelled_by()); - $this->assertNull($obj->getCancelledBy()); - $this->assertSame($obj->getCancelledBy(), $obj->getCancelled_by()); - $obj->setCancelled_by("TestSample"); - $this->assertEquals($obj->getCancelled_by(), "TestSample"); - - // Check for Last_updated_date - $obj->setLastUpdatedDate(null); - $this->assertNull($obj->getLast_updated_date()); - $this->assertNull($obj->getLastUpdatedDate()); - $this->assertSame($obj->getLastUpdatedDate(), $obj->getLast_updated_date()); - $obj->setLast_updated_date("TestSample"); - $this->assertEquals($obj->getLast_updated_date(), "TestSample"); - - // Check for Last_updated_by - $obj->setLastUpdatedBy(null); - $this->assertNull($obj->getLast_updated_by()); - $this->assertNull($obj->getLastUpdatedBy()); - $this->assertSame($obj->getLastUpdatedBy(), $obj->getLast_updated_by()); - $obj->setLast_updated_by("TestSample"); - $this->assertEquals($obj->getLast_updated_by(), "TestSample"); - - // Check for First_sent_date - $obj->setFirstSentDate(null); - $this->assertNull($obj->getFirst_sent_date()); - $this->assertNull($obj->getFirstSentDate()); - $this->assertSame($obj->getFirstSentDate(), $obj->getFirst_sent_date()); - $obj->setFirst_sent_date("TestSample"); - $this->assertEquals($obj->getFirst_sent_date(), "TestSample"); - - // Check for Last_sent_date - $obj->setLastSentDate(null); - $this->assertNull($obj->getLast_sent_date()); - $this->assertNull($obj->getLastSentDate()); - $this->assertSame($obj->getLastSentDate(), $obj->getLast_sent_date()); - $obj->setLast_sent_date("TestSample"); - $this->assertEquals($obj->getLast_sent_date(), "TestSample"); - - // Check for Last_sent_by - $obj->setLastSentBy(null); - $this->assertNull($obj->getLast_sent_by()); - $this->assertNull($obj->getLastSentBy()); - $this->assertSame($obj->getLastSentBy(), $obj->getLast_sent_by()); - $obj->setLast_sent_by("TestSample"); - $this->assertEquals($obj->getLast_sent_by(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage PayerViewUrl is not a fully qualified URL diff --git a/tests/PayPal/Test/Api/NotificationTest.php b/tests/PayPal/Test/Api/NotificationTest.php index 8b9bebe..a89e6f4 100644 --- a/tests/PayPal/Test/Api/NotificationTest.php +++ b/tests/PayPal/Test/Api/NotificationTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Notification; /** @@ -57,35 +57,5 @@ class NotificationTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getSendToMerchant(), true); } - /** - * @depends testSerializationDeserialization - * @param Notification $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getSend_to_merchant(), true); - } - - /** - * @depends testSerializationDeserialization - * @param Notification $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Send_to_merchant - $obj->setSendToMerchant(null); - $this->assertNull($obj->getSend_to_merchant()); - $this->assertNull($obj->getSendToMerchant()); - $this->assertSame($obj->getSendToMerchant(), $obj->getSend_to_merchant()); - $obj->setSend_to_merchant(true); - $this->assertEquals($obj->getSend_to_merchant(), true); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - } diff --git a/tests/PayPal/Test/Auth/Openid/PPOpenIdAddressTest.php b/tests/PayPal/Test/Api/OpenIdAddressTest.php similarity index 77% rename from tests/PayPal/Test/Auth/Openid/PPOpenIdAddressTest.php rename to tests/PayPal/Test/Api/OpenIdAddressTest.php index 8875296..1079d34 100644 --- a/tests/PayPal/Test/Auth/Openid/PPOpenIdAddressTest.php +++ b/tests/PayPal/Test/Api/OpenIdAddressTest.php @@ -1,14 +1,16 @@ setCountry("US")->setLocality("San Jose") ->setPostalCode("95112")->setRegion("CA") ->setStreetAddress("1, North 1'st street"); @@ -42,7 +44,7 @@ class PPOpenIdAddressTest extends \PHPUnit_Framework_TestCase */ public function testSerializationDeserialization() { - $addrCopy = new PPOpenIdAddress(); + $addrCopy = new OpenIdAddress(); $addrCopy->fromJson($this->addr->toJson()); $this->assertEquals($this->addr, $addrCopy); diff --git a/tests/PayPal/Test/Auth/Openid/PPOpenIdErrorTest.php b/tests/PayPal/Test/Api/OpenIdErrorTest.php similarity index 75% rename from tests/PayPal/Test/Auth/Openid/PPOpenIdErrorTest.php rename to tests/PayPal/Test/Api/OpenIdErrorTest.php index 635d329..1d938c3 100644 --- a/tests/PayPal/Test/Auth/Openid/PPOpenIdErrorTest.php +++ b/tests/PayPal/Test/Api/OpenIdErrorTest.php @@ -1,15 +1,17 @@ error = new PPOpenIdError(); + $this->error = new OpenIdError(); $this->error->setErrorDescription('error description') ->setErrorUri('http://developer.paypal.com/api/error') ->setError('VALIDATION_ERROR'); @@ -37,7 +39,7 @@ class PPOpenIdErrorTest extends PHPUnit_Framework_TestCase */ public function testSerializationDeserialization() { - $errorCopy = new PPOpenIdError(); + $errorCopy = new OpenIdError(); $errorCopy->fromJson($this->error->toJson()); $this->assertEquals($this->error, $errorCopy); diff --git a/tests/PayPal/Test/Auth/Openid/PPOpenIdSessionTest.php b/tests/PayPal/Test/Api/OpenIdSessionTest.php similarity index 75% rename from tests/PayPal/Test/Auth/Openid/PPOpenIdSessionTest.php rename to tests/PayPal/Test/Api/OpenIdSessionTest.php index 862a532..ee209f9 100644 --- a/tests/PayPal/Test/Auth/Openid/PPOpenIdSessionTest.php +++ b/tests/PayPal/Test/Api/OpenIdSessionTest.php @@ -1,12 +1,15 @@ context = new \PayPal\Rest\ApiContext(); + $this->context = new ApiContext(); $this->context->setConfig( array( 'acct1.ClientId' => 'DummyId', @@ -49,16 +52,16 @@ class PPOpenIdSessionTest extends \PHPUnit_Framework_TestCase $expectedBaseUrl = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"; $this->assertEquals($expectedBaseUrl . "?client_id=$clientId&response_type=code&scope=this+that+and+more+openid&redirect_uri=" . urlencode($redirectUri), - PPOpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - custom scope"); + OpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - custom scope"); $scope = array(); $this->assertEquals($expectedBaseUrl . "?client_id=$clientId&response_type=code&scope=openid+profile+address+email+phone+" . urlencode("https://uri.paypal.com/services/paypalattributes") . "+" . urlencode('https://uri.paypal.com/services/expresscheckout') . "&redirect_uri=" . urlencode($redirectUri), - PPOpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - default scope"); + OpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - default scope"); $scope = array('openid'); $this->assertEquals($expectedBaseUrl . "?client_id=$clientId&response_type=code&scope=openid&redirect_uri=" . urlencode($redirectUri), - PPOpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - openid scope"); + OpenIdSession::getAuthorizationUrl($redirectUri, $scope, $clientId), "Failed case - openid scope"); } /** @@ -73,7 +76,7 @@ class PPOpenIdSessionTest extends \PHPUnit_Framework_TestCase $expectedBaseUrl = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"; $this->assertEquals($expectedBaseUrl . "?client_id=DummyId&response_type=code&scope=this+that+and+more+openid&redirect_uri=" . urlencode($redirectUri), - PPOpenIdSession::getAuthorizationUrl($redirectUri, $scope, "DummyId", null, null, $this->context), "Failed case - custom config"); + OpenIdSession::getAuthorizationUrl($redirectUri, $scope, "DummyId", null, null, $this->context), "Failed case - custom config"); } /** @@ -88,6 +91,6 @@ class PPOpenIdSessionTest extends \PHPUnit_Framework_TestCase $expectedBaseUrl = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/endsession"; $this->assertEquals($expectedBaseUrl . "?id_token=$idToken&redirect_uri=" . urlencode($redirectUri) . "&logout=true", - PPOpenIdSession::getLogoutUrl($redirectUri, $idToken, $this->context), "Failed case - custom config"); + OpenIdSession::getLogoutUrl($redirectUri, $idToken, $this->context), "Failed case - custom config"); } } diff --git a/tests/PayPal/Test/Auth/Openid/PPOpenIdTokeninfoTest.php b/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php similarity index 82% rename from tests/PayPal/Test/Auth/Openid/PPOpenIdTokeninfoTest.php rename to tests/PayPal/Test/Api/OpenIdTokeninfoTest.php index 54e90dc..e22f431 100644 --- a/tests/PayPal/Test/Auth/Openid/PPOpenIdTokeninfoTest.php +++ b/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php @@ -1,14 +1,16 @@ token = new PPOpenIdTokeninfo(); + $this->token = new OpenIdTokeninfo(); $this->token->setAccessToken("Access token") ->setExpiresIn(900) ->setRefreshToken("Refresh token") @@ -39,7 +41,7 @@ class PPOpenIdTokeninfoTest extends \PHPUnit_Framework_TestCase */ public function testSerializationDeserialization() { - $tokenCopy = new PPOpenIdTokeninfo(); + $tokenCopy = new OpenIdTokeninfo(); $tokenCopy->fromJson($this->token->toJson()); $this->assertEquals($this->token, $tokenCopy); @@ -61,7 +63,7 @@ class PPOpenIdTokeninfoTest extends \PHPUnit_Framework_TestCase 'client_id' => $clientId, 'client_secret' => $clientSecret ); - $accessToken = PPOpenIdTokeninfo::createFromAuthorizationCode($params); + $accessToken = OpenIdTokeninfo::createFromAuthorizationCode($params); $this->assertNotNull($accessToken); $params = array( diff --git a/tests/PayPal/Test/Auth/Openid/PPOpenIdUserinfoTest.php b/tests/PayPal/Test/Api/OpenIdUserinfoTest.php similarity index 74% rename from tests/PayPal/Test/Auth/Openid/PPOpenIdUserinfoTest.php rename to tests/PayPal/Test/Api/OpenIdUserinfoTest.php index 0775177..8c543b1 100644 --- a/tests/PayPal/Test/Auth/Openid/PPOpenIdUserinfoTest.php +++ b/tests/PayPal/Test/Api/OpenIdUserinfoTest.php @@ -1,11 +1,14 @@ setAccountType("PERSONAL")->setAgeRange("20-30")->setBirthday("1970-01-01") ->setEmail("me@email.com")->setEmailVerified(true) ->setFamilyName("Doe")->setMiddleName("A")->setGivenName("John") @@ -41,9 +44,9 @@ class PPOpenIdUserinfoTest extends \PHPUnit_Framework_TestCase ->setSub("me@email.com")->setUserId("userId") ->setVerified(true)->setVerifiedAccount(true) ->setZoneinfo("America/PST")->setLanguage('en_US') - ->setAddress(PPOpenIdAddressTest::getTestData()); + ->setAddress(OpenIdAddressTest::getTestData()); - $userCopy = new PPOpenIdUserinfo(); + $userCopy = new OpenIdUserinfo(); $userCopy->fromJson($user->toJSON()); $this->assertEquals($user, $userCopy); @@ -54,7 +57,7 @@ class PPOpenIdUserinfoTest extends \PHPUnit_Framework_TestCase */ public function testInvalidParamUserInfoCall() { - $this->setExpectedException('PayPal\Exception\PPConnectionException'); - PPOpenIdUserinfo::getUserinfo(array('access_token' => 'accessToken')); + $this->setExpectedException('PayPal\Exception\PayPalConnectionException'); + OpenIdUserinfo::getUserinfo(array('access_token' => 'accessToken')); } } diff --git a/tests/PayPal/Test/Api/OverrideChargeModelTest.php b/tests/PayPal/Test/Api/OverrideChargeModelTest.php index c12d22b..4271fc9 100644 --- a/tests/PayPal/Test/Api/OverrideChargeModelTest.php +++ b/tests/PayPal/Test/Api/OverrideChargeModelTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\OverrideChargeModel; /** @@ -55,35 +55,4 @@ class OverrideChargeModelTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param OverrideChargeModel $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCharge_id(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param OverrideChargeModel $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Charge_id - $obj->setChargeId(null); - $this->assertNull($obj->getCharge_id()); - $this->assertNull($obj->getChargeId()); - $this->assertSame($obj->getChargeId(), $obj->getCharge_id()); - $obj->setCharge_id("TestSample"); - $this->assertEquals($obj->getCharge_id(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PatchRequestTest.php b/tests/PayPal/Test/Api/PatchRequestTest.php index 6c40b6a..d14c040 100644 --- a/tests/PayPal/Test/Api/PatchRequestTest.php +++ b/tests/PayPal/Test/Api/PatchRequestTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PatchRequest; /** @@ -52,26 +52,4 @@ class PatchRequestTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPatches(), PatchTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param PatchRequest $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param PatchRequest $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PatchTest.php b/tests/PayPal/Test/Api/PatchTest.php index b9f597c..42e0855 100644 --- a/tests/PayPal/Test/Api/PatchTest.php +++ b/tests/PayPal/Test/Api/PatchTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Patch; /** @@ -59,26 +59,4 @@ class PatchTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getFrom(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Patch $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Patch $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PayerInfoTest.php b/tests/PayPal/Test/Api/PayerInfoTest.php index 49c00ef..34342d8 100644 --- a/tests/PayPal/Test/Api/PayerInfoTest.php +++ b/tests/PayPal/Test/Api/PayerInfoTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PayerInfo; /** @@ -77,125 +77,4 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param PayerInfo $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getExternal_remember_me_id(), "TestSample"); - $this->assertEquals($obj->getBuyer_account_number(), "TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - $this->assertEquals($obj->getPhone_type(), "TestSample"); - $this->assertEquals($obj->getBirth_date(), "TestSample"); - $this->assertEquals($obj->getTax_id(), "TestSample"); - $this->assertEquals($obj->getTax_id_type(), "TestSample"); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - $this->assertEquals($obj->getShipping_address(), ShippingAddressTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param PayerInfo $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for External_remember_me_id - $obj->setExternalRememberMeId(null); - $this->assertNull($obj->getExternal_remember_me_id()); - $this->assertNull($obj->getExternalRememberMeId()); - $this->assertSame($obj->getExternalRememberMeId(), $obj->getExternal_remember_me_id()); - $obj->setExternal_remember_me_id("TestSample"); - $this->assertEquals($obj->getExternal_remember_me_id(), "TestSample"); - - // Check for Buyer_account_number - $obj->setBuyerAccountNumber(null); - $this->assertNull($obj->getBuyer_account_number()); - $this->assertNull($obj->getBuyerAccountNumber()); - $this->assertSame($obj->getBuyerAccountNumber(), $obj->getBuyer_account_number()); - $obj->setBuyer_account_number("TestSample"); - $this->assertEquals($obj->getBuyer_account_number(), "TestSample"); - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Payer_id - $obj->setPayerId(null); - $this->assertNull($obj->getPayer_id()); - $this->assertNull($obj->getPayerId()); - $this->assertSame($obj->getPayerId(), $obj->getPayer_id()); - $obj->setPayer_id("TestSample"); - $this->assertEquals($obj->getPayer_id(), "TestSample"); - - // Check for Phone_type - $obj->setPhoneType(null); - $this->assertNull($obj->getPhone_type()); - $this->assertNull($obj->getPhoneType()); - $this->assertSame($obj->getPhoneType(), $obj->getPhone_type()); - $obj->setPhone_type("TestSample"); - $this->assertEquals($obj->getPhone_type(), "TestSample"); - - // Check for Birth_date - $obj->setBirthDate(null); - $this->assertNull($obj->getBirth_date()); - $this->assertNull($obj->getBirthDate()); - $this->assertSame($obj->getBirthDate(), $obj->getBirth_date()); - $obj->setBirth_date("TestSample"); - $this->assertEquals($obj->getBirth_date(), "TestSample"); - - // Check for Tax_id - $obj->setTaxId(null); - $this->assertNull($obj->getTax_id()); - $this->assertNull($obj->getTaxId()); - $this->assertSame($obj->getTaxId(), $obj->getTax_id()); - $obj->setTax_id("TestSample"); - $this->assertEquals($obj->getTax_id(), "TestSample"); - - // Check for Tax_id_type - $obj->setTaxIdType(null); - $this->assertNull($obj->getTax_id_type()); - $this->assertNull($obj->getTaxIdType()); - $this->assertSame($obj->getTaxIdType(), $obj->getTax_id_type()); - $obj->setTax_id_type("TestSample"); - $this->assertEquals($obj->getTax_id_type(), "TestSample"); - - // Check for Billing_address - $obj->setBillingAddress(null); - $this->assertNull($obj->getBilling_address()); - $this->assertNull($obj->getBillingAddress()); - $this->assertSame($obj->getBillingAddress(), $obj->getBilling_address()); - $obj->setBilling_address(AddressTest::getObject()); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - - // Check for Shipping_address - $obj->setShippingAddress(null); - $this->assertNull($obj->getShipping_address()); - $this->assertNull($obj->getShippingAddress()); - $this->assertSame($obj->getShippingAddress(), $obj->getShipping_address()); - $obj->setShipping_address(ShippingAddressTest::getObject()); - $this->assertEquals($obj->getShipping_address(), ShippingAddressTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PayerTest.php b/tests/PayPal/Test/Api/PayerTest.php index f56b32d..3d3a6c4 100644 --- a/tests/PayPal/Test/Api/PayerTest.php +++ b/tests/PayPal/Test/Api/PayerTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Payer; /** @@ -61,62 +61,4 @@ class PayerTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPayerInfo(), PayerInfoTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Payer $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getPayment_method(), "TestSample"); - $this->assertEquals($obj->getFunding_instruments(), FundingInstrumentTest::getObject()); - $this->assertEquals($obj->getFunding_option_id(), "TestSample"); - $this->assertEquals($obj->getPayer_info(), PayerInfoTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param Payer $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Payment_method - $obj->setPaymentMethod(null); - $this->assertNull($obj->getPayment_method()); - $this->assertNull($obj->getPaymentMethod()); - $this->assertSame($obj->getPaymentMethod(), $obj->getPayment_method()); - $obj->setPayment_method("TestSample"); - $this->assertEquals($obj->getPayment_method(), "TestSample"); - - // Check for Funding_instruments - $obj->setFundingInstruments(null); - $this->assertNull($obj->getFunding_instruments()); - $this->assertNull($obj->getFundingInstruments()); - $this->assertSame($obj->getFundingInstruments(), $obj->getFunding_instruments()); - $obj->setFunding_instruments(FundingInstrumentTest::getObject()); - $this->assertEquals($obj->getFunding_instruments(), FundingInstrumentTest::getObject()); - - // Check for Funding_option_id - $obj->setFundingOptionId(null); - $this->assertNull($obj->getFunding_option_id()); - $this->assertNull($obj->getFundingOptionId()); - $this->assertSame($obj->getFundingOptionId(), $obj->getFunding_option_id()); - $obj->setFunding_option_id("TestSample"); - $this->assertEquals($obj->getFunding_option_id(), "TestSample"); - - // Check for Payer_info - $obj->setPayerInfo(null); - $this->assertNull($obj->getPayer_info()); - $this->assertNull($obj->getPayerInfo()); - $this->assertSame($obj->getPayerInfo(), $obj->getPayer_info()); - $obj->setPayer_info(PayerInfoTest::getObject()); - $this->assertEquals($obj->getPayer_info(), PayerInfoTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PaymentCardTest.php b/tests/PayPal/Test/Api/PaymentCardTest.php index 6317de8..e1ba461 100644 --- a/tests/PayPal/Test/Api/PaymentCardTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PaymentCard; /** @@ -81,107 +81,4 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param PaymentCard $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getExpire_month(), 123); - $this->assertEquals($obj->getExpire_year(), 123); - $this->assertEquals($obj->getStart_month(), 123); - $this->assertEquals($obj->getStart_year(), 123); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param PaymentCard $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Expire_month - $obj->setExpireMonth(null); - $this->assertNull($obj->getExpire_month()); - $this->assertNull($obj->getExpireMonth()); - $this->assertSame($obj->getExpireMonth(), $obj->getExpire_month()); - $obj->setExpire_month(123); - $this->assertEquals($obj->getExpire_month(), 123); - - // Check for Expire_year - $obj->setExpireYear(null); - $this->assertNull($obj->getExpire_year()); - $this->assertNull($obj->getExpireYear()); - $this->assertSame($obj->getExpireYear(), $obj->getExpire_year()); - $obj->setExpire_year(123); - $this->assertEquals($obj->getExpire_year(), 123); - - // Check for Start_month - $obj->setStartMonth(null); - $this->assertNull($obj->getStart_month()); - $this->assertNull($obj->getStartMonth()); - $this->assertSame($obj->getStartMonth(), $obj->getStart_month()); - $obj->setStart_month(123); - $this->assertEquals($obj->getStart_month(), 123); - - // Check for Start_year - $obj->setStartYear(null); - $this->assertNull($obj->getStart_year()); - $this->assertNull($obj->getStartYear()); - $this->assertSame($obj->getStartYear(), $obj->getStart_year()); - $obj->setStart_year(123); - $this->assertEquals($obj->getStart_year(), 123); - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Billing_address - $obj->setBillingAddress(null); - $this->assertNull($obj->getBilling_address()); - $this->assertNull($obj->getBillingAddress()); - $this->assertSame($obj->getBillingAddress(), $obj->getBilling_address()); - $obj->setBilling_address(AddressTest::getObject()); - $this->assertEquals($obj->getBilling_address(), AddressTest::getObject()); - - // Check for External_customer_id - $obj->setExternalCustomerId(null); - $this->assertNull($obj->getExternal_customer_id()); - $this->assertNull($obj->getExternalCustomerId()); - $this->assertSame($obj->getExternalCustomerId(), $obj->getExternal_customer_id()); - $obj->setExternal_customer_id("TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - - // Check for Valid_until - $obj->setValidUntil(null); - $this->assertNull($obj->getValid_until()); - $this->assertNull($obj->getValidUntil()); - $this->assertSame($obj->getValidUntil(), $obj->getValid_until()); - $obj->setValid_until("TestSample"); - $this->assertEquals($obj->getValid_until(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PaymentCardTokenTest.php b/tests/PayPal/Test/Api/PaymentCardTokenTest.php index ffed8f5..2001330 100644 --- a/tests/PayPal/Test/Api/PaymentCardTokenTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTokenTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PaymentCardToken; /** @@ -63,62 +63,4 @@ class PaymentCardTokenTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getExpireYear(), 123); } - /** - * @depends testSerializationDeserialization - * @param PaymentCardToken $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getPayment_card_id(), "TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - $this->assertEquals($obj->getExpire_month(), 123); - $this->assertEquals($obj->getExpire_year(), 123); - } - - /** - * @depends testSerializationDeserialization - * @param PaymentCardToken $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Payment_card_id - $obj->setPaymentCardId(null); - $this->assertNull($obj->getPayment_card_id()); - $this->assertNull($obj->getPaymentCardId()); - $this->assertSame($obj->getPaymentCardId(), $obj->getPayment_card_id()); - $obj->setPayment_card_id("TestSample"); - $this->assertEquals($obj->getPayment_card_id(), "TestSample"); - - // Check for External_customer_id - $obj->setExternalCustomerId(null); - $this->assertNull($obj->getExternal_customer_id()); - $this->assertNull($obj->getExternalCustomerId()); - $this->assertSame($obj->getExternalCustomerId(), $obj->getExternal_customer_id()); - $obj->setExternal_customer_id("TestSample"); - $this->assertEquals($obj->getExternal_customer_id(), "TestSample"); - - // Check for Expire_month - $obj->setExpireMonth(null); - $this->assertNull($obj->getExpire_month()); - $this->assertNull($obj->getExpireMonth()); - $this->assertSame($obj->getExpireMonth(), $obj->getExpire_month()); - $obj->setExpire_month(123); - $this->assertEquals($obj->getExpire_month(), 123); - - // Check for Expire_year - $obj->setExpireYear(null); - $this->assertNull($obj->getExpire_year()); - $this->assertNull($obj->getExpireYear()); - $this->assertSame($obj->getExpireYear(), $obj->getExpire_year()); - $obj->setExpire_year(123); - $this->assertEquals($obj->getExpire_year(), 123); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PaymentDefinitionTest.php b/tests/PayPal/Test/Api/PaymentDefinitionTest.php index 3a05c76..fee1bbd 100644 --- a/tests/PayPal/Test/Api/PaymentDefinitionTest.php +++ b/tests/PayPal/Test/Api/PaymentDefinitionTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PaymentDefinition; /** @@ -67,44 +67,4 @@ class PaymentDefinitionTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getChargeModels(), ChargeModelTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param PaymentDefinition $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getFrequency_interval(), "TestSample"); - $this->assertEquals($obj->getCharge_models(), ChargeModelTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param PaymentDefinition $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Frequency_interval - $obj->setFrequencyInterval(null); - $this->assertNull($obj->getFrequency_interval()); - $this->assertNull($obj->getFrequencyInterval()); - $this->assertSame($obj->getFrequencyInterval(), $obj->getFrequency_interval()); - $obj->setFrequency_interval("TestSample"); - $this->assertEquals($obj->getFrequency_interval(), "TestSample"); - - // Check for Charge_models - $obj->setChargeModels(null); - $this->assertNull($obj->getCharge_models()); - $this->assertNull($obj->getChargeModels()); - $this->assertSame($obj->getChargeModels(), $obj->getCharge_models()); - $obj->setCharge_models(ChargeModelTest::getObject()); - $this->assertEquals($obj->getCharge_models(), ChargeModelTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PaymentDetailTest.php b/tests/PayPal/Test/Api/PaymentDetailTest.php index a01e533..fe0aa76 100644 --- a/tests/PayPal/Test/Api/PaymentDetailTest.php +++ b/tests/PayPal/Test/Api/PaymentDetailTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PaymentDetail; /** @@ -63,44 +63,4 @@ class PaymentDetailTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getNote(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param PaymentDetail $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getTransaction_id(), "TestSample"); - $this->assertEquals($obj->getTransaction_type(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param PaymentDetail $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Transaction_id - $obj->setTransactionId(null); - $this->assertNull($obj->getTransaction_id()); - $this->assertNull($obj->getTransactionId()); - $this->assertSame($obj->getTransactionId(), $obj->getTransaction_id()); - $obj->setTransaction_id("TestSample"); - $this->assertEquals($obj->getTransaction_id(), "TestSample"); - - // Check for Transaction_type - $obj->setTransactionType(null); - $this->assertNull($obj->getTransaction_type()); - $this->assertNull($obj->getTransactionType()); - $this->assertSame($obj->getTransactionType(), $obj->getTransaction_type()); - $obj->setTransaction_type("TestSample"); - $this->assertEquals($obj->getTransaction_type(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PaymentTermTest.php b/tests/PayPal/Test/Api/PaymentTermTest.php index 0cd8e73..fcddfee 100644 --- a/tests/PayPal/Test/Api/PaymentTermTest.php +++ b/tests/PayPal/Test/Api/PaymentTermTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PaymentTerm; /** @@ -54,45 +54,5 @@ class PaymentTermTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getTermType(), "TestSample"); $this->assertEquals($obj->getDueDate(), "TestSample"); } - - /** - * @depends testSerializationDeserialization - * @param PaymentTerm $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getTerm_type(), "TestSample"); - $this->assertEquals($obj->getDue_date(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param PaymentTerm $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Term_type - $obj->setTermType(null); - $this->assertNull($obj->getTerm_type()); - $this->assertNull($obj->getTermType()); - $this->assertSame($obj->getTermType(), $obj->getTerm_type()); - $obj->setTerm_type("TestSample"); - $this->assertEquals($obj->getTerm_type(), "TestSample"); - - // Check for Due_date - $obj->setDueDate(null); - $this->assertNull($obj->getDue_date()); - $this->assertNull($obj->getDueDate()); - $this->assertSame($obj->getDueDate(), $obj->getDue_date()); - $obj->setDue_date("TestSample"); - $this->assertEquals($obj->getDue_date(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - + } diff --git a/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php b/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php new file mode 100644 index 0000000..8f8cca5 --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php @@ -0,0 +1,72 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getPayoutBatchId()); + $this->assertNotNull($obj->getBatchStatus()); + $this->assertNotNull($obj->getTimeCreated()); + $this->assertNotNull($obj->getTimeCompleted()); + $this->assertNotNull($obj->getSenderBatchHeader()); + $this->assertNotNull($obj->getAmount()); + $this->assertNotNull($obj->getFees()); + $this->assertNotNull($obj->getErrors()); + $this->assertNotNull($obj->getLinks()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param PayoutBatchHeader $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getPayoutBatchId(), "TestSample"); + $this->assertEquals($obj->getBatchStatus(), "TestSample"); + $this->assertEquals($obj->getTimeCreated(), "TestSample"); + $this->assertEquals($obj->getTimeCompleted(), "TestSample"); + $this->assertEquals($obj->getSenderBatchHeader(), PayoutSenderBatchHeaderTest::getObject()); + $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); + $this->assertEquals($obj->getFees(), CurrencyTest::getObject()); + $this->assertEquals($obj->getErrors(), ErrorTest::getObject()); + $this->assertEquals($obj->getLinks(), LinksTest::getObject()); + } + +} diff --git a/tests/PayPal/Test/Api/PayoutBatchTest.php b/tests/PayPal/Test/Api/PayoutBatchTest.php new file mode 100644 index 0000000..bf7c9c2 --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutBatchTest.php @@ -0,0 +1,58 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getBatchHeader()); + $this->assertNotNull($obj->getItems()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param PayoutBatch $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getBatchHeader(), PayoutBatchHeaderTest::getObject()); + $this->assertEquals($obj->getItems(), PayoutItemDetailsTest::getObject()); + } + +} diff --git a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php new file mode 100644 index 0000000..64a02a1 --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php @@ -0,0 +1,74 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getPayoutItemId()); + $this->assertNotNull($obj->getTransactionId()); + $this->assertNotNull($obj->getTransactionStatus()); + $this->assertNotNull($obj->getPayoutItemFee()); + $this->assertNotNull($obj->getPayoutBatchId()); + $this->assertNotNull($obj->getSenderBatchId()); + $this->assertNotNull($obj->getPayoutItem()); + $this->assertNotNull($obj->getTimeProcessed()); + $this->assertNotNull($obj->getErrors()); + $this->assertNotNull($obj->getLinks()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param PayoutItemDetails $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getPayoutItemId(), "TestSample"); + $this->assertEquals($obj->getTransactionId(), "TestSample"); + $this->assertEquals($obj->getTransactionStatus(), "TestSample"); + $this->assertEquals($obj->getPayoutItemFee(), CurrencyTest::getObject()); + $this->assertEquals($obj->getPayoutBatchId(), "TestSample"); + $this->assertEquals($obj->getSenderBatchId(), "TestSample"); + $this->assertEquals($obj->getPayoutItem(), PayoutItemTest::getObject()); + $this->assertEquals($obj->getTimeProcessed(), "TestSample"); + $this->assertEquals($obj->getErrors(), ErrorTest::getObject()); + $this->assertEquals($obj->getLinks(), LinksTest::getObject()); + } + +} diff --git a/tests/PayPal/Test/Api/PayoutItemTest.php b/tests/PayPal/Test/Api/PayoutItemTest.php new file mode 100644 index 0000000..b479c64 --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutItemTest.php @@ -0,0 +1,99 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getRecipientType()); + $this->assertNotNull($obj->getAmount()); + $this->assertNotNull($obj->getNote()); + $this->assertNotNull($obj->getReceiver()); + $this->assertNotNull($obj->getSenderItemId()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param PayoutItem $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getRecipientType(), "TestSample"); + $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); + $this->assertEquals($obj->getNote(), "TestSample"); + $this->assertEquals($obj->getReceiver(), "TestSample"); + $this->assertEquals($obj->getSenderItemId(), "TestSample"); + } + + /** + * @dataProvider mockProvider + * @param PayoutItem $obj + */ + public function testGet($obj, $mockApiContext) + { + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + ->disableOriginalConstructor() + ->getMock(); + + $mockPPRestCall->expects($this->any()) + ->method('execute') + ->will($this->returnValue( + PayoutItemDetailsTest::getJson() + )); + + $result = $obj->get("payoutItemId", $mockApiContext, $mockPPRestCall); + $this->assertNotNull($result); + } + + public function mockProvider() + { + $obj = self::getObject(); + $mockApiContext = $this->getMockBuilder('ApiContext') + ->disableOriginalConstructor() + ->getMock(); + return array( + array($obj, $mockApiContext), + array($obj, null) + ); + } +} diff --git a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php new file mode 100644 index 0000000..f3fbf0f --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php @@ -0,0 +1,60 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getSenderBatchId()); + $this->assertNotNull($obj->getEmailSubject()); + $this->assertNotNull($obj->getRecipientType()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param PayoutSenderBatchHeader $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getSenderBatchId(), "TestSample"); + $this->assertEquals($obj->getEmailSubject(), "TestSample"); + $this->assertEquals($obj->getRecipientType(), "TestSample"); + } + +} diff --git a/tests/PayPal/Test/Api/PayoutTest.php b/tests/PayPal/Test/Api/PayoutTest.php new file mode 100644 index 0000000..155e12e --- /dev/null +++ b/tests/PayPal/Test/Api/PayoutTest.php @@ -0,0 +1,110 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getSenderBatchHeader()); + $this->assertNotNull($obj->getItems()); + $this->assertNotNull($obj->getLinks()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param Payout $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getSenderBatchHeader(), PayoutSenderBatchHeaderTest::getObject()); + $this->assertEquals($obj->getItems(), PayoutItemTest::getObject()); + $this->assertEquals($obj->getLinks(), LinksTest::getObject()); + } + + /** + * @dataProvider mockProvider + * @param Payout $obj + */ + public function testCreate($obj, $mockApiContext) + { + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + ->disableOriginalConstructor() + ->getMock(); + + $mockPPRestCall->expects($this->any()) + ->method('execute') + ->will($this->returnValue( + PayoutBatchTest::getJson() + )); + $params = array(); + + $result = $obj->create($params, $mockApiContext, $mockPPRestCall); + $this->assertNotNull($result); + } + /** + * @dataProvider mockProvider + * @param Payout $obj + */ + public function testGet($obj, $mockApiContext) + { + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + ->disableOriginalConstructor() + ->getMock(); + + $mockPPRestCall->expects($this->any()) + ->method('execute') + ->will($this->returnValue( + PayoutBatchTest::getJson() + )); + + $result = $obj->get("payoutBatchId", $mockApiContext, $mockPPRestCall); + $this->assertNotNull($result); + } + + public function mockProvider() + { + $obj = self::getObject(); + $mockApiContext = $this->getMockBuilder('ApiContext') + ->disableOriginalConstructor() + ->getMock(); + return array( + array($obj, $mockApiContext), + array($obj, null) + ); + } +} diff --git a/tests/PayPal/Test/Api/PhoneTest.php b/tests/PayPal/Test/Api/PhoneTest.php index 00ce876..aca488d 100644 --- a/tests/PayPal/Test/Api/PhoneTest.php +++ b/tests/PayPal/Test/Api/PhoneTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Phone; /** @@ -55,44 +55,4 @@ class PhoneTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getNationalNumber(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Phone $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCountry_code(), "TestSample"); - $this->assertEquals($obj->getNational_number(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Phone $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Country_code - $obj->setCountryCode(null); - $this->assertNull($obj->getCountry_code()); - $this->assertNull($obj->getCountryCode()); - $this->assertSame($obj->getCountryCode(), $obj->getCountry_code()); - $obj->setCountry_code("TestSample"); - $this->assertEquals($obj->getCountry_code(), "TestSample"); - - // Check for National_number - $obj->setNationalNumber(null); - $this->assertNull($obj->getNational_number()); - $this->assertNull($obj->getNationalNumber()); - $this->assertSame($obj->getNationalNumber(), $obj->getNational_number()); - $obj->setNational_number("TestSample"); - $this->assertEquals($obj->getNational_number(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PlanListTest.php b/tests/PayPal/Test/Api/PlanListTest.php index 7649bec..3301e57 100644 --- a/tests/PayPal/Test/Api/PlanListTest.php +++ b/tests/PayPal/Test/Api/PlanListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\PlanList; /** @@ -59,44 +59,4 @@ class PlanListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param PlanList $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getTotal_items(), "TestSample"); - $this->assertEquals($obj->getTotal_pages(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param PlanList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Total_items - $obj->setTotalItems(null); - $this->assertNull($obj->getTotal_items()); - $this->assertNull($obj->getTotalItems()); - $this->assertSame($obj->getTotalItems(), $obj->getTotal_items()); - $obj->setTotal_items("TestSample"); - $this->assertEquals($obj->getTotal_items(), "TestSample"); - - // Check for Total_pages - $obj->setTotalPages(null); - $this->assertNull($obj->getTotal_pages()); - $this->assertNull($obj->getTotalPages()); - $this->assertSame($obj->getTotalPages(), $obj->getTotal_pages()); - $obj->setTotal_pages("TestSample"); - $this->assertEquals($obj->getTotal_pages(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/PlanTest.php b/tests/PayPal/Test/Api/PlanTest.php index d295086..82ba1bb 100644 --- a/tests/PayPal/Test/Api/PlanTest.php +++ b/tests/PayPal/Test/Api/PlanTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\PlanList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\Plan; /** @@ -77,80 +77,23 @@ class PlanTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Plan $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCreate_time(), "TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - $this->assertEquals($obj->getPayment_definitions(), PaymentDefinitionTest::getObject()); - $this->assertEquals($obj->getMerchant_preferences(), MerchantPreferencesTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param Plan $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Create_time - $obj->setCreateTime(null); - $this->assertNull($obj->getCreate_time()); - $this->assertNull($obj->getCreateTime()); - $this->assertSame($obj->getCreateTime(), $obj->getCreate_time()); - $obj->setCreate_time("TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - - // Check for Update_time - $obj->setUpdateTime(null); - $this->assertNull($obj->getUpdate_time()); - $this->assertNull($obj->getUpdateTime()); - $this->assertSame($obj->getUpdateTime(), $obj->getUpdate_time()); - $obj->setUpdate_time("TestSample"); - $this->assertEquals($obj->getUpdate_time(), "TestSample"); - - // Check for Payment_definitions - $obj->setPaymentDefinitions(null); - $this->assertNull($obj->getPayment_definitions()); - $this->assertNull($obj->getPaymentDefinitions()); - $this->assertSame($obj->getPaymentDefinitions(), $obj->getPayment_definitions()); - $obj->setPayment_definitions(PaymentDefinitionTest::getObject()); - $this->assertEquals($obj->getPayment_definitions(), PaymentDefinitionTest::getObject()); - - // Check for Merchant_preferences - $obj->setMerchantPreferences(null); - $this->assertNull($obj->getMerchant_preferences()); - $this->assertNull($obj->getMerchantPreferences()); - $this->assertSame($obj->getMerchantPreferences(), $obj->getMerchant_preferences()); - $obj->setMerchant_preferences(MerchantPreferencesTest::getObject()); - $this->assertEquals($obj->getMerchant_preferences(), MerchantPreferencesTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param Plan $obj */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( PlanTest::getJson() )); - $result = $obj->get("planId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("planId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -159,17 +102,17 @@ class PlanTest extends \PHPUnit_Framework_TestCase */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -178,18 +121,18 @@ class PlanTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $patchRequest = PatchRequestTest::getObject(); - $result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall); + $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -198,18 +141,18 @@ class PlanTest extends \PHPUnit_Framework_TestCase */ public function testList($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( PlanListTest::getJson() )); $params = ParamsTest::getObject(); - $result = $obj->all($params, $mockApiContext, $mockPPRestCall); + $result = $obj->all($params, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/PresentationTest.php b/tests/PayPal/Test/Api/PresentationTest.php index 26fdbd0..debef88 100644 --- a/tests/PayPal/Test/Api/PresentationTest.php +++ b/tests/PayPal/Test/Api/PresentationTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Presentation; /** @@ -57,53 +57,4 @@ class PresentationTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLocaleCode(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Presentation $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getBrand_name(), "TestSample"); - $this->assertEquals($obj->getLogo_image(), "TestSample"); - $this->assertEquals($obj->getLocale_code(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Presentation $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Brand_name - $obj->setBrandName(null); - $this->assertNull($obj->getBrand_name()); - $this->assertNull($obj->getBrandName()); - $this->assertSame($obj->getBrandName(), $obj->getBrand_name()); - $obj->setBrand_name("TestSample"); - $this->assertEquals($obj->getBrand_name(), "TestSample"); - - // Check for Logo_image - $obj->setLogoImage(null); - $this->assertNull($obj->getLogo_image()); - $this->assertNull($obj->getLogoImage()); - $this->assertSame($obj->getLogoImage(), $obj->getLogo_image()); - $obj->setLogo_image("TestSample"); - $this->assertEquals($obj->getLogo_image(), "TestSample"); - - // Check for Locale_code - $obj->setLocaleCode(null); - $this->assertNull($obj->getLocale_code()); - $this->assertNull($obj->getLocaleCode()); - $this->assertSame($obj->getLocaleCode(), $obj->getLocale_code()); - $obj->setLocale_code("TestSample"); - $this->assertEquals($obj->getLocale_code(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/RefundDetailTest.php b/tests/PayPal/Test/Api/RefundDetailTest.php index 8de6252..6ccd4f6 100644 --- a/tests/PayPal/Test/Api/RefundDetailTest.php +++ b/tests/PayPal/Test/Api/RefundDetailTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\RefundDetail; /** @@ -57,26 +57,4 @@ class RefundDetailTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getNote(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param RefundDetail $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param RefundDetail $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/SaleTest.php b/tests/PayPal/Test/Api/SaleTest.php index c51e044..79972e0 100644 --- a/tests/PayPal/Test/Api/SaleTest.php +++ b/tests/PayPal/Test/Api/SaleTest.php @@ -7,7 +7,7 @@ use PayPal\Test\Constants; use PayPal\Test\Api\AmountTest; use PayPal\Test\Api\PaymentTest; use PayPal\Test\Api\LinksTest; -use PayPal\Exception\PPConnectionException; +use PayPal\Exception\PayPalConnectionException; class SaleTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PayPal/Test/Api/SearchTest.php b/tests/PayPal/Test/Api/SearchTest.php index 30aac6a..d5495b8 100644 --- a/tests/PayPal/Test/Api/SearchTest.php +++ b/tests/PayPal/Test/Api/SearchTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Search; /** @@ -89,161 +89,4 @@ class SearchTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getTotalCountRequired(), true); } - /** - * @depends testSerializationDeserialization - * @param Search $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getRecipient_first_name(), "TestSample"); - $this->assertEquals($obj->getRecipient_last_name(), "TestSample"); - $this->assertEquals($obj->getRecipient_business_name(), "TestSample"); - $this->assertEquals($obj->getLower_total_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getUpper_total_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getStart_invoice_date(), "TestSample"); - $this->assertEquals($obj->getEnd_invoice_date(), "TestSample"); - $this->assertEquals($obj->getStart_due_date(), "TestSample"); - $this->assertEquals($obj->getEnd_due_date(), "TestSample"); - $this->assertEquals($obj->getStart_payment_date(), "TestSample"); - $this->assertEquals($obj->getEnd_payment_date(), "TestSample"); - $this->assertEquals($obj->getStart_creation_date(), "TestSample"); - $this->assertEquals($obj->getEnd_creation_date(), "TestSample"); - $this->assertEquals($obj->getPage_size(), "12.34"); - $this->assertEquals($obj->getTotal_count_required(), true); - } - - /** - * @depends testSerializationDeserialization - * @param Search $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Recipient_first_name - $obj->setRecipientFirstName(null); - $this->assertNull($obj->getRecipient_first_name()); - $this->assertNull($obj->getRecipientFirstName()); - $this->assertSame($obj->getRecipientFirstName(), $obj->getRecipient_first_name()); - $obj->setRecipient_first_name("TestSample"); - $this->assertEquals($obj->getRecipient_first_name(), "TestSample"); - - // Check for Recipient_last_name - $obj->setRecipientLastName(null); - $this->assertNull($obj->getRecipient_last_name()); - $this->assertNull($obj->getRecipientLastName()); - $this->assertSame($obj->getRecipientLastName(), $obj->getRecipient_last_name()); - $obj->setRecipient_last_name("TestSample"); - $this->assertEquals($obj->getRecipient_last_name(), "TestSample"); - - // Check for Recipient_business_name - $obj->setRecipientBusinessName(null); - $this->assertNull($obj->getRecipient_business_name()); - $this->assertNull($obj->getRecipientBusinessName()); - $this->assertSame($obj->getRecipientBusinessName(), $obj->getRecipient_business_name()); - $obj->setRecipient_business_name("TestSample"); - $this->assertEquals($obj->getRecipient_business_name(), "TestSample"); - - // Check for Lower_total_amount - $obj->setLowerTotalAmount(null); - $this->assertNull($obj->getLower_total_amount()); - $this->assertNull($obj->getLowerTotalAmount()); - $this->assertSame($obj->getLowerTotalAmount(), $obj->getLower_total_amount()); - $obj->setLower_total_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getLower_total_amount(), CurrencyTest::getObject()); - - // Check for Upper_total_amount - $obj->setUpperTotalAmount(null); - $this->assertNull($obj->getUpper_total_amount()); - $this->assertNull($obj->getUpperTotalAmount()); - $this->assertSame($obj->getUpperTotalAmount(), $obj->getUpper_total_amount()); - $obj->setUpper_total_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getUpper_total_amount(), CurrencyTest::getObject()); - - // Check for Start_invoice_date - $obj->setStartInvoiceDate(null); - $this->assertNull($obj->getStart_invoice_date()); - $this->assertNull($obj->getStartInvoiceDate()); - $this->assertSame($obj->getStartInvoiceDate(), $obj->getStart_invoice_date()); - $obj->setStart_invoice_date("TestSample"); - $this->assertEquals($obj->getStart_invoice_date(), "TestSample"); - - // Check for End_invoice_date - $obj->setEndInvoiceDate(null); - $this->assertNull($obj->getEnd_invoice_date()); - $this->assertNull($obj->getEndInvoiceDate()); - $this->assertSame($obj->getEndInvoiceDate(), $obj->getEnd_invoice_date()); - $obj->setEnd_invoice_date("TestSample"); - $this->assertEquals($obj->getEnd_invoice_date(), "TestSample"); - - // Check for Start_due_date - $obj->setStartDueDate(null); - $this->assertNull($obj->getStart_due_date()); - $this->assertNull($obj->getStartDueDate()); - $this->assertSame($obj->getStartDueDate(), $obj->getStart_due_date()); - $obj->setStart_due_date("TestSample"); - $this->assertEquals($obj->getStart_due_date(), "TestSample"); - - // Check for End_due_date - $obj->setEndDueDate(null); - $this->assertNull($obj->getEnd_due_date()); - $this->assertNull($obj->getEndDueDate()); - $this->assertSame($obj->getEndDueDate(), $obj->getEnd_due_date()); - $obj->setEnd_due_date("TestSample"); - $this->assertEquals($obj->getEnd_due_date(), "TestSample"); - - // Check for Start_payment_date - $obj->setStartPaymentDate(null); - $this->assertNull($obj->getStart_payment_date()); - $this->assertNull($obj->getStartPaymentDate()); - $this->assertSame($obj->getStartPaymentDate(), $obj->getStart_payment_date()); - $obj->setStart_payment_date("TestSample"); - $this->assertEquals($obj->getStart_payment_date(), "TestSample"); - - // Check for End_payment_date - $obj->setEndPaymentDate(null); - $this->assertNull($obj->getEnd_payment_date()); - $this->assertNull($obj->getEndPaymentDate()); - $this->assertSame($obj->getEndPaymentDate(), $obj->getEnd_payment_date()); - $obj->setEnd_payment_date("TestSample"); - $this->assertEquals($obj->getEnd_payment_date(), "TestSample"); - - // Check for Start_creation_date - $obj->setStartCreationDate(null); - $this->assertNull($obj->getStart_creation_date()); - $this->assertNull($obj->getStartCreationDate()); - $this->assertSame($obj->getStartCreationDate(), $obj->getStart_creation_date()); - $obj->setStart_creation_date("TestSample"); - $this->assertEquals($obj->getStart_creation_date(), "TestSample"); - - // Check for End_creation_date - $obj->setEndCreationDate(null); - $this->assertNull($obj->getEnd_creation_date()); - $this->assertNull($obj->getEndCreationDate()); - $this->assertSame($obj->getEndCreationDate(), $obj->getEnd_creation_date()); - $obj->setEnd_creation_date("TestSample"); - $this->assertEquals($obj->getEnd_creation_date(), "TestSample"); - - // Check for Page_size - $obj->setPageSize(null); - $this->assertNull($obj->getPage_size()); - $this->assertNull($obj->getPageSize()); - $this->assertSame($obj->getPageSize(), $obj->getPage_size()); - $obj->setPage_size("12.34"); - $this->assertEquals($obj->getPage_size(), "12.34"); - - // Check for Total_count_required - $obj->setTotalCountRequired(null); - $this->assertNull($obj->getTotal_count_required()); - $this->assertNull($obj->getTotalCountRequired()); - $this->assertSame($obj->getTotalCountRequired(), $obj->getTotal_count_required()); - $obj->setTotal_count_required(true); - $this->assertEquals($obj->getTotal_count_required(), true); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ShippingAddressTest.php b/tests/PayPal/Test/Api/ShippingAddressTest.php index 7634bd8..bbe02b0 100644 --- a/tests/PayPal/Test/Api/ShippingAddressTest.php +++ b/tests/PayPal/Test/Api/ShippingAddressTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ShippingAddress; /** @@ -57,44 +57,4 @@ class ShippingAddressTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getDefaultAddress(), true); } - /** - * @depends testSerializationDeserialization - * @param ShippingAddress $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getRecipient_name(), "TestSample"); - $this->assertEquals($obj->getDefault_address(), true); - } - - /** - * @depends testSerializationDeserialization - * @param ShippingAddress $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Recipient_name - $obj->setRecipientName(null); - $this->assertNull($obj->getRecipient_name()); - $this->assertNull($obj->getRecipientName()); - $this->assertSame($obj->getRecipientName(), $obj->getRecipient_name()); - $obj->setRecipient_name("TestSample"); - $this->assertEquals($obj->getRecipient_name(), "TestSample"); - - // Check for Default_address - $obj->setDefaultAddress(null); - $this->assertNull($obj->getDefault_address()); - $this->assertNull($obj->getDefaultAddress()); - $this->assertSame($obj->getDefaultAddress(), $obj->getDefault_address()); - $obj->setDefault_address(true); - $this->assertEquals($obj->getDefault_address(), true); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ShippingCostTest.php b/tests/PayPal/Test/Api/ShippingCostTest.php index ed3fbf8..8cbf446 100644 --- a/tests/PayPal/Test/Api/ShippingCostTest.php +++ b/tests/PayPal/Test/Api/ShippingCostTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ShippingCost; /** @@ -55,26 +55,4 @@ class ShippingCostTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getTax(), TaxTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param ShippingCost $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param ShippingCost $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/ShippingInfoTest.php b/tests/PayPal/Test/Api/ShippingInfoTest.php index df3b72a..1ac4e2d 100644 --- a/tests/PayPal/Test/Api/ShippingInfoTest.php +++ b/tests/PayPal/Test/Api/ShippingInfoTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\ShippingInfo; /** @@ -59,53 +59,4 @@ class ShippingInfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAddress(), AddressTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param ShippingInfo $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getFirst_name(), "TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param ShippingInfo $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for First_name - $obj->setFirstName(null); - $this->assertNull($obj->getFirst_name()); - $this->assertNull($obj->getFirstName()); - $this->assertSame($obj->getFirstName(), $obj->getFirst_name()); - $obj->setFirst_name("TestSample"); - $this->assertEquals($obj->getFirst_name(), "TestSample"); - - // Check for Last_name - $obj->setLastName(null); - $this->assertNull($obj->getLast_name()); - $this->assertNull($obj->getLastName()); - $this->assertSame($obj->getLastName(), $obj->getLast_name()); - $obj->setLast_name("TestSample"); - $this->assertEquals($obj->getLast_name(), "TestSample"); - - // Check for Business_name - $obj->setBusinessName(null); - $this->assertNull($obj->getBusiness_name()); - $this->assertNull($obj->getBusinessName()); - $this->assertSame($obj->getBusinessName(), $obj->getBusiness_name()); - $obj->setBusiness_name("TestSample"); - $this->assertEquals($obj->getBusiness_name(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/TaxTest.php b/tests/PayPal/Test/Api/TaxTest.php index 48d62ed..bd75a8b 100644 --- a/tests/PayPal/Test/Api/TaxTest.php +++ b/tests/PayPal/Test/Api/TaxTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Tax; /** @@ -59,26 +59,4 @@ class TaxTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Tax $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param Tax $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/TermsTest.php b/tests/PayPal/Test/Api/TermsTest.php index 6ab14cb..c835d34 100644 --- a/tests/PayPal/Test/Api/TermsTest.php +++ b/tests/PayPal/Test/Api/TermsTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\Terms; /** @@ -63,53 +63,4 @@ class TermsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getBuyerEditable(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param Terms $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getMax_billing_amount(), CurrencyTest::getObject()); - $this->assertEquals($obj->getAmount_range(), CurrencyTest::getObject()); - $this->assertEquals($obj->getBuyer_editable(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param Terms $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Max_billing_amount - $obj->setMaxBillingAmount(null); - $this->assertNull($obj->getMax_billing_amount()); - $this->assertNull($obj->getMaxBillingAmount()); - $this->assertSame($obj->getMaxBillingAmount(), $obj->getMax_billing_amount()); - $obj->setMax_billing_amount(CurrencyTest::getObject()); - $this->assertEquals($obj->getMax_billing_amount(), CurrencyTest::getObject()); - - // Check for Amount_range - $obj->setAmountRange(null); - $this->assertNull($obj->getAmount_range()); - $this->assertNull($obj->getAmountRange()); - $this->assertSame($obj->getAmountRange(), $obj->getAmount_range()); - $obj->setAmount_range(CurrencyTest::getObject()); - $this->assertEquals($obj->getAmount_range(), CurrencyTest::getObject()); - - // Check for Buyer_editable - $obj->setBuyerEditable(null); - $this->assertNull($obj->getBuyer_editable()); - $this->assertNull($obj->getBuyerEditable()); - $this->assertSame($obj->getBuyerEditable(), $obj->getBuyer_editable()); - $obj->setBuyer_editable("TestSample"); - $this->assertEquals($obj->getBuyer_editable(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/WebProfileTest.php b/tests/PayPal/Test/Api/WebProfileTest.php index 9adf308..ad276c0 100644 --- a/tests/PayPal/Test/Api/WebProfileTest.php +++ b/tests/PayPal/Test/Api/WebProfileTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\CreateProfileResponse; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -65,62 +65,23 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getPresentation(), PresentationTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param WebProfile $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getFlow_config(), FlowConfigTest::getObject()); - $this->assertEquals($obj->getInput_fields(), InputFieldsTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param WebProfile $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Flow_config - $obj->setFlowConfig(null); - $this->assertNull($obj->getFlow_config()); - $this->assertNull($obj->getFlowConfig()); - $this->assertSame($obj->getFlowConfig(), $obj->getFlow_config()); - $obj->setFlow_config(FlowConfigTest::getObject()); - $this->assertEquals($obj->getFlow_config(), FlowConfigTest::getObject()); - - // Check for Input_fields - $obj->setInputFields(null); - $this->assertNull($obj->getInput_fields()); - $this->assertNull($obj->getInputFields()); - $this->assertSame($obj->getInputFields(), $obj->getInput_fields()); - $obj->setInput_fields(InputFieldsTest::getObject()); - $this->assertEquals($obj->getInput_fields(), InputFieldsTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param WebProfile $obj */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( CreateProfileResponseTest::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -129,17 +90,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->update($mockApiContext, $mockPPRestCall); + $result = $obj->update($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -148,18 +109,18 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase */ public function testPartialUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); $patch = array(PatchTest::getObject()); - $result = $obj->partial_update($patch, $mockApiContext, $mockPPRestCall); + $result = $obj->partial_update($patch, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -168,17 +129,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebProfileTest::getJson() )); - $result = $obj->get("profileId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("profileId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -187,17 +148,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase */ public function testGetList($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( json_encode(array(json_decode(WebProfileTest::getJson()))) )); - $result = $obj->get_list($mockApiContext, $mockPPRestCall); + $result = $obj->get_list($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -206,17 +167,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPPRestCall); + $result = $obj->delete($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/WebhookEventListTest.php b/tests/PayPal/Test/Api/WebhookEventListTest.php index 759735b..aae8b9a 100644 --- a/tests/PayPal/Test/Api/WebhookEventListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookEventList; /** @@ -57,26 +57,4 @@ class WebhookEventListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param WebhookEventList $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param WebhookEventList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/WebhookEventTest.php b/tests/PayPal/Test/Api/WebhookEventTest.php index d009203..99acb63 100644 --- a/tests/PayPal/Test/Api/WebhookEventTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookEventList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebhookEvent; /** @@ -69,71 +69,23 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param WebhookEvent $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getCreate_time(), "TestSample"); - $this->assertEquals($obj->getResource_type(), "TestSample"); - $this->assertEquals($obj->getEvent_type(), "TestSample"); - } - - /** - * @depends testSerializationDeserialization - * @param WebhookEvent $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Create_time - $obj->setCreateTime(null); - $this->assertNull($obj->getCreate_time()); - $this->assertNull($obj->getCreateTime()); - $this->assertSame($obj->getCreateTime(), $obj->getCreate_time()); - $obj->setCreate_time("TestSample"); - $this->assertEquals($obj->getCreate_time(), "TestSample"); - - // Check for Resource_type - $obj->setResourceType(null); - $this->assertNull($obj->getResource_type()); - $this->assertNull($obj->getResourceType()); - $this->assertSame($obj->getResourceType(), $obj->getResource_type()); - $obj->setResource_type("TestSample"); - $this->assertEquals($obj->getResource_type(), "TestSample"); - - // Check for Event_type - $obj->setEventType(null); - $this->assertNull($obj->getEvent_type()); - $this->assertNull($obj->getEventType()); - $this->assertSame($obj->getEventType(), $obj->getEvent_type()); - $obj->setEvent_type("TestSample"); - $this->assertEquals($obj->getEvent_type(), "TestSample"); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param WebhookEvent $obj */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventTest::getJson() )); - $result = $obj->get("eventId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("eventId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -142,17 +94,17 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testResend($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->resend($mockApiContext, $mockPPRestCall); + $result = $obj->resend($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -161,18 +113,18 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testList($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventListTest::getJson() )); $params = array(); - $result = $obj->all($params, $mockApiContext, $mockPPRestCall); + $result = $obj->all($params, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php index b2cc342..a38a52c 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookEventTypeList; /** @@ -53,35 +53,4 @@ class WebhookEventTypeListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getEventTypes(), WebhookEventTypeTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param WebhookEventTypeList $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getEvent_types(), WebhookEventTypeTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param WebhookEventTypeList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Event_types - $obj->setEventTypes(null); - $this->assertNull($obj->getEvent_types()); - $this->assertNull($obj->getEventTypes()); - $this->assertSame($obj->getEventTypes(), $obj->getEvent_types()); - $obj->setEvent_types(WebhookEventTypeTest::getObject()); - $this->assertEquals($obj->getEvent_types(), WebhookEventTypeTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeTest.php b/tests/PayPal/Test/Api/WebhookEventTypeTest.php index c311f48..f107209 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookEventList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebhookEventType; /** @@ -59,44 +59,23 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getDescription(), "TestSample"); } - /** - * @depends testSerializationDeserialization - * @param WebhookEventType $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param WebhookEventType $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - /** * @dataProvider mockProvider * @param WebhookEventType $obj */ public function testSubscribedEventTypes($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventTypeListTest::getJson() )); - $result = $obj->subscribedEventTypes("webhookId", $mockApiContext, $mockPPRestCall); + $result = $obj->subscribedEventTypes("webhookId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -105,17 +84,17 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase */ public function testAvailableEventTypes($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventTypeListTest::getJson() )); - $result = $obj->availableEventTypes($mockApiContext, $mockPPRestCall); + $result = $obj->availableEventTypes($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/WebhookListTest.php b/tests/PayPal/Test/Api/WebhookListTest.php index 74ab8b6..4eb2cef 100644 --- a/tests/PayPal/Test/Api/WebhookListTest.php +++ b/tests/PayPal/Test/Api/WebhookListTest.php @@ -2,7 +2,7 @@ namespace PayPal\Test\Api; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookList; /** @@ -53,26 +53,4 @@ class WebhookListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getWebhooks(), WebhookTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param WebhookList $obj - */ - public function testDeprecatedGetters($obj) - { - } - - /** - * @depends testSerializationDeserialization - * @param WebhookList $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - - - } diff --git a/tests/PayPal/Test/Api/WebhookTest.php b/tests/PayPal/Test/Api/WebhookTest.php index e849d77..99382db 100644 --- a/tests/PayPal/Test/Api/WebhookTest.php +++ b/tests/PayPal/Test/Api/WebhookTest.php @@ -2,11 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Common\ResourceModel; +use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookList; use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\Webhook; /** @@ -63,35 +63,6 @@ class WebhookTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - /** - * @depends testSerializationDeserialization - * @param Webhook $obj - */ - public function testDeprecatedGetters($obj) - { - $this->assertEquals($obj->getEvent_types(), WebhookEventTypeTest::getObject()); - } - - /** - * @depends testSerializationDeserialization - * @param Webhook $obj - */ - public function testDeprecatedSetterNormalGetter($obj) - { - - // Check for Event_types - $obj->setEventTypes(null); - $this->assertNull($obj->getEvent_types()); - $this->assertNull($obj->getEventTypes()); - $this->assertSame($obj->getEventTypes(), $obj->getEvent_types()); - $obj->setEvent_types(WebhookEventTypeTest::getObject()); - $this->assertEquals($obj->getEvent_types(), WebhookEventTypeTest::getObject()); - - //Test All Deprecated Getters and Normal Getters - $this->testDeprecatedGetters($obj); - $this->testGetters($obj); - } - /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Url is not a fully qualified URL @@ -108,17 +79,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testCreate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPPRestCall); + $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -127,17 +98,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookTest::getJson() )); - $result = $obj->get("webhookId", $mockApiContext, $mockPPRestCall); + $result = $obj->get("webhookId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -146,17 +117,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testGetAll($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookListTest::getJson() )); - $result = $obj->getAll($mockApiContext, $mockPPRestCall); + $result = $obj->getAll($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -165,18 +136,18 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); $patchRequest = PatchRequestTest::getObject(); - $result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall); + $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } /** @@ -185,17 +156,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall') + $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPPRestCall->expects($this->any()) + $mockPayPalRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPPRestCall); + $result = $obj->delete($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php index d28313e..b68fa7a 100644 --- a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php +++ b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php @@ -1,38 +1,38 @@ -getConfigHashmap(); - $token = $cred->getAccessToken($config); - $this->assertNotNull($token); - - // Check that we get the same token when issuing a new call before token expiry - $newToken = $cred->getAccessToken($config); - $this->assertNotNull($newToken); - $this->assertEquals($token, $newToken); - } - - /** - * @group integration - */ - public function testInvalidCredentials() - { - $this->setExpectedException('PayPal\Exception\PPConnectionException'); - $cred = new OAuthTokenCredential('dummy', 'secret'); - $this->assertNull($cred->getAccessToken(PPConfigManager::getInstance()->getConfigHashmap())); - } -} \ No newline at end of file +getConfigHashmap(); + $token = $cred->getAccessToken($config); + $this->assertNotNull($token); + + // Check that we get the same token when issuing a new call before token expiry + $newToken = $cred->getAccessToken($config); + $this->assertNotNull($newToken); + $this->assertEquals($token, $newToken); + } + + /** + * @group integration + */ + public function testInvalidCredentials() + { + $this->setExpectedException('PayPal\Exception\PayPalConnectionException'); + $cred = new OAuthTokenCredential('dummy', 'secret'); + $this->assertNull($cred->getAccessToken(PayPalConfigManager::getInstance()->getConfigHashmap())); + } +} diff --git a/tests/PayPal/Test/Cache/AuthorizationCacheTest.php b/tests/PayPal/Test/Cache/AuthorizationCacheTest.php new file mode 100644 index 0000000..b3b4b0c --- /dev/null +++ b/tests/PayPal/Test/Cache/AuthorizationCacheTest.php @@ -0,0 +1,68 @@ + 'true'), true), + array(array('cache.enabled' => true), true), + array(array(), false), + array(null, false) + ); + } + + public static function CachePathProvider() + { + return array( + array(array('cache.FileName' => 'temp.cache'), 'temp.cache'), + array(array(), 'auth.cache'), + array(null, 'auth.cache') + ); + } + + /** + * + * @dataProvider EnabledProvider + */ + public function testIsEnabled($config, $expected) + { + $result = AuthorizationCache::isEnabled($config); + $this->assertEquals($expected, $result); + } + + /** + * @dataProvider CachePathProvider + */ + public function testCachePath($config, $expected) + { + $result = AuthorizationCache::cachePath($config); + $this->assertContains($expected, $result); + } + +} diff --git a/tests/PayPal/Test/Common/ArrayClass.php b/tests/PayPal/Test/Common/ArrayClass.php index 1cada16..15faf11 100644 --- a/tests/PayPal/Test/Common/ArrayClass.php +++ b/tests/PayPal/Test/Common/ArrayClass.php @@ -1,9 +1,9 @@ tags = $tags; } + /** + * @return array + */ public function getTags() { return $this->tags; } -} \ No newline at end of file +} diff --git a/tests/PayPal/Test/Common/ArrayUtilTest.php b/tests/PayPal/Test/Common/ArrayUtilTest.php index 84926f2..0c353b0 100644 --- a/tests/PayPal/Test/Common/ArrayUtilTest.php +++ b/tests/PayPal/Test/Common/ArrayUtilTest.php @@ -1,24 +1,24 @@ -assertEquals(false, PPArrayUtil::isAssocArray($arr)); - - $arr = array( - 'name' => 'John Doe', - 'City' => 'San Jose' - ); - $this->assertEquals(true, PPArrayUtil::isAssocArray($arr)); - - $arr[] = 'CA'; - $this->assertEquals(false, PPArrayUtil::isAssocArray($arr)); - } -} +assertEquals(false, ArrayUtil::isAssocArray($arr)); + + $arr = array( + 'name' => 'John Doe', + 'City' => 'San Jose' + ); + $this->assertEquals(true, ArrayUtil::isAssocArray($arr)); + + $arr[] = 'CA'; + $this->assertEquals(false, ArrayUtil::isAssocArray($arr)); + } +} diff --git a/tests/PayPal/Test/Common/ChildClass.php b/tests/PayPal/Test/Common/ChildClass.php index d12e072..0443857 100644 --- a/tests/PayPal/Test/Common/ChildClass.php +++ b/tests/PayPal/Test/Common/ChildClass.php @@ -1,9 +1,9 @@ assertEquals($expected, $result); } @@ -118,7 +118,7 @@ class FormatConverterTest extends \PHPUnit_Framework_TestCase /** * @dataProvider apiModelSettersProvider * - * @param PPModel $class Class Object + * @param PayPalModel $class Class Object * @param string $method Method Name where the format is being applied * @param array $values array of ['input', 'expectedResponse'] is provided */ diff --git a/tests/PayPal/Test/Common/ModelTest.php b/tests/PayPal/Test/Common/ModelTest.php index d8cc880..9972394 100644 --- a/tests/PayPal/Test/Common/ModelTest.php +++ b/tests/PayPal/Test/Common/ModelTest.php @@ -1,7 +1,7 @@ invalid = "value2"; $this->assertEquals($obj->invalid, "value2"); - if (PPConfigManager::getInstance()->get('validation.level') == 'strict') { + if (PayPalConfigManager::getInstance()->get('validation.level') == 'strict') { $this->fail("It should have thrown a Notice Error"); } } catch (\PHPUnit_Framework_Error_Notice $ex) { @@ -100,7 +100,7 @@ class ModelTest extends \PHPUnit_Framework_TestCase public function testInvalidMagicMethodWithDisabledValidation() { - PPConfigManager::getInstance()->addConfigs(array('validation.level' => 'disabled')); + PayPalConfigManager::getInstance()->addConfigs(array('validation.level' => 'disabled')); $obj = new SimpleClass(); try { $obj->invalid = "value2"; @@ -108,16 +108,16 @@ class ModelTest extends \PHPUnit_Framework_TestCase } catch (\PHPUnit_Framework_Error_Notice $ex) { $this->fail("It should not have thrown a Notice Error as it is disabled."); } - PPConfigManager::getInstance()->addConfigs(array('validation.level' => 'strict')); + PayPalConfigManager::getInstance()->addConfigs(array('validation.level' => 'strict')); } public function testInvalidMagicMethodWithValidationLevel() { - PPConfigManager::getInstance()->addConfigs(array('validation.level' => 'log')); + PayPalConfigManager::getInstance()->addConfigs(array('validation.level' => 'log')); $obj = new SimpleClass(); $obj->invalid2 = "value2"; $this->assertEquals($obj->invalid2, "value2"); - PPConfigManager::getInstance()->addConfigs(array('validation.level' => 'strict')); + PayPalConfigManager::getInstance()->addConfigs(array('validation.level' => 'strict')); } public function testArrayClassConversion() diff --git a/tests/PayPal/Test/Common/NestedClass.php b/tests/PayPal/Test/Common/NestedClass.php index ed9a0b4..01be928 100644 --- a/tests/PayPal/Test/Common/NestedClass.php +++ b/tests/PayPal/Test/Common/NestedClass.php @@ -1,9 +1,9 @@ info; } -} \ No newline at end of file +} diff --git a/tests/PayPal/Test/Common/PPModelTest.php b/tests/PayPal/Test/Common/PayPalModelTest.php similarity index 94% rename from tests/PayPal/Test/Common/PPModelTest.php rename to tests/PayPal/Test/Common/PayPalModelTest.php index d31b1bc..ccb20f6 100644 --- a/tests/PayPal/Test/Common/PPModelTest.php +++ b/tests/PayPal/Test/Common/PayPalModelTest.php @@ -1,8 +1,8 @@ assertEquals($parent, $parentCopy); } -} \ No newline at end of file +} diff --git a/tests/PayPal/Test/Common/SimpleClass.php b/tests/PayPal/Test/Common/SimpleClass.php index debb0e8..4eb49ff 100644 --- a/tests/PayPal/Test/Common/SimpleClass.php +++ b/tests/PayPal/Test/Common/SimpleClass.php @@ -1,9 +1,9 @@ description; } -} \ No newline at end of file +} diff --git a/tests/PayPal/Test/Common/UserAgentTest.php b/tests/PayPal/Test/Common/UserAgentTest.php index 1823249..a9f6566 100644 --- a/tests/PayPal/Test/Common/UserAgentTest.php +++ b/tests/PayPal/Test/Common/UserAgentTest.php @@ -1,28 +1,28 @@ -assertNotNull($id); - $this->assertNotNull($version); - $this->assertNotNull($features); - - $this->assertEquals("name", $id); - $this->assertEquals("version", $version); - - // Check that we pass in these mininal features - $this->assertThat($features, $this->stringContains("OS=")); - $this->assertThat($features, $this->stringContains("Bit=")); - $this->assertThat($features, $this->stringContains("Lang=")); - $this->assertThat($features, $this->stringContains("V=")); - $this->assertGreaterThan(5, count(explode(';', $features))); - } -} \ No newline at end of file +assertNotNull($id); + $this->assertNotNull($version); + $this->assertNotNull($features); + + $this->assertEquals("name", $id); + $this->assertEquals("version", $version); + + // Check that we pass in these mininal features + $this->assertThat($features, $this->stringContains("OS=")); + $this->assertThat($features, $this->stringContains("Bit=")); + $this->assertThat($features, $this->stringContains("Lang=")); + $this->assertThat($features, $this->stringContains("V=")); + $this->assertGreaterThan(5, count(explode(';', $features))); + } +} diff --git a/tests/PayPal/Test/Core/PPConfigManagerTest.php.skipped b/tests/PayPal/Test/Core/PPConfigManagerTest.php.skipped index fbada20..1f30eaf 100644 --- a/tests/PayPal/Test/Core/PPConfigManagerTest.php.skipped +++ b/tests/PayPal/Test/Core/PPConfigManagerTest.php.skipped @@ -1,10 +1,10 @@ object = new \ReflectionClass('PayPal\Core\PPConfigManager'); + $this->object = new \ReflectionClass('PayPal\Core\PayPalConfigManager'); runkit_constant_remove('PP_CONFIG_PATH'); } @@ -32,10 +32,10 @@ class PPConfigManagerTest extends \PHPUnit_Framework_TestCase public function testGetInstance() { define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); $instance = $this->object->getInstance(); $instance2 = $this->object->getInstance(); - $this->assertTrue($instance instanceof PPConfigManager); + $this->assertTrue($instance instanceof PayPalConfigManager); $this->assertSame($instance, $instance2); } @@ -43,7 +43,7 @@ class PPConfigManagerTest extends \PHPUnit_Framework_TestCase public function testGet() { define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); $ret = $this->object->get('acct2'); $this->assertConfiguration( array('acct2.ClientId' => 'TestClientId', 'acct2.ClientSecret' => 'TestClientSecret'), @@ -57,7 +57,7 @@ class PPConfigManagerTest extends \PHPUnit_Framework_TestCase public function testGetIniPrefix() { define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); $ret = $this->object->getIniPrefix(); $this->assertContains('acct1', $ret); @@ -71,10 +71,10 @@ class PPConfigManagerTest extends \PHPUnit_Framework_TestCase public function testConfigByDefault() { define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); // Test file based config params and defaults - $config = PPConfigManager::getInstance()->getConfigHashmap(); + $config = PayPalConfigManager::getInstance()->getConfigHashmap(); $this->assertConfiguration(array('mode' => 'sandbox', 'http.ConnectionTimeOut' => '60'), $config); } @@ -82,25 +82,25 @@ class PPConfigManagerTest extends \PHPUnit_Framework_TestCase public function testConfigByCustom() { define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); // Test custom config params and defaults - $config = PPConfigManager::getInstance()->addConfigs(array('mode' => 'custom', 'http.ConnectionTimeOut' => 900))->getConfigHashmap(); + $config = PayPalConfigManager::getInstance()->addConfigs(array('mode' => 'custom', 'http.ConnectionTimeOut' => 900))->getConfigHashmap(); $this->assertConfiguration(array('mode' => 'custom', 'http.ConnectionTimeOut' => '900'), $config); } public function testConfigByFileAndCustom() { define("PP_CONFIG_PATH", __DIR__. '/non_existent/'); - $this->object = PPConfigManager::getInstance(); + $this->object = PayPalConfigManager::getInstance(); - $config = PPConfigManager::getInstance()->getConfigHashmap(); + $config = PayPalConfigManager::getInstance()->getConfigHashmap(); $this->assertArrayHasKey('http.ConnectionTimeOut', $config); $this->assertEquals('30', $config['http.ConnectionTimeOut']); $this->assertEquals('5', $config['http.Retry']); //Add more configs - $config = PPConfigManager::getInstance()->addConfigs(array('http.Retry' => "10", 'mode' => 'sandbox'))->getConfigHashmap(); + $config = PayPalConfigManager::getInstance()->addConfigs(array('http.Retry' => "10", 'mode' => 'sandbox'))->getConfigHashmap(); $this->assertConfiguration(array('http.ConnectionTimeOut' => "30", 'http.Retry' => "10", 'mode' => 'sandbox'), $config); } diff --git a/tests/PayPal/Test/Core/PPCredentialManagerTest.php b/tests/PayPal/Test/Core/PayPalCredentialManagerTest.php similarity index 86% rename from tests/PayPal/Test/Core/PPCredentialManagerTest.php rename to tests/PayPal/Test/Core/PayPalCredentialManagerTest.php index 4d32045..6c93cc1 100644 --- a/tests/PayPal/Test/Core/PPCredentialManagerTest.php +++ b/tests/PayPal/Test/Core/PayPalCredentialManagerTest.php @@ -1,15 +1,15 @@ object = PPCredentialManager::getInstance($this->config); + $this->object = PayPalCredentialManager::getInstance($this->config); } /** @@ -51,7 +51,7 @@ class PPCredentialManagerTest extends \PHPUnit_Framework_TestCase public function testGetInstance() { $instance = $this->object->getInstance($this->config); - $this->assertTrue($instance instanceof PPCredentialManager); + $this->assertTrue($instance instanceof PayPalCredentialManager); } /** @@ -68,7 +68,7 @@ class PPCredentialManagerTest extends \PHPUnit_Framework_TestCase /** * @after testGetDefaultCredentialObject * - * @throws \PayPal\Exception\PPInvalidCredentialException + * @throws \PayPal\Exception\PayPalInvalidCredentialException */ public function testSetCredentialObject() { @@ -84,7 +84,7 @@ class PPCredentialManagerTest extends \PHPUnit_Framework_TestCase /** * @after testGetDefaultCredentialObject * - * @throws \PayPal\Exception\PPInvalidCredentialException + * @throws \PayPal\Exception\PayPalInvalidCredentialException */ public function testSetCredentialObjectWithUserId() { @@ -99,7 +99,7 @@ class PPCredentialManagerTest extends \PHPUnit_Framework_TestCase /** * @after testGetDefaultCredentialObject * - * @throws \PayPal\Exception\PPInvalidCredentialException + * @throws \PayPal\Exception\PayPalInvalidCredentialException */ public function testSetCredentialObjectWithoutDefault() { @@ -117,7 +117,7 @@ class PPCredentialManagerTest extends \PHPUnit_Framework_TestCase */ public function testGetInvalidCredentialObject() { - $this->setExpectedException('PayPal\Exception\PPInvalidCredentialException'); + $this->setExpectedException('PayPal\Exception\PayPalInvalidCredentialException'); $cred = $this->object->getCredentialObject('invalid_biz_api1.gmail.com'); } diff --git a/tests/PayPal/Test/Core/PPHttpConfigTest.php b/tests/PayPal/Test/Core/PayPalHttpConfigTest.php similarity index 86% rename from tests/PayPal/Test/Core/PPHttpConfigTest.php rename to tests/PayPal/Test/Core/PayPalHttpConfigTest.php index e55d160..44b0eeb 100644 --- a/tests/PayPal/Test/Core/PPHttpConfigTest.php +++ b/tests/PayPal/Test/Core/PayPalHttpConfigTest.php @@ -2,13 +2,13 @@ namespace PayPal\Test\Core; -use PayPal\Core\PPHttpConfig; +use PayPal\Core\PayPalHttpConfig; /** - * Test class for PPAPIService. + * Test class for PayPalHttpConfigTest. * */ -class PPHttpConfigTest extends \PHPUnit_Framework_TestCase +class PayPalHttpConfigTest extends \PHPUnit_Framework_TestCase { protected $object; @@ -40,7 +40,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase */ public function testHeaderFunctions() { - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->addHeader('key1', 'value1'); $o->addHeader('key2', 'value'); $o->addHeader('key2', 'overwritten'); @@ -49,7 +49,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase $this->assertEquals('overwritten', $o->getHeader('key2')); $this->assertNull($o->getHeader('key3')); - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->addHeader('key1', 'value1'); $o->addHeader('key2', 'value'); $o->addHeader('key2', 'and more', false); @@ -67,7 +67,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase */ public function testCurlOpts() { - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->setCurlOptions(array('k' => 'v')); $curlOpts = $o->getCurlOptions(); @@ -77,7 +77,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase public function testRemoveCurlOpts() { - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->setCurlOptions(array('k' => 'v')); $curlOpts = $o->getCurlOptions(); $this->assertEquals(1, count($curlOpts)); @@ -94,7 +94,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase public function testUserAgent() { $ua = 'UAString'; - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->setUserAgent($ua); $curlOpts = $o->getCurlOptions(); @@ -109,7 +109,7 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase $sslCert = '../cacert.pem'; $sslPass = 'passPhrase'; - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->setSSLCert($sslCert, $sslPass); $curlOpts = $o->getCurlOptions(); @@ -124,14 +124,14 @@ class PPHttpConfigTest extends \PHPUnit_Framework_TestCase { $proxy = 'http://me:secret@hostname:8081'; - $o = new PPHttpConfig(); + $o = new PayPalHttpConfig(); $o->setHttpProxy($proxy); $curlOpts = $o->getCurlOptions(); $this->assertEquals('hostname:8081', $curlOpts[CURLOPT_PROXY]); $this->assertEquals('me:secret', $curlOpts[CURLOPT_PROXYUSERPWD]); - $this->setExpectedException('PayPal\Exception\PPConfigurationException'); + $this->setExpectedException('PayPal\Exception\PayPalConfigurationException'); $o->setHttpProxy('invalid string'); } } diff --git a/tests/PayPal/Test/Core/PPLoggingManagerTest.php b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php similarity index 78% rename from tests/PayPal/Test/Core/PPLoggingManagerTest.php rename to tests/PayPal/Test/Core/PayPalLoggingManagerTest.php index 28b2084..e5a83db 100644 --- a/tests/PayPal/Test/Core/PPLoggingManagerTest.php +++ b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php @@ -1,14 +1,14 @@ object = PPLoggingManager::getInstance('InvoiceTest'); + $this->object = PayPalLoggingManager::getInstance('InvoiceTest'); } /** diff --git a/tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php similarity index 55% rename from tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php rename to tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php index 36bd2d2..c6067af 100644 --- a/tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php @@ -1,14 +1,14 @@ object = new PPConfigurationException('Test PPConfigurationException'); + $this->object = new PayPalConfigurationException('Test PayPalConfigurationException'); } /** @@ -31,7 +31,7 @@ class PPConfigurationExceptionTest extends \PHPUnit_Framework_TestCase public function testPPConfigurationException() { - $this->assertEquals('Test PPConfigurationException', $this->object->getMessage()); + $this->assertEquals('Test PayPalConfigurationException', $this->object->getMessage()); } } diff --git a/tests/PayPal/Test/Exception/PPConnectionExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php similarity index 73% rename from tests/PayPal/Test/Exception/PPConnectionExceptionTest.php rename to tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php index 79b7264..f64470a 100644 --- a/tests/PayPal/Test/Exception/PPConnectionExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php @@ -1,14 +1,14 @@ object = new PPConnectionException('http://testURL', 'test message'); + $this->object = new PayPalConnectionException('http://testURL', 'test message'); $this->object->setData('response payload for connection'); } diff --git a/tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php similarity index 67% rename from tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php rename to tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php index 2b352a0..93d51e1 100644 --- a/tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php @@ -1,14 +1,14 @@ object = new PPMissingCredentialException; + $this->object = new PayPalInvalidCredentialException; } /** diff --git a/tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php similarity index 67% rename from tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php rename to tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php index 9e45ed2..6892f20 100644 --- a/tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php @@ -1,14 +1,14 @@ object = new PPInvalidCredentialException; + $this->object = new PayPalMissingCredentialException; } /** diff --git a/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php index 15a1106..ca41177 100644 --- a/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php @@ -8,12 +8,12 @@ use PayPal\Api\Currency; use PayPal\Api\Patch; use PayPal\Api\PatchRequest; use PayPal\Api\Plan; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\CreateProfileResponse; use PayPal\Test\Functional\Setup; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -28,7 +28,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase public $response; - public $mockPPRestCall; + public $mockPayPalRestCall; public function setUp() { @@ -67,7 +67,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase $agreement = new Agreement($request); // Update the Schema to use a working Plan $agreement->getPlan()->setId($plan->getId()); - $result = $agreement->create(null, $this->mockPPRestCall); + $result = $agreement->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -88,7 +88,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase $paymentToken = $result['token']; $this->assertNotNull($paymentToken); $this->assertNotEmpty($paymentToken); - $result = $agreement->execute($paymentToken, null, $this->mockPPRestCall); + $result = $agreement->execute($paymentToken, null, $this->mockPayPalRestCall); return $result; } @@ -102,7 +102,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase $agreement = new Agreement($request); // Update the Schema to use a working Plan $agreement->getPlan()->setId($plan->getId()); - $result = $agreement->create(null, $this->mockPPRestCall); + $result = $agreement->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -114,7 +114,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($agreement) { - $result = Agreement::get($agreement->getId(), null, $this->mockPPRestCall); + $result = Agreement::get($agreement->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($agreement->getId(), $result->getId()); return $result; @@ -136,7 +136,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase $patches[] = $patch; $patchRequest = new PatchRequest(); $patchRequest->setPatches($patches); - $result = $agreement->update($patchRequest, null, $this->mockPPRestCall); + $result = $agreement->update($patchRequest, null, $this->mockPayPalRestCall); $this->assertTrue($result); } @@ -149,7 +149,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase { $this->markTestSkipped('Skipped as the fix is on the way.'); $currency = new Currency($this->operation['request']['body']); - $result = $agreement->setBalance($currency, null, $this->mockPPRestCall); + $result = $agreement->setBalance($currency, null, $this->mockPayPalRestCall); $this->assertTrue($result); return $agreement; } @@ -163,7 +163,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase { $this->markTestSkipped('Skipped as the fix is on the way.'); $agreementStateDescriptor = new AgreementStateDescriptor($this->operation['request']['body']); - $result = $agreement->billBalance($agreementStateDescriptor, null, $this->mockPPRestCall); + $result = $agreement->billBalance($agreementStateDescriptor, null, $this->mockPayPalRestCall); $this->assertTrue($result); return $agreement; } @@ -176,7 +176,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase public function testGetTransactions($agreement) { $this->markTestSkipped('Skipped as the fix is on the way.'); - $result = Agreement::transactions($agreement->getId(), null, $this->mockPPRestCall); + $result = Agreement::transactions($agreement->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); } @@ -188,7 +188,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase public function testSuspend($agreement) { $agreementStateDescriptor = new AgreementStateDescriptor($this->operation['request']['body']); - $result = $agreement->suspend($agreementStateDescriptor, null, $this->mockPPRestCall); + $result = $agreement->suspend($agreementStateDescriptor, null, $this->mockPayPalRestCall); $this->setupTest($this->getClassName(), 'testGetSuspended'); $get = $this->testGet($agreement); $this->assertTrue($result); @@ -204,7 +204,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase public function testReactivate($agreement) { $agreementStateDescriptor = new AgreementStateDescriptor($this->operation['request']['body']); - $result = $agreement->reActivate($agreementStateDescriptor, null, $this->mockPPRestCall); + $result = $agreement->reActivate($agreementStateDescriptor, null, $this->mockPayPalRestCall); $this->assertTrue($result); $this->setupTest($this->getClassName(), 'testGet'); $get = $this->testGet($agreement); @@ -220,7 +220,7 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase public function testCancel($agreement) { $agreementStateDescriptor = new AgreementStateDescriptor($this->operation['request']['body']); - $result = $agreement->cancel($agreementStateDescriptor, null, $this->mockPPRestCall); + $result = $agreement->cancel($agreementStateDescriptor, null, $this->mockPayPalRestCall); $this->assertTrue($result); $this->setupTest($this->getClassName(), 'testGetCancelled'); $get = $this->testGet($agreement); diff --git a/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php b/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php index a3276f0..96af52f 100644 --- a/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php @@ -6,13 +6,13 @@ use PayPal\Api\Patch; use PayPal\Api\PatchRequest; use PayPal\Api\Plan; use PayPal\Auth\OAuthTokenCredential; -use PayPal\Common\PPModel; -use PayPal\Core\PPCredentialManager; +use PayPal\Common\PayPalModel; +use PayPal\Core\PayPalCredentialManager; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\CreateProfileResponse; use PayPal\Test\Functional\Setup; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -31,7 +31,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase public $mode = 'mock'; - public $mockPPRestCall; + public $mockPayPalRestCall; public $context; @@ -86,7 +86,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $obj = new Plan($request); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); self::$obj = $result; return $result; @@ -96,7 +96,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $obj = new Plan($request); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -108,7 +108,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($plan) { - $result = Plan::get($plan->getId(), null, $this->mockPPRestCall); + $result = Plan::get($plan->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($plan->getId(), $result->getId()); $this->assertEquals($plan, $result, "", 0, 10, true); @@ -121,7 +121,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetList($plan) { - $result = Plan::all(array('page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall); + $result = Plan::all(array('page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $totalPages = $result->getTotalPages(); $found = false; @@ -135,7 +135,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase } } if (!$found) { - $result = Plan::all(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall); + $result = Plan::all(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall); } } while ($totalPages > 0 && $found == false); @@ -160,7 +160,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase $patches[] = $patch; $patchRequest = new PatchRequest(); $patchRequest->setPatches($patches); - $result = $plan->update($patchRequest, null, $this->mockPPRestCall); + $result = $plan->update($patchRequest, null, $this->mockPayPalRestCall); $this->assertTrue($result); } @@ -181,7 +181,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase $patches[] = $patch; $patchRequest = new PatchRequest(); $patchRequest->setPatches($patches); - $result = $plan->update($patchRequest, null, $this->mockPPRestCall); + $result = $plan->update($patchRequest, null, $this->mockPayPalRestCall); $this->assertTrue($result); } @@ -202,8 +202,8 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase $patches[] = $patch; $patchRequest = new PatchRequest(); $patchRequest->setPatches($patches); - $result = $plan->update($patchRequest, null, $this->mockPPRestCall); + $result = $plan->update($patchRequest, null, $this->mockPayPalRestCall); $this->assertTrue($result); - return Plan::get($plan->getId(), null, $this->mockPPRestCall); + return Plan::get($plan->getId(), null, $this->mockPayPalRestCall); } } diff --git a/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php b/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php index 05fd99d..546c822 100644 --- a/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php @@ -23,7 +23,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase public $response; - public $mockPPRestCall; + public $mockPayPalRestCall; public function setUp() { @@ -58,7 +58,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $obj = new Invoice($request); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); self::$obj = $result; return $result; @@ -71,7 +71,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($invoice) { - $result = Invoice::get($invoice->getId(), null, $this->mockPPRestCall); + $result = Invoice::get($invoice->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($invoice->getId(), $result->getId()); return $result; @@ -84,7 +84,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testSend($invoice) { - $result = $invoice->send(null, $this->mockPPRestCall); + $result = $invoice->send(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $invoice; } @@ -97,7 +97,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase public function testUpdate($invoice) { $this->markTestSkipped('Skipped as the fix is on the way. #PPTIPS-1932'); - $result = $invoice->update(null, $this->mockPPRestCall); + $result = $invoice->update(null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($invoice->getId(), $result->getId()); } @@ -109,7 +109,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetAll($invoice) { - $result = Invoice::getAll(array('page_size' => '20', 'total_count_required' => 'true'), null, $this->mockPPRestCall); + $result = Invoice::getAll(array('page_size' => '20', 'total_count_required' => 'true'), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertNotNull($result->getTotalCount()); $totalPages = ceil($result->getTotalCount()/20); @@ -124,7 +124,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase } } if (!$found) { - $result = Invoice::getAll(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall); + $result = Invoice::getAll(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall); } } while ($totalPages > 0 && $found == false); @@ -141,7 +141,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $search = new Search($request); - $result = Invoice::search($search, null, $this->mockPPRestCall); + $result = Invoice::search($search, null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertNotNull($result->getTotalCount()); } @@ -155,7 +155,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $notification = new Notification($request); - $result = $invoice->remind($notification, null, $this->mockPPRestCall); + $result = $invoice->remind($notification, null, $this->mockPayPalRestCall); $this->assertNotNull($result); } @@ -168,7 +168,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $notification = new CancelNotification($request); - $result = $invoice->cancel($notification, null, $this->mockPPRestCall); + $result = $invoice->cancel($notification, null, $this->mockPayPalRestCall); $this->assertNotNull($result); } @@ -179,7 +179,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testQRCode($invoice) { - $result = Invoice::qrCode($invoice->getId(), array(), null, $this->mockPPRestCall); + $result = Invoice::qrCode($invoice->getId(), array(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertNotNull($result->getImage()); } @@ -198,7 +198,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase $this->setupTest($this->getClassName(), 'testRecordPayment'); $request = $this->operation['request']['body']; $paymentDetail = new PaymentDetail($request); - $result = $invoice->recordPayment($paymentDetail, null, $this->mockPPRestCall); + $result = $invoice->recordPayment($paymentDetail, null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $invoice; } @@ -213,7 +213,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $refundDetail = new RefundDetail($request); - $result = $invoice->recordRefund($refundDetail, null, $this->mockPPRestCall); + $result = $invoice->recordRefund($refundDetail, null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->setupTest($this->getClassName(), 'testDelete'); $invoice = $this->testDelete($invoice); @@ -230,7 +230,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase $this->setupTest($this->getClassName(), 'testCreate'); $invoice = $this->testCreate($invoice); $this->setupTest($this->getClassName(), 'testDelete'); - $result = $invoice->delete(null, $this->mockPPRestCall); + $result = $invoice->delete(null, $this->mockPayPalRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Functional/Api/PaymentsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/PaymentsFunctionalTest.php index 09abb58..7889862 100644 --- a/tests/PayPal/Test/Functional/Api/PaymentsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/PaymentsFunctionalTest.php @@ -9,12 +9,12 @@ use PayPal\Api\Payment; use PayPal\Api\PaymentExecution; use PayPal\Api\Refund; use PayPal\Api\Sale; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\CreateProfileResponse; use PayPal\Test\Functional\Setup; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -29,7 +29,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase public $response; - public $mockPPRestCall; + public $mockPayPalRestCall; public function setUp() { @@ -57,7 +57,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $obj = new Payment($request); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -66,7 +66,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase { $request = $this->operation['request']['body']; $obj = new Payment($request); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -78,7 +78,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($payment) { - $result = Payment::get($payment->getId(), null, $this->mockPPRestCall); + $result = Payment::get($payment->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($payment->getId(), $result->getId()); $this->assertEquals($payment, $result, "", 0, 10, true); @@ -96,7 +96,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase $transaction = $transactions[0]; $relatedResources = $transaction->getRelatedResources(); $resource = $relatedResources[0]; - $result = Sale::get($resource->getSale()->getId(), null, $this->mockPPRestCall); + $result = Sale::get($resource->getSale()->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($resource->getSale()->getId(), $result->getId()); return $result; @@ -110,7 +110,7 @@ class PaymentsFunctionalTest extends \PHPUnit_Framework_TestCase public function testRefundSale($sale) { $refund = new Refund($this->operation['request']['body']); - $result = $sale->refund($refund, null, $this->mockPPRestCall); + $result = $sale->refund($refund, null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals('completed', $result->getState()); $this->assertEquals($sale->getId(), $result->getSaleId()); diff --git a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php new file mode 100644 index 0000000..f4ed062 --- /dev/null +++ b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php @@ -0,0 +1,102 @@ +getClassName(); + $testName = $this->getName(); + $operationString = file_get_contents(__DIR__ . "/../resources/$className/$testName.json"); + $this->operation = json_decode($operationString, true); + $this->response = true; + if (array_key_exists('body', $this->operation['response'])) { + $this->response = json_encode($this->operation['response']['body']); + } + + Setup::SetUpForFunctionalTests($this); + } + + /** + * Returns just the classname of the test you are executing. It removes the namespaces. + * @return string + */ + public function getClassName() + { + return join('', array_slice(explode('\\', get_class($this)), -1)); + } + + public function testCreate() + { + $request = $this->operation['request']['body']; + $obj = new Payout($request); + if (Setup::$mode != 'mock') { + $obj->getSenderBatchHeader()->setSenderBatchId(uniqid()); + } + PayoutsFunctionalTest::$batchId = $obj->getSenderBatchHeader()->getSenderBatchId(); + $params = array('sync_mode' => 'true'); + $result = $obj->create($params, null, $this->mockPayPalRestCall); + $this->assertNotNull($result); + $this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId()); + return $result; + } + + /** + * @depends testCreate + * @param $payoutBatch PayoutBatch + * @return PayoutBatch + */ + public function testGet($payoutBatch) + { + $result = Payout::get($payoutBatch->getBatchHeader()->getPayoutBatchId(), null, $this->mockPayPalRestCall); + $this->assertNotNull($result); + $this->assertNotNull($result->getBatchHeader()->getBatchStatus()); + $this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId()); + return $result; + } + + /** + * @depends testCreate + * @param $payoutBatch PayoutBatch + * @return PayoutBatch + */ + public function testGetItem($payoutBatch) + { + $items = $payoutBatch->getItems(); + $item = $items[0]; + $result = PayoutItem::get($item->getPayoutItemId(), null, $this->mockPayPalRestCall); + $this->assertNotNull($result); + $this->assertEquals($item->getPayoutItemId(), $result->getPayoutItemId()); + $this->assertEquals($item->getPayoutBatchId(), $result->getPayoutBatchId()); + $this->assertEquals($item->getTransactionId(), $result->getTransactionId()); + $this->assertEquals($item->getPayoutItemFee(), $result->getPayoutItemFee()); + } + +} diff --git a/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php b/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php index c19ce5a..468bb21 100644 --- a/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php @@ -3,12 +3,12 @@ namespace PayPal\Test\Functional\Api; use PayPal\Api\Patch; -use PayPal\Common\PPModel; +use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\CreateProfileResponse; use PayPal\Test\Functional\Setup; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -23,7 +23,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase public $response; - public $mockPPRestCall; + public $mockPayPalRestCall; public function setUp() { @@ -53,7 +53,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase $request = $this->operation['request']['body']; $obj = new WebProfile($request); $obj->setName(uniqid()); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } @@ -65,7 +65,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($createProfileResponse) { - $result = WebProfile::get($createProfileResponse->getId(), null, $this->mockPPRestCall); + $result = WebProfile::get($createProfileResponse->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($createProfileResponse->getId(), $result->getId()); $this->assertEquals($this->operation['response']['body']['presentation']['logo_image'], $result->getPresentation()->getLogoImage()); @@ -82,7 +82,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetList($webProfile) { - $result = WebProfile::get_list(null, $this->mockPPRestCall); + $result = WebProfile::get_list(null, $this->mockPayPalRestCall); $this->assertNotNull($result); $found = false; $foundObject = null; @@ -110,7 +110,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase $boolValue = $webProfile->getInputFields()->getNoShipping(); $newValue = ($boolValue + 1) % 2; $webProfile->getInputFields()->setNoShipping($newValue); - $result = $webProfile->update(null, $this->mockPPRestCall); + $result = $webProfile->update(null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($webProfile->getInputFields()->getNoShipping(), $newValue); } @@ -132,7 +132,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase "path": "/flow_config/landing_page_type" }'); - $result = $webProfile->partial_update($patches, null, $this->mockPPRestCall); + $result = $webProfile->partial_update($patches, null, $this->mockPayPalRestCall); $this->assertTrue($result); } @@ -144,7 +144,7 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase { $webProfile = new WebProfile(); $webProfile->setId($createProfileResponse->getId()); - $result = $webProfile->delete(null, $this->mockPPRestCall); + $result = $webProfile->delete(null, $this->mockPayPalRestCall); $this->assertTrue($result); } diff --git a/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php b/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php index 1f916e6..8006f5a 100644 --- a/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php @@ -15,13 +15,13 @@ use PayPal\Api\WebhookEventList; use PayPal\Api\WebhookEventType; use PayPal\Api\WebhookEventTypeList; use PayPal\Api\WebhookList; -use PayPal\Common\PPModel; -use PayPal\Exception\PPConnectionException; +use PayPal\Common\PayPalModel; +use PayPal\Exception\PayPalConnectionException; use PayPal\Rest\ApiContext; use PayPal\Rest\IResource; use PayPal\Api\CreateProfileResponse; use PayPal\Test\Functional\Setup; -use PayPal\Transport\PPRestCall; +use PayPal\Transport\PayPalRestCall; use PayPal\Api\WebProfile; /** @@ -36,7 +36,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase public $response; - public $mockPPRestCall; + public $mockPayPalRestCall; public function setUp() { @@ -68,12 +68,12 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase $obj->setUrl($obj->getUrl() . '?rand=' . uniqid()); $result = null; try { - $result = $obj->create(null, $this->mockPPRestCall); - } catch (PPConnectionException $ex) { + $result = $obj->create(null, $this->mockPayPalRestCall); + } catch (PayPalConnectionException $ex) { $data = $ex->getData(); if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { $this->deleteAll(); - $result = $obj->create(null, $this->mockPPRestCall); + $result = $obj->create(null, $this->mockPayPalRestCall); } else { $this->fail($ex->getMessage()); } @@ -84,9 +84,9 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase public function deleteAll() { - $result = Webhook::getAll(null, $this->mockPPRestCall); + $result = Webhook::getAll(null, $this->mockPayPalRestCall); foreach ($result->getWebhooks() as $webhookObject) { - $webhookObject->delete(null, $this->mockPPRestCall); + $webhookObject->delete(null, $this->mockPayPalRestCall); } } @@ -97,7 +97,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGet($webhook) { - $result = Webhook::get($webhook->getId(), null, $this->mockPPRestCall); + $result = Webhook::get($webhook->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($webhook->getId(), $result->getId()); $this->assertEquals($webhook, $result, "", 0, 10, true); @@ -111,7 +111,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetSubscribedEventTypes($webhook) { - $result = WebhookEventType::subscribedEventTypes($webhook->getId(), null, $this->mockPPRestCall); + $result = WebhookEventType::subscribedEventTypes($webhook->getId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals(2, sizeof($result->getEventTypes())); return $result; @@ -124,7 +124,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetAll($webhook) { - $result = Webhook::getAll(null, $this->mockPPRestCall); + $result = Webhook::getAll(null, $this->mockPayPalRestCall); $this->assertNotNull($result); $found = false; $foundObject = null; @@ -162,7 +162,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase $patchRequest = new PatchRequest(); $patchRequest->setPatches($patches); - $result = $webhook->update($patchRequest, null, $this->mockPPRestCall); + $result = $webhook->update($patchRequest, null, $this->mockPayPalRestCall); $this->assertNotNull($result); $found = false; $foundObject = null; @@ -181,13 +181,13 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testDelete($webhook) { - $result = $webhook->delete(null, $this->mockPPRestCall); + $result = $webhook->delete(null, $this->mockPayPalRestCall); $this->assertTrue($result); } public function testEventSearch() { - $result = WebhookEvent::all(array(),null, $this->mockPPRestCall); + $result = WebhookEvent::all(array(),null, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } diff --git a/tests/PayPal/Test/Functional/Setup.php b/tests/PayPal/Test/Functional/Setup.php index 1dd21ad..ab39a89 100644 --- a/tests/PayPal/Test/Functional/Setup.php +++ b/tests/PayPal/Test/Functional/Setup.php @@ -3,7 +3,8 @@ namespace PayPal\Test\Functional; use PayPal\Auth\OAuthTokenCredential; -use PayPal\Core\PPCredentialManager; +use PayPal\Core\PayPalConfigManager; +use PayPal\Core\PayPalCredentialManager; use PayPal\Rest\ApiContext; class Setup @@ -16,30 +17,24 @@ class Setup $context = new ApiContext(); $context->setConfig(array( 'mode' => 'sandbox', - 'acct1.ClientId' => 'AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS', - 'acct1.ClientSecret' => 'EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL', 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => '../PayPal.log', 'log.LogLevel' => 'FINE', 'validation.level' => 'warning' )); - PPCredentialManager::getInstance()->setCredentialObject( - new OAuthTokenCredential( - "AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS", - "EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL" - ) - ); + + PayPalCredentialManager::getInstance()->setCredentialObject(PayPalCredentialManager::getInstance()->getCredentialObject('acct1')); self::$mode = getenv('REST_MODE') ? getenv('REST_MODE') : 'mock'; if (self::$mode != 'sandbox') { - // Mock PPRest Caller if mode set to mock - $test->mockPPRestCall = $test->getMockBuilder('\PayPal\Transport\PPRestCall') + // Mock PayPalRest Caller if mode set to mock + $test->mockPayPalRestCall = $test->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $test->mockPPRestCall->expects($test->any()) + $test->mockPayPalRestCall->expects($test->any()) ->method('execute') ->will($test->returnValue( $test->response diff --git a/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testCreate.json b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testCreate.json new file mode 100755 index 0000000..0640d3f --- /dev/null +++ b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testCreate.json @@ -0,0 +1,106 @@ +{ + "description" : "Sender POSTs a batch with 1 payout request. This example is for sync_mode=true. This means an immediate response. For sync_mode=false, the output will be run in back ground and the repsonse will be different.", + "title" : "POST batch sample", + "runnable" : true, + "operationId" : "payouts", + "user" : { + "scopes" : [ ] + }, + "credentials" : { + "oauth": { + "path" : "/v1/oauth/token", + "clientId":"", + "clientSecret":"" + } + }, + "request":{ + "path":"v1/payments/payouts?sync_mode=true", + "method":"POST", + "headers": { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body":{ + "sender_batch_header":{ + "sender_batch_id":"2014021801", + "email_subject":"You have a Payout!" + }, + "items":[ + { + "recipient_type":"EMAIL", + "amount":{ + "value":"1.0", + "currency":"USD" + }, + "note":"Thanks for your patronage!", + "sender_item_id":"2014031400023", + "receiver":"shirt-supplier-one@mail.com" + } + ] + } + }, + "response" : { + "status" : "201 OK", + "headers" : { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body" : { + "batch_header": { + "payout_batch_id": "CDZEC5MJ8R5HY", + "batch_status": "SUCCESS", + "time_created": "2014-46-14T06:46:22Z", + "time_completed": "2014-46-14T06:46:23Z", + "sender_batch_header": { + "sender_batch_id":"2014021801", + "email_subject": "You have a Payout!" + }, + "amount": { + "currency": "USD", + "value": "1.0" + }, + "fees": { + "currency": "USD", + "value": "0.02" + } + }, + "items": [ + { + "payout_item_id": "VHBFGN95AWV82", + "transaction_id": "0728664497487461D", + "transaction_status": "SUCCESS", + "payout_item_fee": { + "currency": "USD", + "value": "0.02" + }, + "payout_batch_id": "CDZEC5MJ8R5HY", + "payout_item": { + "amount": { + "currency": "USD", + "value": "1.0" + }, + "note": "Thanks for your patronage!", + "receiver": "anybody01@gmail.com", + "recipient_type": "EMAIL", + "sender_item_id": "201403140001" + }, + "time_processed": "2014-46-14T06:46:23Z", + "links": [ + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts-item/VHBFGN95AWV82", + "rel": "item", + "method": "GET" + } + ] + } + ], + "links": [ + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts/CDZEC5MJ8R5HY", + "rel": "self", + "method": "GET" + } + ] + } + } +} diff --git a/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGet.json b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGet.json new file mode 100755 index 0000000..47101b4 --- /dev/null +++ b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGet.json @@ -0,0 +1,223 @@ +{ + "description" : "GET of a batch with multiple items.", + "title" : "GET batch with multiple items", + "runnable" : true, + "operationId" : "payouts.get", + "user" : { + "scopes" : [ ] + }, + "credentials" : { + "oauth": { + "path" : "/v1/oauth/token", + "clientId":"", + "clientSecret":"" + }, + "login" : { }, + "openIdConnect" : { } + }, + "request" : { + "path" : "v1/payments/payouts/12345678", + "method" : "GET", + "headers" : { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body":{ + } + }, + "response" : { + "status" : "200 OK", + "headers" : { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body":{ + "batch_header":{ + "payout_batch_id":"12345678", + "batch_status":"PROCESSING", + "sender_batch_id":"2014021801123", + "time_created":"2014-01-27T10:17:00Z", + "time_completed":"2014-01-27T11:17:39.00Z", + "sender_batch_header":{ + "sender_batch_id":"2014021801", + "email_subject":"You have a Payout!" + }, + "amount":{ + "value":"435.85", + "currency":"USD" + }, + "fees":{ + "value":"5.84", + "currency":"USD" + } + }, + "items":[ + { + "payout_item_id":"452176", + "transaction_id":"434176", + "transaction_status":"SUCCESS", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021887", + "payout_item_fee":{ + "currency":"USD", + "value":"1.00" + }, + "payout_item":{ + "recipient_type":"EMAIL", + "amount":{ + "value":"65.24", + "currency":"EUR" + }, + "note":"Thanks for your patronage!", + "receiver":"anybody77@gmail.com", + "payouts_item_id":"1421388", + "sender_item_id":"14Feb_978" + }, + "time_created":"2014-01-27T10:17:00:00Z", + "time_processed":"2014-01-27T10:18:32Z" + }, + { + "payout_item_id":"452123", + "transaction_id":"434123", + "transaction_status":"SUCCESS", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021802", + "payout_item_fee":{ + "currency":"USD", + "value":"1.00" + }, + "payout_item":{ + "recipient_type":"EMAIL", + "amount":{ + "value":"59.87", + "currency":"EUR" + }, + "note":"Thanks for your patronage!", + "receiver":"anybody34@gmail.com", + "payouts_item_id":"1421345", + "sender_item_id":"14Feb_321" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:18:15Z" + }, + { + "payout_item_id":"452323", + "transaction_id":"434543", + "transaction_status":"SUCCESS", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021802", + "payout_item_fee":{ + "currency":"USD", + "value":"1.00" + }, + "payout_item":{ + "recipient_type":"EMAIL", + "amount":{ + "value":"59.87", + "currency":"EUR" + }, + "note":"Thanks for your patronage!", + "receiver":"anybody03@gmail.com", + "payouts_item_id":"1421355", + "sender_item_id":"14Feb_239" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:17:15Z" + }, + { + "payout_item_id":"452350", + "transaction_id":"434543", + "transaction_status":"SUCCESS", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021801", + "payout_item_fee":{ + "currency":"USD", + "value":"0.75" + }, + "payout_item":{ + "recipient_type":"EMAIL", + "amount":{ + "value":"19.87", + "currency":"USD" + }, + "note":"Thanks for your patronage!", + "receiver":"anybody02@gmail.com", + "payouts_item_id":"1421332", + "sender_item_id":"14Feb_235" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:17:25Z" + }, + { + "payout_item_id":"452345", + "transaction_id":"4345", + "transaction_status":"SUCCESS", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021801", + "payout_item_fee":{ + "currency":"USD", + "value":"0.75" + }, + "payout_item":{ + "recipient_type":"EMAIL", + "amount":{ + "value":"9.87", + "currency":"USD" + }, + "note":"Thanks for your patronage!", + "receiver":"anybody01@gmail.com", + "payouts_item_id":"1421342", + "sender_item_id":"14Feb_234" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:17:37Z" + }, + { + "payout_item_id":"4782902", + "transaction_id":"6456456", + "transaction_status":"SUCCESS", + "payout_item_fee":{ + "currency":"USD", + "value":"2.35" + }, + "payout_batch_id":"12345678", + "sender_batch_id":"2014021801", + "payout_item":{ + "recipient_type":"PHONE", + "amount":{ + "value":"112.34", + "currency":"EUR" + }, + "note":"Thanks for your support!", + "receiver":"91-734-234-1234", + "payouts_item_id":"1421343", + "sender_item_id":"14Feb_235" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:17:52Z" + }, + { + "payout_item_id":"4782902", + "transaction_id":"", + "transaction_status":"PROCESSING", + "payout_batch_id":"12345678", + "sender_batch_id":"2014021801", + "payout_item":{ + "recipient_type":"PHONE", + "amount":{ + "value":"5.32", + "currency":"USD" + }, + "note":"Thanks for your patronage!", + "receiver":"408X234-1234", + "payouts_item_id":"1421344", + "sender_item_id":"14Feb_235" + }, + "time_created":"2014-01-27T10:17:00Z", + "time_processed":"2014-01-27T10:17:41Z" + } + ] + } + } +} + diff --git a/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json new file mode 100755 index 0000000..19adc71 --- /dev/null +++ b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json @@ -0,0 +1,65 @@ +{ + "description": "Sender needs status of one item.", + "title": "GET item sample", + "runnable": true, + "operationId": "payouts.item", + "user": { + "scopes": [] + }, + "credentials": { + "oauth": { + "path": "/v1/oauth/token", + "clientId": "", + "clientSecret": "" + } + }, + "request": { + "path": "v1/payments/payouts-item/452345", + "method": "GET", + "headers": { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body": {} + }, + "response": { + "status": "200 OK", + "headers": { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body": { + "payout_item_id": "VHBFGN95AWV82", + "transaction_status": "PENDING", + "payout_item_fee": { + "currency": "USD", + "value": "0.02" + }, + "payout_batch_id": "CDZEC5MJ8R5HY", + "transaction_id": "0728664497487461D", + "sender_batch_id": "2014021887", + "payout_item": { + "amount": { + "currency": "USD", + "value": "0.99" + }, + "note": "Thanks you.", + "receiver": "shirt-supplier-one@gmail.com", + "recipient_type": "EMAIL", + "sender_item_id": "item_154a716f035001" + }, + "links": [ + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts-item/HUUQ5YASYLQFN", + "rel": "self", + "method": "GET" + }, + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts/LNLSEVGU4P85S", + "rel": "batch", + "method": "GET" + } + ] + } + } +} diff --git a/tests/PayPal/Test/Rest/ApiContextTest.php b/tests/PayPal/Test/Rest/ApiContextTest.php index 2b9148d..0fc1778 100644 --- a/tests/PayPal/Test/Rest/ApiContextTest.php +++ b/tests/PayPal/Test/Rest/ApiContextTest.php @@ -3,7 +3,7 @@ use PayPal\Rest\ApiContext; /** - * Test class for PPAPIService. + * Test class for ApiContextTest. * */ class ApiContextTest extends PHPUnit_Framework_TestCase diff --git a/tests/PayPal/Test/Validation/NumericValidatorTest.php b/tests/PayPal/Test/Validation/NumericValidatorTest.php index 85cee40..46342cc 100644 --- a/tests/PayPal/Test/Validation/NumericValidatorTest.php +++ b/tests/PayPal/Test/Validation/NumericValidatorTest.php @@ -1,7 +1,7 @@