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.Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.
The API response provides the url that you must redirect -the buyer to. Retrieve the url from the $agreement->getLinks() -method
You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token
You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token
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
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
Obtain Authorization Code from Code, Client ID and Client Secret
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
Create a new instance of Webhook object
For Sample Purposes Only.
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.
The URL on the merchant site for transferring to after a bank transfer payment.
Parameters for style and presentation.
A URL to logo image. Allowed vaues: .gif, .jpg, or .png.
A label that overrides the business name in the PayPal account on the PayPal pages.
Locale of pages displayed by PayPal payment experience.
Parameters for input fields customization.
Enables the buyer to enter a note to the merchant on the PayPal page during checkout.
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.
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.
Name of the web experience profile. Required. Must be unique
Parameters for flow configuration.
Parameters for style and presentation.
Parameters for input field customization.
For Sample Purposes Only.
Use this call to create a profile.
Execute the delete method
If your request is successful, the API returns a web_profile object response that contains the profile details.
get_list method on the WebProfile class.
(See bootstrap.php for more on ApiContext)The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getLinks() -method
The API response provides the url that you must redirect -the buyer to. Retrieve the url from the $payment->getLinks() -method
This sample code demonstrate how you can create a synchronous payout sample, as documented here at: +https://developer.paypal.com/docs/integration/direct/create-batch-payout/ +API used: /v1/payments/payouts
Create a new instance of Payout object
This is how our body should look like:
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.
Please note that if you are using single payout with sync mode, you can only pass one Item in the request
There are many different ways of assigning values in PayPal SDK. Here is another way where you could directly inject json string.
One more way of assigning values in constructor when creating instance of PayPalModel object. Injecting array.
For Sample Purposes Only.
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
Create a new instance of Payout object
This is how our body should look like:
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.
Please note that if you are using single payout with sync mode, you can only pass one Item in the request
For Sample Purposes Only.
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/
You can replace this with your Payout Batch Id on already created Payout.
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/
You can replace this with your Payout Batch Id on already created Payout.
- 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; + } + + + + + + + + +
+ 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.
+ +
For Sample Purposes Only.