From e6fb9685099b35d5a8d777109d0c520667a73960 Mon Sep 17 00:00:00 2001 From: japatel Date: Tue, 18 Nov 2014 12:12:35 -0600 Subject: [PATCH] First Update on Invoicing APIs --- lib/PayPal/Api/BillingInfo.php | 137 ++- lib/PayPal/Api/CancelNotification.php | 52 +- lib/PayPal/Api/Cost.php | 26 +- lib/PayPal/Api/CustomAmount.php | 22 +- lib/PayPal/Api/Error.php | 126 ++- lib/PayPal/Api/ErrorDetails.php | 18 +- lib/PayPal/Api/Invoice.php | 486 +++++++--- lib/PayPal/Api/InvoiceItem.php | 67 +- lib/PayPal/Api/Invoices.php | 1045 ++++++++++++++++++++- lib/PayPal/Api/InvoicingMetaData.php | 142 ++- lib/PayPal/Api/InvoicingNotification.php | 35 +- lib/PayPal/Api/InvoicingPaymentDetail.php | 55 +- lib/PayPal/Api/InvoicingRefundDetail.php | 27 +- lib/PayPal/Api/InvoicingSearch.php | 262 ++++-- lib/PayPal/Api/MerchantInfo.php | 87 +- lib/PayPal/Api/Metadata.php | 142 ++- lib/PayPal/Api/Notification.php | 35 +- lib/PayPal/Api/PaymentDetail.php | 55 +- lib/PayPal/Api/PaymentTerm.php | 37 +- lib/PayPal/Api/Phone.php | 26 +- lib/PayPal/Api/RefundDetail.php | 27 +- lib/PayPal/Api/Search.php | 262 ++++-- lib/PayPal/Api/ShippingCost.php | 26 +- lib/PayPal/Api/ShippingInfo.php | 50 +- lib/PayPal/Api/Tax.php | 34 +- 25 files changed, 2729 insertions(+), 552 deletions(-) diff --git a/lib/PayPal/Api/BillingInfo.php b/lib/PayPal/Api/BillingInfo.php index a18f9b1..435a7d9 100644 --- a/lib/PayPal/Api/BillingInfo.php +++ b/lib/PayPal/Api/BillingInfo.php @@ -1,15 +1,34 @@ email; } - /** * First name of the invoice recipient. 30 characters max. * * @param string $first_name + * + * @return $this */ public function setFirstName($first_name) { @@ -52,8 +72,10 @@ class BillingInfo extends PPModel /** * First name of the invoice recipient. 30 characters max. * + * @deprecated Instead use setFirstName + * * @param string $first_name - * @deprecated. Instead use setFirstName + * @return $this */ public function setFirst_name($first_name) { @@ -63,9 +85,9 @@ class BillingInfo extends PPModel /** * First name of the invoice recipient. 30 characters max. + * @deprecated Instead use getFirstName * * @return string - * @deprecated. Instead use getFirstName */ public function getFirst_name() { @@ -76,6 +98,8 @@ class BillingInfo extends PPModel * Last name of the invoice recipient. 30 characters max. * * @param string $last_name + * + * @return $this */ public function setLastName($last_name) { @@ -96,8 +120,10 @@ class BillingInfo extends PPModel /** * Last name of the invoice recipient. 30 characters max. * + * @deprecated Instead use setLastName + * * @param string $last_name - * @deprecated. Instead use setLastName + * @return $this */ public function setLast_name($last_name) { @@ -107,9 +133,9 @@ class BillingInfo extends PPModel /** * Last name of the invoice recipient. 30 characters max. + * @deprecated Instead use getLastName * * @return string - * @deprecated. Instead use getLastName */ public function getLast_name() { @@ -120,6 +146,8 @@ class BillingInfo extends PPModel * Company business name of the invoice recipient. 100 characters max. * * @param string $business_name + * + * @return $this */ public function setBusinessName($business_name) { @@ -140,8 +168,10 @@ class BillingInfo extends PPModel /** * Company business name of the invoice recipient. 100 characters max. * + * @deprecated Instead use setBusinessName + * * @param string $business_name - * @deprecated. Instead use setBusinessName + * @return $this */ public function setBusiness_name($business_name) { @@ -151,9 +181,9 @@ class BillingInfo extends PPModel /** * Company business name of the invoice recipient. 100 characters max. + * @deprecated Instead use getBusinessName * * @return string - * @deprecated. Instead use getBusinessName */ public function getBusiness_name() { @@ -163,7 +193,9 @@ class BillingInfo extends PPModel /** * Address of the invoice recipient. * - * @param PayPal\Api\Address $address + * @param \PayPal\Api\Address $address + * + * @return $this */ public function setAddress($address) { @@ -174,18 +206,20 @@ class BillingInfo extends PPModel /** * Address of the invoice recipient. * - * @return PayPal\Api\Address + * @return \PayPal\Api\Address */ public function getAddress() { return $this->address; } - /** * Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account. + * Valid Values: ["da_DK", "de_DE", "en_AU", "en_GB", "en_US", "es_ES", "es_XC", "fr_CA", "fr_FR", "fr_XC", "he_IL", "id_ID", "it_IT", "ja_JP", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "th_TH", "tr_TR", "zh_CN", "zh_HK", "zh_TW", "zh_XC"] * * @param string $language + * + * @return $this */ public function setLanguage($language) { @@ -203,11 +237,12 @@ class BillingInfo extends PPModel return $this->language; } - /** * Option to display additional information such as business hours. 40 characters max. * * @param string $additional_info + * + * @return $this */ public function setAdditionalInfo($additional_info) { @@ -228,8 +263,10 @@ class BillingInfo extends PPModel /** * Option to display additional information such as business hours. 40 characters max. * + * @deprecated Instead use setAdditionalInfo + * * @param string $additional_info - * @deprecated. Instead use setAdditionalInfo + * @return $this */ public function setAdditional_info($additional_info) { @@ -239,13 +276,85 @@ class BillingInfo extends PPModel /** * Option to display additional information such as business hours. 40 characters max. + * @deprecated Instead use getAdditionalInfo * * @return string - * @deprecated. Instead use getAdditionalInfo */ public function getAdditional_info() { return $this->additional_info; } + /** + * Preferred notification channel of the payer. Email by default. + * Valid Values: ["SMS", "EMAIL"] + * + * @param string $notification_channel + * + * @return $this + */ + public function setNotificationChannel($notification_channel) + { + $this->notification_channel = $notification_channel; + return $this; + } + + /** + * Preferred notification channel of the payer. Email by default. + * + * @return string + */ + public function getNotificationChannel() + { + 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. + * + * @param \PayPal\Api\Phone $phone + * + * @return $this + */ + public function setPhone($phone) + { + $this->phone = $phone; + return $this; + } + + /** + * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS. + * + * @return \PayPal\Api\Phone + */ + public function getPhone() + { + return $this->phone; + } + } diff --git a/lib/PayPal/Api/CancelNotification.php b/lib/PayPal/Api/CancelNotification.php index c8f2a01..2f5c115 100644 --- a/lib/PayPal/Api/CancelNotification.php +++ b/lib/PayPal/Api/CancelNotification.php @@ -1,15 +1,29 @@ subject; } - /** * Note to the payer. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -49,11 +64,12 @@ class CancelNotification extends PPModel return $this->note; } - /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant + * @param bool $send_to_merchant + * + * @return $this */ public function setSendToMerchant($send_to_merchant) { @@ -64,7 +80,7 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @return boolean + * @return bool */ public function getSendToMerchant() { @@ -74,8 +90,10 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant + * @deprecated Instead use setSendToMerchant + * + * @param bool $send_to_merchant + * @return $this */ public function setSend_to_merchant($send_to_merchant) { @@ -85,9 +103,9 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. + * @deprecated Instead use getSendToMerchant * - * @return boolean - * @deprecated. Instead use getSendToMerchant + * @return bool */ public function getSend_to_merchant() { @@ -97,7 +115,9 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the payer. * - * @param boolean $send_to_payer + * @param bool $send_to_payer + * + * @return $this */ public function setSendToPayer($send_to_payer) { @@ -108,7 +128,7 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the payer. * - * @return boolean + * @return bool */ public function getSendToPayer() { @@ -118,8 +138,10 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the payer. * - * @param boolean $send_to_payer - * @deprecated. Instead use setSendToPayer + * @deprecated Instead use setSendToPayer + * + * @param bool $send_to_payer + * @return $this */ public function setSend_to_payer($send_to_payer) { @@ -129,9 +151,9 @@ class CancelNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the payer. + * @deprecated Instead use getSendToPayer * - * @return boolean - * @deprecated. Instead use getSendToPayer + * @return bool */ public function getSend_to_payer() { diff --git a/lib/PayPal/Api/Cost.php b/lib/PayPal/Api/Cost.php index 1551f1e..55aac44 100644 --- a/lib/PayPal/Api/Cost.php +++ b/lib/PayPal/Api/Cost.php @@ -1,15 +1,27 @@ percent; } - /** * Cost in amount. Range of 0 to 999999.99. * - * @param PayPal\Api\Currency $amount + * @param \PayPal\Api\Currency $amount + * + * @return $this */ public function setAmount($amount) { @@ -42,12 +55,11 @@ class Cost extends PPModel /** * Cost in amount. Range of 0 to 999999.99. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getAmount() { return $this->amount; } - } diff --git a/lib/PayPal/Api/CustomAmount.php b/lib/PayPal/Api/CustomAmount.php index e4f9305..3727a5a 100644 --- a/lib/PayPal/Api/CustomAmount.php +++ b/lib/PayPal/Api/CustomAmount.php @@ -1,15 +1,27 @@ label; } - /** * Custom amount value. Range of 0 to 999999.99. * - * @param PayPal\Api\Currency $amount + * @param \PayPal\Api\Currency $amount + * + * @return $this */ public function setAmount($amount) { @@ -42,12 +55,11 @@ class CustomAmount extends PPModel /** * Custom amount value. Range of 0 to 999999.99. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getAmount() { return $this->amount; } - } diff --git a/lib/PayPal/Api/Error.php b/lib/PayPal/Api/Error.php index 31720c6..9f5eac4 100644 --- a/lib/PayPal/Api/Error.php +++ b/lib/PayPal/Api/Error.php @@ -1,15 +1,31 @@ name; } - /** * PayPal internal identifier used for correlation purposes. * * @param string $debug_id + * + * @return $this */ public function setDebugId($debug_id) { @@ -52,8 +69,10 @@ class Error extends PPModel /** * PayPal internal identifier used for correlation purposes. * + * @deprecated Instead use setDebugId + * * @param string $debug_id - * @deprecated. Instead use setDebugId + * @return $this */ public function setDebug_id($debug_id) { @@ -63,9 +82,9 @@ class Error extends PPModel /** * PayPal internal identifier used for correlation purposes. + * @deprecated Instead use getDebugId * * @return string - * @deprecated. Instead use getDebugId */ public function getDebug_id() { @@ -76,6 +95,8 @@ class Error extends PPModel * Message describing the error. * * @param string $message + * + * @return $this */ public function setMessage($message) { @@ -93,11 +114,12 @@ class Error extends PPModel return $this->message; } - /** * URI for detailed information related to this error for the developer. * * @param string $information_link + * + * @return $this */ public function setInformationLink($information_link) { @@ -118,8 +140,10 @@ class Error extends PPModel /** * URI for detailed information related to this error for the developer. * + * @deprecated Instead use setInformationLink + * * @param string $information_link - * @deprecated. Instead use setInformationLink + * @return $this */ public function setInformation_link($information_link) { @@ -129,9 +153,9 @@ class Error extends PPModel /** * URI for detailed information related to this error for the developer. + * @deprecated Instead use getInformationLink * * @return string - * @deprecated. Instead use getInformationLink */ public function getInformation_link() { @@ -141,7 +165,9 @@ class Error extends PPModel /** * Additional details of the error * - * @param PayPal\Api\ErrorDetails $details + * @param \PayPal\Api\ErrorDetails[] $details + * + * @return $this */ public function setDetails($details) { @@ -152,12 +178,94 @@ class Error extends PPModel /** * Additional details of the error * - * @return PayPal\Api\ErrorDetails + * @return \PayPal\Api\ErrorDetails[] */ public function getDetails() { return $this->details; } + /** + * Append Details to the list. + * + * @param \PayPal\Api\ErrorDetails $errorDetails + * @return $this + */ + public function addDetail($errorDetails) + { + if (!$this->getDetails()) { + return $this->setDetails(array($errorDetails)); + } else { + return $this->setDetails( + array_merge($this->getDetails(), array($errorDetails)) + ); + } + } + + /** + * Remove Details from the list. + * + * @param \PayPal\Api\ErrorDetails $errorDetails + * @return $this + */ + public function removeDetail($errorDetails) + { + return $this->setDetails( + array_diff($this->getDetails(), array($errorDetails)) + ); + } + + /** + * 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/ErrorDetails.php b/lib/PayPal/Api/ErrorDetails.php index 6b02af0..e2fc039 100644 --- a/lib/PayPal/Api/ErrorDetails.php +++ b/lib/PayPal/Api/ErrorDetails.php @@ -1,15 +1,27 @@ field; } - /** * Reason for the error. * * @param string $issue + * + * @return $this */ public function setIssue($issue) { @@ -49,5 +62,4 @@ class ErrorDetails extends PPModel return $this->issue; } - } diff --git a/lib/PayPal/Api/Invoice.php b/lib/PayPal/Api/Invoice.php index adeb113..4f2f425 100644 --- a/lib/PayPal/Api/Invoice.php +++ b/lib/PayPal/Api/Invoice.php @@ -1,16 +1,46 @@ id; } - /** * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. * * @param string $number + * + * @return $this */ public function setNumber($number) { @@ -57,11 +90,12 @@ class Invoice extends ResourceModel return $this->number; } - /** * URI of the invoice resource. * * @param string $uri + * + * @return $this */ public function setUri($uri) { @@ -79,11 +113,13 @@ class Invoice extends ResourceModel return $this->uri; } - /** * Status of the invoice. + * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED"] * * @param string $status + * + * @return $this */ public function setStatus($status) { @@ -101,11 +137,12 @@ class Invoice extends ResourceModel return $this->status; } - /** * Information about the merchant who is sending the invoice. * * @param \PayPal\Api\MerchantInfo $merchant_info + * + * @return $this */ public function setMerchantInfo($merchant_info) { @@ -126,8 +163,10 @@ class Invoice extends ResourceModel /** * Information about the merchant who is sending the invoice. * + * @deprecated Instead use setMerchantInfo + * * @param \PayPal\Api\MerchantInfo $merchant_info - * @deprecated. Instead use setMerchantInfo + * @return $this */ public function setMerchant_info($merchant_info) { @@ -137,9 +176,9 @@ class Invoice extends ResourceModel /** * Information about the merchant who is sending the invoice. + * @deprecated Instead use getMerchantInfo * * @return \PayPal\Api\MerchantInfo - * @deprecated. Instead use getMerchantInfo */ public function getMerchant_info() { @@ -149,7 +188,9 @@ class Invoice extends ResourceModel /** * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). * - * @param \PayPal\Api\BillingInfo $billing_info + * @param \PayPal\Api\BillingInfo[] $billing_info + * + * @return $this */ public function setBillingInfo($billing_info) { @@ -160,18 +201,50 @@ class Invoice extends ResourceModel /** * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). * - * @return \PayPal\Api\BillingInfo + * @return \PayPal\Api\BillingInfo[] */ public function getBillingInfo() { return $this->billing_info; } + /** + * Append BillingInfo to the list. + * + * @param \PayPal\Api\BillingInfo $billingInfo + * @return $this + */ + public function addBillingInfo($billingInfo) + { + if (!$this->getBillingInfo()) { + return $this->setBillingInfo(array($billingInfo)); + } else { + return $this->setBillingInfo( + array_merge($this->getBillingInfo(), array($billingInfo)) + ); + } + } + + /** + * Remove BillingInfo from the list. + * + * @param \PayPal\Api\BillingInfo $billingInfo + * @return $this + */ + public function removeBillingInfo($billingInfo) + { + return $this->setBillingInfo( + array_diff($this->getBillingInfo(), array($billingInfo)) + ); + } + /** * 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 - * @deprecated. Instead use setBillingInfo + * @return $this */ public function setBilling_info($billing_info) { @@ -181,9 +254,9 @@ class Invoice extends ResourceModel /** * 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 - * @deprecated. Instead use getBillingInfo */ public function getBilling_info() { @@ -194,6 +267,8 @@ class Invoice extends ResourceModel * Shipping information for entities to whom items are being shipped. * * @param \PayPal\Api\ShippingInfo $shipping_info + * + * @return $this */ public function setShippingInfo($shipping_info) { @@ -214,8 +289,10 @@ class Invoice extends ResourceModel /** * Shipping information for entities to whom items are being shipped. * + * @deprecated Instead use setShippingInfo + * * @param \PayPal\Api\ShippingInfo $shipping_info - * @deprecated. Instead use setShippingInfo + * @return $this */ public function setShipping_info($shipping_info) { @@ -225,9 +302,9 @@ class Invoice extends ResourceModel /** * Shipping information for entities to whom items are being shipped. + * @deprecated Instead use getShippingInfo * * @return \PayPal\Api\ShippingInfo - * @deprecated. Instead use getShippingInfo */ public function getShipping_info() { @@ -237,7 +314,9 @@ class Invoice extends ResourceModel /** * List of items included in the invoice. 100 items max per invoice. * - * @param \PayPal\Api\InvoiceItem $items + * @param \PayPal\Api\InvoiceItem[] $items + * + * @return $this */ public function setItems($items) { @@ -248,18 +327,49 @@ class Invoice extends ResourceModel /** * List of items included in the invoice. 100 items max per invoice. * - * @return \PayPal\Api\InvoiceItem + * @return \PayPal\Api\InvoiceItem[] */ public function getItems() { return $this->items; } + /** + * Append Items to the list. + * + * @param \PayPal\Api\InvoiceItem $invoiceItem + * @return $this + */ + public function addItem($invoiceItem) + { + if (!$this->getItems()) { + return $this->setItems(array($invoiceItem)); + } else { + return $this->setItems( + array_merge($this->getItems(), array($invoiceItem)) + ); + } + } /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * Remove Items from the list. + * + * @param \PayPal\Api\InvoiceItem $invoiceItem + * @return $this + */ + public function removeItem($invoiceItem) + { + return $this->setItems( + array_diff($this->getItems(), array($invoiceItem)) + ); + } + + /** + * 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). * * @param string $invoice_date + * + * @return $this */ public function setInvoiceDate($invoice_date) { @@ -268,7 +378,7 @@ class Invoice extends ResourceModel } /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * 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). * * @return string */ @@ -278,10 +388,12 @@ class Invoice extends ResourceModel } /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * 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 - * @deprecated. Instead use setInvoiceDate + * @return $this */ public function setInvoice_date($invoice_date) { @@ -290,10 +402,10 @@ class Invoice extends ResourceModel } /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * 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 - * @deprecated. Instead use getInvoiceDate */ public function getInvoice_date() { @@ -304,6 +416,8 @@ class Invoice extends ResourceModel * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. * * @param \PayPal\Api\PaymentTerm $payment_term + * + * @return $this */ public function setPaymentTerm($payment_term) { @@ -324,8 +438,10 @@ class Invoice extends ResourceModel /** * 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 - * @deprecated. Instead use setPaymentTerm + * @return $this */ public function setPayment_term($payment_term) { @@ -335,9 +451,9 @@ class Invoice extends ResourceModel /** * 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 - * @deprecated. Instead use getPaymentTerm */ public function getPayment_term() { @@ -348,6 +464,8 @@ class Invoice extends ResourceModel * Invoice level discount in percent or amount. * * @param \PayPal\Api\Cost $discount + * + * @return $this */ public function setDiscount($discount) { @@ -365,11 +483,12 @@ class Invoice extends ResourceModel return $this->discount; } - /** * Shipping cost in percent or amount. * * @param \PayPal\Api\ShippingCost $shipping_cost + * + * @return $this */ public function setShippingCost($shipping_cost) { @@ -390,8 +509,10 @@ class Invoice extends ResourceModel /** * Shipping cost in percent or amount. * + * @deprecated Instead use setShippingCost + * * @param \PayPal\Api\ShippingCost $shipping_cost - * @deprecated. Instead use setShippingCost + * @return $this */ public function setShipping_cost($shipping_cost) { @@ -401,9 +522,9 @@ class Invoice extends ResourceModel /** * Shipping cost in percent or amount. + * @deprecated Instead use getShippingCost * * @return \PayPal\Api\ShippingCost - * @deprecated. Instead use getShippingCost */ public function getShipping_cost() { @@ -414,6 +535,8 @@ class Invoice extends ResourceModel * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. * * @param \PayPal\Api\CustomAmount $custom + * + * @return $this */ public function setCustom($custom) { @@ -431,11 +554,12 @@ class Invoice extends ResourceModel return $this->custom; } - /** * 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. * - * @param boolean $tax_calculated_after_discount + * @param bool $tax_calculated_after_discount + * + * @return $this */ public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) { @@ -446,7 +570,7 @@ class Invoice extends ResourceModel /** * 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. * - * @return boolean + * @return bool */ public function getTaxCalculatedAfterDiscount() { @@ -456,8 +580,10 @@ class Invoice extends ResourceModel /** * 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. * - * @param boolean $tax_calculated_after_discount - * @deprecated. Instead use setTaxCalculatedAfterDiscount + * @deprecated Instead use setTaxCalculatedAfterDiscount + * + * @param bool $tax_calculated_after_discount + * @return $this */ public function setTax_calculated_after_discount($tax_calculated_after_discount) { @@ -467,9 +593,9 @@ class Invoice extends ResourceModel /** * 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 boolean - * @deprecated. Instead use getTaxCalculatedAfterDiscount + * @return bool */ public function getTax_calculated_after_discount() { @@ -479,7 +605,9 @@ class Invoice extends ResourceModel /** * A flag indicating whether the unit price includes tax. Default is false * - * @param boolean $tax_inclusive + * @param bool $tax_inclusive + * + * @return $this */ public function setTaxInclusive($tax_inclusive) { @@ -490,7 +618,7 @@ class Invoice extends ResourceModel /** * A flag indicating whether the unit price includes tax. Default is false * - * @return boolean + * @return bool */ public function getTaxInclusive() { @@ -500,8 +628,10 @@ class Invoice extends ResourceModel /** * A flag indicating whether the unit price includes tax. Default is false * - * @param boolean $tax_inclusive - * @deprecated. Instead use setTaxInclusive + * @deprecated Instead use setTaxInclusive + * + * @param bool $tax_inclusive + * @return $this */ public function setTax_inclusive($tax_inclusive) { @@ -511,9 +641,9 @@ class Invoice extends ResourceModel /** * A flag indicating whether the unit price includes tax. Default is false + * @deprecated Instead use getTaxInclusive * - * @return boolean - * @deprecated. Instead use getTaxInclusive + * @return bool */ public function getTax_inclusive() { @@ -524,6 +654,8 @@ class Invoice extends ResourceModel * General terms of the invoice. 4000 characters max. * * @param string $terms + * + * @return $this */ public function setTerms($terms) { @@ -541,11 +673,12 @@ class Invoice extends ResourceModel return $this->terms; } - /** * Note to the payer. 4000 characters max. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -563,11 +696,12 @@ class Invoice extends ResourceModel return $this->note; } - /** * Bookkeeping memo that is private to the merchant. 150 characters max. * * @param string $merchant_memo + * + * @return $this */ public function setMerchantMemo($merchant_memo) { @@ -588,8 +722,10 @@ class Invoice extends ResourceModel /** * Bookkeeping memo that is private to the merchant. 150 characters max. * + * @deprecated Instead use setMerchantMemo + * * @param string $merchant_memo - * @deprecated. Instead use setMerchantMemo + * @return $this */ public function setMerchant_memo($merchant_memo) { @@ -599,9 +735,9 @@ class Invoice extends ResourceModel /** * Bookkeeping memo that is private to the merchant. 150 characters max. + * @deprecated Instead use getMerchantMemo * * @return string - * @deprecated. Instead use getMerchantMemo */ public function getMerchant_memo() { @@ -612,9 +748,12 @@ class Invoice extends ResourceModel * Full URL of an external image to use as the logo. 4000 characters max. * * @param string $logo_url + * @throws \InvalidArgumentException + * @return $this */ public function setLogoUrl($logo_url) { + UrlValidator::validate($logo_url, "LogoUrl"); $this->logo_url = $logo_url; return $this; } @@ -632,8 +771,10 @@ class Invoice extends ResourceModel /** * Full URL of an external image to use as the logo. 4000 characters max. * + * @deprecated Instead use setLogoUrl + * * @param string $logo_url - * @deprecated. Instead use setLogoUrl + * @return $this */ public function setLogo_url($logo_url) { @@ -643,9 +784,9 @@ class Invoice extends ResourceModel /** * Full URL of an external image to use as the logo. 4000 characters max. + * @deprecated Instead use getLogoUrl * * @return string - * @deprecated. Instead use getLogoUrl */ public function getLogo_url() { @@ -656,6 +797,8 @@ class Invoice extends ResourceModel * The total amount of the invoice. * * @param \PayPal\Api\Currency $total_amount + * + * @return $this */ public function setTotalAmount($total_amount) { @@ -676,8 +819,10 @@ class Invoice extends ResourceModel /** * The total amount of the invoice. * + * @deprecated Instead use setTotalAmount + * * @param \PayPal\Api\Currency $total_amount - * @deprecated. Instead use setTotalAmount + * @return $this */ public function setTotal_amount($total_amount) { @@ -687,45 +832,21 @@ class Invoice extends ResourceModel /** * The total amount of the invoice. + * @deprecated Instead use getTotalAmount * * @return \PayPal\Api\Currency - * @deprecated. Instead use getTotalAmount */ public function getTotal_amount() { return $this->total_amount; } - /** - * Set Payments - * A list of Payment resources - * - * @param \PayPal\Api\Payment $payments - * - * @return $this - */ - public function setPayments($payments) - { - $this->payments = $payments; - - return $this; - } - - /** - * Get Payments - * A list of Payment resources - * - * @return \PayPal\Api\Payment - */ - public function getPayments() - { - return $this->payments; - } - /** * List of payment details for the invoice. * - * @param \PayPal\Api\PaymentDetail $payment_details + * @param \PayPal\Api\PaymentDetail[] $payment_details + * + * @return $this */ public function setPaymentDetails($payment_details) { @@ -736,18 +857,50 @@ class Invoice extends ResourceModel /** * List of payment details for the invoice. * - * @return \PayPal\Api\PaymentDetail + * @return \PayPal\Api\PaymentDetail[] */ public function getPaymentDetails() { return $this->payment_details; } + /** + * Append PaymentDetails to the list. + * + * @param \PayPal\Api\PaymentDetail $paymentDetail + * @return $this + */ + public function addPaymentDetail($paymentDetail) + { + if (!$this->getPaymentDetails()) { + return $this->setPaymentDetails(array($paymentDetail)); + } else { + return $this->setPaymentDetails( + array_merge($this->getPaymentDetails(), array($paymentDetail)) + ); + } + } + + /** + * Remove PaymentDetails from the list. + * + * @param \PayPal\Api\PaymentDetail $paymentDetail + * @return $this + */ + public function removePaymentDetail($paymentDetail) + { + return $this->setPaymentDetails( + array_diff($this->getPaymentDetails(), array($paymentDetail)) + ); + } + /** * List of payment details for the invoice. * + * @deprecated Instead use setPaymentDetails + * * @param \PayPal\Api\PaymentDetail $payment_details - * @deprecated. Instead use setPaymentDetails + * @return $this */ public function setPayment_details($payment_details) { @@ -757,9 +910,9 @@ class Invoice extends ResourceModel /** * List of payment details for the invoice. + * @deprecated Instead use getPaymentDetails * * @return \PayPal\Api\PaymentDetail - * @deprecated. Instead use getPaymentDetails */ public function getPayment_details() { @@ -769,7 +922,9 @@ class Invoice extends ResourceModel /** * List of refund details for the invoice. * - * @param \PayPal\Api\RefundDetail $refund_details + * @param \PayPal\Api\RefundDetail[] $refund_details + * + * @return $this */ public function setRefundDetails($refund_details) { @@ -780,18 +935,50 @@ class Invoice extends ResourceModel /** * List of refund details for the invoice. * - * @return \PayPal\Api\RefundDetail + * @return \PayPal\Api\RefundDetail[] */ public function getRefundDetails() { return $this->refund_details; } + /** + * Append RefundDetails to the list. + * + * @param \PayPal\Api\RefundDetail $refundDetail + * @return $this + */ + public function addRefundDetail($refundDetail) + { + if (!$this->getRefundDetails()) { + return $this->setRefundDetails(array($refundDetail)); + } else { + return $this->setRefundDetails( + array_merge($this->getRefundDetails(), array($refundDetail)) + ); + } + } + + /** + * Remove RefundDetails from the list. + * + * @param \PayPal\Api\RefundDetail $refundDetail + * @return $this + */ + public function removeRefundDetail($refundDetail) + { + return $this->setRefundDetails( + array_diff($this->getRefundDetails(), array($refundDetail)) + ); + } + /** * List of refund details for the invoice. * + * @deprecated Instead use setRefundDetails + * * @param \PayPal\Api\RefundDetail $refund_details - * @deprecated. Instead use setRefundDetails + * @return $this */ public function setRefund_details($refund_details) { @@ -801,9 +988,9 @@ class Invoice extends ResourceModel /** * List of refund details for the invoice. + * @deprecated Instead use getRefundDetails * * @return \PayPal\Api\RefundDetail - * @deprecated. Instead use getRefundDetails */ public function getRefund_details() { @@ -814,6 +1001,8 @@ class Invoice extends ResourceModel * Audit information for the invoice. * * @param \PayPal\Api\Metadata $metadata + * + * @return $this */ public function setMetadata($metadata) { @@ -831,9 +1020,56 @@ class Invoice extends ResourceModel return $this->metadata; } + /** + * Any miscellaneous invoice data. 4000 characters max. + * + * @param string $additional_data + * + * @return $this + */ + public function setAdditionalData($additional_data) + { + $this->additional_data = $additional_data; + return $this; + } /** - * Creates a new invoice Resource. + * Any miscellaneous invoice data. 4000 characters max. + * + * @return string + */ + public function getAdditionalData() + { + 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 @@ -846,7 +1082,7 @@ class Invoice extends ResourceModel "/v1/invoicing/invoices", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -855,7 +1091,7 @@ class Invoice extends ResourceModel } /** - * Search for invoice resources. + * Search for a specific invoice or invoices by passing a search object that specifies your search criteria to the request URI. * * @param Search $search * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -870,7 +1106,7 @@ class Invoice extends ResourceModel "/v1/invoicing/search", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -880,7 +1116,7 @@ class Invoice extends ResourceModel } /** - * Sends a legitimate invoice to the payer. + * 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 @@ -894,7 +1130,7 @@ class Invoice extends ResourceModel "/v1/invoicing/invoices/{$this->getId()}/send", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -902,7 +1138,7 @@ class Invoice extends ResourceModel } /** - * Reminds the payer to pay the invoice. + * Send a reminder about a specific invoice to its intended recipient by providing the ID of the invoice in the request URI. In addition, pass a notification object that specifies the subject of the reminder and other details in the request JSON. * * @param Notification $notification * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -912,13 +1148,13 @@ class Invoice extends ResourceModel public function remind($notification, $apiContext = null, $restCall = null) { ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($notification, "Notification"); + ArgumentValidator::validate($notification, 'notification'); $payLoad = $notification->toJSON(); self::executeCall( "/v1/invoicing/invoices/{$this->getId()}/remind", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -926,7 +1162,7 @@ class Invoice extends ResourceModel } /** - * Cancels an invoice. + * Cancel an invoice by passing the invoice ID to the request URI. * * @param CancelNotification $cancelNotification * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -936,13 +1172,13 @@ class Invoice extends ResourceModel public function cancel($cancelNotification, $apiContext = null, $restCall = null) { ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($cancelNotification, "CancelNotification"); + ArgumentValidator::validate($cancelNotification, 'cancelNotification'); $payLoad = $cancelNotification->toJSON(); self::executeCall( "/v1/invoicing/invoices/{$this->getId()}/cancel", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -950,23 +1186,23 @@ class Invoice extends ResourceModel } /** - * Mark the status of the invoice as paid. + * Mark the status of an invoice as paid by passing the invoice ID to the request URI. In addition, pass a payment detail object that specifies the payment method and other details in the request JSON. * * @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 * @return bool */ - public function record_payment($paymentDetail, $apiContext = null, $restCall = null) + public function recordPayment($paymentDetail, $apiContext = null, $restCall = null) { ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($paymentDetail, "PaymentDetail"); + ArgumentValidator::validate($paymentDetail, 'paymentDetail'); $payLoad = $paymentDetail->toJSON(); self::executeCall( "/v1/invoicing/invoices/{$this->getId()}/record-payment", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -974,23 +1210,23 @@ class Invoice extends ResourceModel } /** - * Mark the status of the invoice as refunded. + * Mark the status of an invoice as refunded by passing the invoice ID to the request URI. In addition, pass a refund-detail object that specifies the type of refund and other details in the request JSON. * * @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 * @return bool */ - public function record_refund($refundDetail, $apiContext = null, $restCall = null) + public function recordRefund($refundDetail, $apiContext = null, $restCall = null) { ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refundDetail, "RefundDetail"); + ArgumentValidator::validate($refundDetail, 'refundDetail'); $payLoad = $refundDetail->toJSON(); self::executeCall( "/v1/invoicing/invoices/{$this->getId()}/record-refund", "POST", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -998,7 +1234,7 @@ class Invoice extends ResourceModel } /** - * Get the invoice resource for the given identifier. + * Retrieve the details for a particular invoice by passing the invoice ID to the request URI. * * @param string $invoiceId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -1007,13 +1243,13 @@ class Invoice extends ResourceModel */ public static function get($invoiceId, $apiContext = null, $restCall = null) { - ArgumentValidator::validate($invoiceId); + ArgumentValidator::validate($invoiceId, 'invoiceId'); $payLoad = ""; $json = self::executeCall( "/v1/invoicing/invoices/$invoiceId", "GET", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -1023,20 +1259,20 @@ class Invoice extends ResourceModel } /** - * Get all invoices of a merchant. + * 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 Invoices */ - public static function get_all($apiContext = null, $restCall = null) + public static function getAll($apiContext = null, $restCall = null) { $payLoad = ""; $json = self::executeCall( "/v1/invoicing/invoices/", "GET", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -1046,7 +1282,7 @@ class Invoice extends ResourceModel } /** - * Full update of the invoice resource for the given identifier. + * 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 @@ -1060,7 +1296,7 @@ class Invoice extends ResourceModel "/v1/invoicing/invoices/{$this->getId()}", "PUT", $payLoad, - array(), + null, $apiContext, $restCall ); @@ -1069,7 +1305,7 @@ class Invoice extends ResourceModel } /** - * Delete invoice resource for the given identifier. + * 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 @@ -1083,10 +1319,36 @@ class Invoice extends ResourceModel "/v1/invoicing/invoices/{$this->getId()}", "DELETE", $payLoad, - array(), + null, $apiContext, $restCall ); return true; } + + /** + * Generate a QR code for an invoice by passing the invoice ID to the request URI. The request generates a QR code that is 500 pixels in width and height. You can change the dimensions of the returned code by specifying optional query parameters. + * + * @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 + * @return object + */ + public static function qrCode($invoiceId, $apiContext = null, $restCall = null) + { + ArgumentValidator::validate($invoiceId, 'invoiceId'); + $payLoad = ""; + $json = self::executeCall( + "/v1/invoicing/invoices/$invoiceId/qr-code", + "GET", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new object(); + $ret->fromJson($json); + return $ret; + } + } diff --git a/lib/PayPal/Api/InvoiceItem.php b/lib/PayPal/Api/InvoiceItem.php index 734db69..49453f1 100644 --- a/lib/PayPal/Api/InvoiceItem.php +++ b/lib/PayPal/Api/InvoiceItem.php @@ -1,15 +1,32 @@ name; } - /** * Description of the item. 1000 characters max. * * @param string $description + * + * @return $this */ public function setDescription($description) { @@ -49,11 +67,12 @@ class InvoiceItem extends PPModel return $this->description; } - /** * Quantity of the item. Range of 0 to 9999.999. * - * @param PayPal\Api\number $quantity + * @param \PayPal\Api\number $quantity + * + * @return $this */ public function setQuantity($quantity) { @@ -64,18 +83,19 @@ class InvoiceItem extends PPModel /** * Quantity of the item. Range of 0 to 9999.999. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getQuantity() { return $this->quantity; } - /** * Unit price of the item. Range of -999999.99 to 999999.99. * - * @param PayPal\Api\Currency $unit_price + * @param \PayPal\Api\Currency $unit_price + * + * @return $this */ public function setUnitPrice($unit_price) { @@ -86,7 +106,7 @@ class InvoiceItem extends PPModel /** * Unit price of the item. Range of -999999.99 to 999999.99. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getUnitPrice() { @@ -96,8 +116,10 @@ class InvoiceItem extends PPModel /** * Unit price of the item. Range of -999999.99 to 999999.99. * - * @param PayPal\Api\Currency $unit_price - * @deprecated. Instead use setUnitPrice + * @deprecated Instead use setUnitPrice + * + * @param \PayPal\Api\Currency $unit_price + * @return $this */ public function setUnit_price($unit_price) { @@ -107,9 +129,9 @@ class InvoiceItem extends PPModel /** * Unit price of the item. Range of -999999.99 to 999999.99. + * @deprecated Instead use getUnitPrice * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUnitPrice + * @return \PayPal\Api\Currency */ public function getUnit_price() { @@ -119,7 +141,9 @@ class InvoiceItem extends PPModel /** * Tax associated with the item. * - * @param PayPal\Api\Tax $tax + * @param \PayPal\Api\Tax $tax + * + * @return $this */ public function setTax($tax) { @@ -130,18 +154,19 @@ class InvoiceItem extends PPModel /** * Tax associated with the item. * - * @return PayPal\Api\Tax + * @return \PayPal\Api\Tax */ public function getTax() { return $this->tax; } - /** - * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * Date on which the item or service was provided. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @param string $date + * + * @return $this */ public function setDate($date) { @@ -150,7 +175,7 @@ class InvoiceItem extends PPModel } /** - * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * Date on which the item or service was provided. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @return string */ @@ -159,11 +184,12 @@ class InvoiceItem extends PPModel return $this->date; } - /** * Item discount in percent or amount. * - * @param PayPal\Api\Cost $discount + * @param \PayPal\Api\Cost $discount + * + * @return $this */ public function setDiscount($discount) { @@ -174,12 +200,11 @@ class InvoiceItem extends PPModel /** * Item discount in percent or amount. * - * @return PayPal\Api\Cost + * @return \PayPal\Api\Cost */ public function getDiscount() { return $this->discount; } - } diff --git a/lib/PayPal/Api/Invoices.php b/lib/PayPal/Api/Invoices.php index 15cbfd7..e73c92c 100644 --- a/lib/PayPal/Api/Invoices.php +++ b/lib/PayPal/Api/Invoices.php @@ -1,75 +1,1066 @@ total_count = $total_count; + $this->id = $id; return $this; } /** + * Unique invoice resource identifier. * - * - * @return integer + * @return string */ - public function getTotalCount() + public function getId() { - return $this->total_count; + return $this->id; } /** + * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. * - * - * @param integer $total_count - * @deprecated. Instead use setTotalCount + * @param string $number + * + * @return $this */ - public function setTotal_count($total_count) + public function setNumber($number) { - $this->total_count = $total_count; + $this->number = $number; return $this; } /** + * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. * - * - * @return integer - * @deprecated. Instead use getTotalCount + * @return string */ - public function getTotal_count() + public function getNumber() { - return $this->total_count; + return $this->number; } /** - * List of invoices belonging to a merchant. + * URI of the invoice resource. * - * @param PayPal\Api\Invoice $invoices + * @param string $uri + * + * @return $this */ - public function setInvoices($invoices) + public function setUri($uri) { - $this->invoices = $invoices; + $this->uri = $uri; return $this; } /** - * List of invoices belonging to a merchant. + * URI of the invoice resource. * - * @return PayPal\Api\Invoice + * @return string */ - public function getInvoices() + public function getUri() { - return $this->invoices; + return $this->uri; } + /** + * Status of the invoice. + * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED"] + * + * @param string $status + * + * @return $this + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Status of the invoice. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * Information about the merchant who is sending the invoice. + * + * @param \PayPal\Api\MerchantInfo $merchant_info + * + * @return $this + */ + public function setMerchantInfo($merchant_info) + { + $this->merchant_info = $merchant_info; + return $this; + } + + /** + * Information about the merchant who is sending the invoice. + * + * @return \PayPal\Api\MerchantInfo + */ + public function getMerchantInfo() + { + 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). + * + * @param \PayPal\Api\BillingInfo[] $billing_info + * + * @return $this + */ + public function setBillingInfo($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). + * + * @return \PayPal\Api\BillingInfo[] + */ + public function getBillingInfo() + { + return $this->billing_info; + } + + /** + * Append BillingInfo to the list. + * + * @param \PayPal\Api\BillingInfo $billingInfo + * @return $this + */ + public function addBillingInfo($billingInfo) + { + if (!$this->getBillingInfo()) { + return $this->setBillingInfo(array($billingInfo)); + } else { + return $this->setBillingInfo( + array_merge($this->getBillingInfo(), array($billingInfo)) + ); + } + } + + /** + * Remove BillingInfo from the list. + * + * @param \PayPal\Api\BillingInfo $billingInfo + * @return $this + */ + public function removeBillingInfo($billingInfo) + { + return $this->setBillingInfo( + array_diff($this->getBillingInfo(), array($billingInfo)) + ); + } + + /** + * 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. + * + * @param \PayPal\Api\ShippingInfo $shipping_info + * + * @return $this + */ + public function setShippingInfo($shipping_info) + { + $this->shipping_info = $shipping_info; + return $this; + } + + /** + * Shipping information for entities to whom items are being shipped. + * + * @return \PayPal\Api\ShippingInfo + */ + public function getShippingInfo() + { + 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. + * + * @param \PayPal\Api\InvoiceItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->items = $items; + return $this; + } + + /** + * List of items included in the invoice. 100 items max per invoice. + * + * @return \PayPal\Api\InvoiceItem[] + */ + public function getItems() + { + return $this->items; + } + + /** + * Append Items to the list. + * + * @param \PayPal\Api\InvoiceItem $invoiceItem + * @return $this + */ + public function addItem($invoiceItem) + { + if (!$this->getItems()) { + return $this->setItems(array($invoiceItem)); + } else { + return $this->setItems( + array_merge($this->getItems(), array($invoiceItem)) + ); + } + } + + /** + * Remove Items from the list. + * + * @param \PayPal\Api\InvoiceItem $invoiceItem + * @return $this + */ + public function removeItem($invoiceItem) + { + return $this->setItems( + array_diff($this->getItems(), array($invoiceItem)) + ); + } + + /** + * 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). + * + * @param string $invoice_date + * + * @return $this + */ + public function setInvoiceDate($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). + * + * @return string + */ + public function getInvoiceDate() + { + 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. + * + * @param \PayPal\Api\PaymentTerm $payment_term + * + * @return $this + */ + public function setPaymentTerm($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. + * + * @return \PayPal\Api\PaymentTerm + */ + public function getPaymentTerm() + { + 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. + * + * @param \PayPal\Api\Cost $discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->discount = $discount; + return $this; + } + + /** + * Invoice level discount in percent or amount. + * + * @return \PayPal\Api\Cost + */ + public function getDiscount() + { + return $this->discount; + } + + /** + * Shipping cost in percent or amount. + * + * @param \PayPal\Api\ShippingCost $shipping_cost + * + * @return $this + */ + public function setShippingCost($shipping_cost) + { + $this->shipping_cost = $shipping_cost; + return $this; + } + + /** + * Shipping cost in percent or amount. + * + * @return \PayPal\Api\ShippingCost + */ + public function getShippingCost() + { + 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. + * + * @param \PayPal\Api\CustomAmount $custom + * + * @return $this + */ + public function setCustom($custom) + { + $this->custom = $custom; + return $this; + } + + /** + * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. + * + * @return \PayPal\Api\CustomAmount + */ + public function getCustom() + { + return $this->custom; + } + + /** + * 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. + * + * @param bool $tax_calculated_after_discount + * + * @return $this + */ + public function setTaxCalculatedAfterDiscount($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. + * + * @return bool + */ + public function getTaxCalculatedAfterDiscount() + { + 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 + * + * @param bool $tax_inclusive + * + * @return $this + */ + public function setTaxInclusive($tax_inclusive) + { + $this->tax_inclusive = $tax_inclusive; + return $this; + } + + /** + * A flag indicating whether the unit price includes tax. Default is false + * + * @return bool + */ + public function getTaxInclusive() + { + 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. + * + * @param string $terms + * + * @return $this + */ + public function setTerms($terms) + { + $this->terms = $terms; + return $this; + } + + /** + * General terms of the invoice. 4000 characters max. + * + * @return string + */ + public function getTerms() + { + return $this->terms; + } + + /** + * Note to the payer. 4000 characters max. + * + * @param string $note + * + * @return $this + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Note to the payer. 4000 characters max. + * + * @return string + */ + public function getNote() + { + return $this->note; + } + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @param string $merchant_memo + * + * @return $this + */ + public function setMerchantMemo($merchant_memo) + { + $this->merchant_memo = $merchant_memo; + return $this; + } + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @return string + */ + public function getMerchantMemo() + { + 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. + * + * @param string $logo_url + * @throws \InvalidArgumentException + * @return $this + */ + public function setLogoUrl($logo_url) + { + UrlValidator::validate($logo_url, "LogoUrl"); + $this->logo_url = $logo_url; + return $this; + } + + /** + * Full URL of an external image to use as the logo. 4000 characters max. + * + * @return string + */ + public function getLogoUrl() + { + 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. + * + * @param \PayPal\Api\Currency $total_amount + * + * @return $this + */ + public function setTotalAmount($total_amount) + { + $this->total_amount = $total_amount; + return $this; + } + + /** + * The total amount of the invoice. + * + * @return \PayPal\Api\Currency + */ + public function getTotalAmount() + { + 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. + * + * @param \PayPal\Api\PaymentDetail[] $payment_details + * + * @return $this + */ + public function setPaymentDetails($payment_details) + { + $this->payment_details = $payment_details; + return $this; + } + + /** + * List of payment details for the invoice. + * + * @return \PayPal\Api\PaymentDetail[] + */ + public function getPaymentDetails() + { + return $this->payment_details; + } + + /** + * Append PaymentDetails to the list. + * + * @param \PayPal\Api\PaymentDetail $paymentDetail + * @return $this + */ + public function addPaymentDetail($paymentDetail) + { + if (!$this->getPaymentDetails()) { + return $this->setPaymentDetails(array($paymentDetail)); + } else { + return $this->setPaymentDetails( + array_merge($this->getPaymentDetails(), array($paymentDetail)) + ); + } + } + + /** + * Remove PaymentDetails from the list. + * + * @param \PayPal\Api\PaymentDetail $paymentDetail + * @return $this + */ + public function removePaymentDetail($paymentDetail) + { + return $this->setPaymentDetails( + array_diff($this->getPaymentDetails(), array($paymentDetail)) + ); + } + + /** + * 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. + * + * @param \PayPal\Api\RefundDetail[] $refund_details + * + * @return $this + */ + public function setRefundDetails($refund_details) + { + $this->refund_details = $refund_details; + return $this; + } + + /** + * List of refund details for the invoice. + * + * @return \PayPal\Api\RefundDetail[] + */ + public function getRefundDetails() + { + return $this->refund_details; + } + + /** + * Append RefundDetails to the list. + * + * @param \PayPal\Api\RefundDetail $refundDetail + * @return $this + */ + public function addRefundDetail($refundDetail) + { + if (!$this->getRefundDetails()) { + return $this->setRefundDetails(array($refundDetail)); + } else { + return $this->setRefundDetails( + array_merge($this->getRefundDetails(), array($refundDetail)) + ); + } + } + + /** + * Remove RefundDetails from the list. + * + * @param \PayPal\Api\RefundDetail $refundDetail + * @return $this + */ + public function removeRefundDetail($refundDetail) + { + return $this->setRefundDetails( + array_diff($this->getRefundDetails(), array($refundDetail)) + ); + } + + /** + * 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. + * + * @param \PayPal\Api\Metadata $metadata + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->metadata = $metadata; + return $this; + } + + /** + * Audit information for the invoice. + * + * @return \PayPal\Api\Metadata + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Any miscellaneous invoice data. 4000 characters max. + * + * @param string $additional_data + * + * @return $this + */ + public function setAdditionalData($additional_data) + { + $this->additional_data = $additional_data; + return $this; + } + + /** + * Any miscellaneous invoice data. 4000 characters max. + * + * @return string + */ + public function getAdditionalData() + { + 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; + } } diff --git a/lib/PayPal/Api/InvoicingMetaData.php b/lib/PayPal/Api/InvoicingMetaData.php index 19d435b..b669706 100644 --- a/lib/PayPal/Api/InvoicingMetaData.php +++ b/lib/PayPal/Api/InvoicingMetaData.php @@ -1,15 +1,36 @@ last_sent_by; } + /** + * URL representing the payer's view of the invoice. + * + * @param string $payer_view_url + * @throws \InvalidArgumentException + * @return $this + */ + public function setPayerViewUrl($payer_view_url) + { + UrlValidator::validate($payer_view_url, "PayerViewUrl"); + $this->payer_view_url = $payer_view_url; + return $this; + } + + /** + * URL representing the payer's view of the invoice. + * + * @return string + */ + public function getPayerViewUrl() + { + 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 2cd7e3b..1e1b0bd 100644 --- a/lib/PayPal/Api/InvoicingNotification.php +++ b/lib/PayPal/Api/InvoicingNotification.php @@ -1,15 +1,28 @@ subject; } - /** * Note to the payer. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -49,11 +63,12 @@ class InvoicingNotification extends PPModel return $this->note; } - /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant + * @param bool $send_to_merchant + * + * @return $this */ public function setSendToMerchant($send_to_merchant) { @@ -64,7 +79,7 @@ class InvoicingNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @return boolean + * @return bool */ public function getSendToMerchant() { @@ -74,8 +89,10 @@ class InvoicingNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant + * @deprecated Instead use setSendToMerchant + * + * @param bool $send_to_merchant + * @return $this */ public function setSend_to_merchant($send_to_merchant) { @@ -85,9 +102,9 @@ class InvoicingNotification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. + * @deprecated Instead use getSendToMerchant * - * @return boolean - * @deprecated. Instead use getSendToMerchant + * @return bool */ public function getSend_to_merchant() { diff --git a/lib/PayPal/Api/InvoicingPaymentDetail.php b/lib/PayPal/Api/InvoicingPaymentDetail.php index cba1edf..11ecc6a 100644 --- a/lib/PayPal/Api/InvoicingPaymentDetail.php +++ b/lib/PayPal/Api/InvoicingPaymentDetail.php @@ -1,15 +1,32 @@ type; } - /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. * * @param string $transaction_id + * + * @return $this */ public function setTransactionId($transaction_id) { @@ -52,8 +70,10 @@ class InvoicingPaymentDetail extends PPModel /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. * + * @deprecated Instead use setTransactionId + * * @param string $transaction_id - * @deprecated. Instead use setTransactionId + * @return $this */ public function setTransaction_id($transaction_id) { @@ -63,9 +83,9 @@ class InvoicingPaymentDetail extends PPModel /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * @deprecated Instead use getTransactionId * * @return string - * @deprecated. Instead use getTransactionId */ public function getTransaction_id() { @@ -74,8 +94,11 @@ class InvoicingPaymentDetail extends PPModel /** * Type of the transaction. + * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"] * * @param string $transaction_type + * + * @return $this */ public function setTransactionType($transaction_type) { @@ -96,8 +119,10 @@ class InvoicingPaymentDetail extends PPModel /** * Type of the transaction. * + * @deprecated Instead use setTransactionType + * * @param string $transaction_type - * @deprecated. Instead use setTransactionType + * @return $this */ public function setTransaction_type($transaction_type) { @@ -107,9 +132,9 @@ class InvoicingPaymentDetail extends PPModel /** * Type of the transaction. + * @deprecated Instead use getTransactionType * * @return string - * @deprecated. Instead use getTransactionType */ public function getTransaction_type() { @@ -117,9 +142,11 @@ class InvoicingPaymentDetail extends PPModel } /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * 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). * * @param string $date + * + * @return $this */ public function setDate($date) { @@ -128,7 +155,7 @@ class InvoicingPaymentDetail extends PPModel } /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * 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). * * @return string */ @@ -137,11 +164,13 @@ class InvoicingPaymentDetail extends PPModel return $this->date; } - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * Payment mode or method. This field is mandatory if the value of the type field is EXTERNAL. + * Valid Values: ["BANK_TRANSFER", "CASH", "CHECK", "CREDIT_CARD", "DEBIT_CARD", "PAYPAL", "WIRE_TRANSFER", "OTHER"] * * @param string $method + * + * @return $this */ public function setMethod($method) { @@ -150,7 +179,7 @@ class InvoicingPaymentDetail extends PPModel } /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * Payment mode or method. This field is mandatory if the value of the type field is EXTERNAL. * * @return string */ @@ -159,11 +188,12 @@ class InvoicingPaymentDetail extends PPModel return $this->method; } - /** * Optional note associated with the payment. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -181,5 +211,4 @@ class InvoicingPaymentDetail extends PPModel return $this->note; } - } diff --git a/lib/PayPal/Api/InvoicingRefundDetail.php b/lib/PayPal/Api/InvoicingRefundDetail.php index 2868efc..99ebbaa 100644 --- a/lib/PayPal/Api/InvoicingRefundDetail.php +++ b/lib/PayPal/Api/InvoicingRefundDetail.php @@ -1,15 +1,29 @@ type; } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @param string $date + * + * @return $this */ public function setDate($date) { @@ -40,7 +55,7 @@ class InvoicingRefundDetail extends PPModel } /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @return string */ @@ -49,11 +64,12 @@ class InvoicingRefundDetail extends PPModel return $this->date; } - /** * Optional note associated with the refund. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -71,5 +87,4 @@ class InvoicingRefundDetail extends PPModel return $this->note; } - } diff --git a/lib/PayPal/Api/InvoicingSearch.php b/lib/PayPal/Api/InvoicingSearch.php index ce76e7b..333d9ac 100644 --- a/lib/PayPal/Api/InvoicingSearch.php +++ b/lib/PayPal/Api/InvoicingSearch.php @@ -1,15 +1,44 @@ email; } - /** * Initial letters of the recipient's first name. * * @param string $recipient_first_name + * + * @return $this */ public function setRecipientFirstName($recipient_first_name) { @@ -52,8 +82,10 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's first name. * + * @deprecated Instead use setRecipientFirstName + * * @param string $recipient_first_name - * @deprecated. Instead use setRecipientFirstName + * @return $this */ public function setRecipient_first_name($recipient_first_name) { @@ -63,9 +95,9 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's first name. + * @deprecated Instead use getRecipientFirstName * * @return string - * @deprecated. Instead use getRecipientFirstName */ public function getRecipient_first_name() { @@ -76,6 +108,8 @@ class InvoicingSearch extends PPModel * Initial letters of the recipient's last name. * * @param string $recipient_last_name + * + * @return $this */ public function setRecipientLastName($recipient_last_name) { @@ -96,8 +130,10 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's last name. * + * @deprecated Instead use setRecipientLastName + * * @param string $recipient_last_name - * @deprecated. Instead use setRecipientLastName + * @return $this */ public function setRecipient_last_name($recipient_last_name) { @@ -107,9 +143,9 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's last name. + * @deprecated Instead use getRecipientLastName * * @return string - * @deprecated. Instead use getRecipientLastName */ public function getRecipient_last_name() { @@ -120,6 +156,8 @@ class InvoicingSearch extends PPModel * Initial letters of the recipient's business name. * * @param string $recipient_business_name + * + * @return $this */ public function setRecipientBusinessName($recipient_business_name) { @@ -140,8 +178,10 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's business name. * + * @deprecated Instead use setRecipientBusinessName + * * @param string $recipient_business_name - * @deprecated. Instead use setRecipientBusinessName + * @return $this */ public function setRecipient_business_name($recipient_business_name) { @@ -151,9 +191,9 @@ class InvoicingSearch extends PPModel /** * Initial letters of the recipient's business name. + * @deprecated Instead use getRecipientBusinessName * * @return string - * @deprecated. Instead use getRecipientBusinessName */ public function getRecipient_business_name() { @@ -164,6 +204,8 @@ class InvoicingSearch extends PPModel * The invoice number that appears on the invoice. * * @param string $number + * + * @return $this */ public function setNumber($number) { @@ -181,11 +223,13 @@ class InvoicingSearch extends PPModel return $this->number; } - /** * Status of the invoice. + * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED"] * * @param string $status + * + * @return $this */ public function setStatus($status) { @@ -203,11 +247,12 @@ class InvoicingSearch extends PPModel return $this->status; } - /** * Lower limit of total amount. * - * @param PayPal\Api\Currency $lower_total_amount + * @param \PayPal\Api\Currency $lower_total_amount + * + * @return $this */ public function setLowerTotalAmount($lower_total_amount) { @@ -218,7 +263,7 @@ class InvoicingSearch extends PPModel /** * Lower limit of total amount. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getLowerTotalAmount() { @@ -228,8 +273,10 @@ class InvoicingSearch extends PPModel /** * Lower limit of total amount. * - * @param PayPal\Api\Currency $lower_total_amount - * @deprecated. Instead use setLowerTotalAmount + * @deprecated Instead use setLowerTotalAmount + * + * @param \PayPal\Api\Currency $lower_total_amount + * @return $this */ public function setLower_total_amount($lower_total_amount) { @@ -239,9 +286,9 @@ class InvoicingSearch extends PPModel /** * Lower limit of total amount. + * @deprecated Instead use getLowerTotalAmount * - * @return PayPal\Api\Currency - * @deprecated. Instead use getLowerTotalAmount + * @return \PayPal\Api\Currency */ public function getLower_total_amount() { @@ -251,7 +298,9 @@ class InvoicingSearch extends PPModel /** * Upper limit of total amount. * - * @param PayPal\Api\Currency $upper_total_amount + * @param \PayPal\Api\Currency $upper_total_amount + * + * @return $this */ public function setUpperTotalAmount($upper_total_amount) { @@ -262,7 +311,7 @@ class InvoicingSearch extends PPModel /** * Upper limit of total amount. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getUpperTotalAmount() { @@ -272,8 +321,10 @@ class InvoicingSearch extends PPModel /** * Upper limit of total amount. * - * @param PayPal\Api\Currency $upper_total_amount - * @deprecated. Instead use setUpperTotalAmount + * @deprecated Instead use setUpperTotalAmount + * + * @param \PayPal\Api\Currency $upper_total_amount + * @return $this */ public function setUpper_total_amount($upper_total_amount) { @@ -283,9 +334,9 @@ class InvoicingSearch extends PPModel /** * Upper limit of total amount. + * @deprecated Instead use getUpperTotalAmount * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUpperTotalAmount + * @return \PayPal\Api\Currency */ public function getUpper_total_amount() { @@ -293,9 +344,11 @@ class InvoicingSearch extends PPModel } /** - * 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). * * @param string $start_invoice_date + * + * @return $this */ public function setStartInvoiceDate($start_invoice_date) { @@ -304,7 +357,7 @@ class InvoicingSearch extends PPModel } /** - * 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). * * @return string */ @@ -314,10 +367,12 @@ class InvoicingSearch extends PPModel } /** - * 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 - * @deprecated. Instead use setStartInvoiceDate + * @return $this */ public function setStart_invoice_date($start_invoice_date) { @@ -326,10 +381,10 @@ class InvoicingSearch extends PPModel } /** - * 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 getStartInvoiceDate * * @return string - * @deprecated. Instead use getStartInvoiceDate */ public function getStart_invoice_date() { @@ -337,9 +392,11 @@ class InvoicingSearch extends PPModel } /** - * 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). * * @param string $end_invoice_date + * + * @return $this */ public function setEndInvoiceDate($end_invoice_date) { @@ -348,7 +405,7 @@ class InvoicingSearch extends PPModel } /** - * 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). * * @return string */ @@ -358,10 +415,12 @@ class InvoicingSearch extends PPModel } /** - * 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 - * @deprecated. Instead use setEndInvoiceDate + * @return $this */ public function setEnd_invoice_date($end_invoice_date) { @@ -370,10 +429,10 @@ class InvoicingSearch extends PPModel } /** - * 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 getEndInvoiceDate * * @return string - * @deprecated. Instead use getEndInvoiceDate */ public function getEnd_invoice_date() { @@ -381,9 +440,11 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @param string $start_due_date + * + * @return $this */ public function setStartDueDate($start_due_date) { @@ -392,7 +453,7 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -402,10 +463,12 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartDueDate + * @return $this */ public function setStart_due_date($start_due_date) { @@ -414,10 +477,10 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 getStartDueDate * * @return string - * @deprecated. Instead use getStartDueDate */ public function getStart_due_date() { @@ -425,9 +488,11 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @param string $end_due_date + * + * @return $this */ public function setEndDueDate($end_due_date) { @@ -436,7 +501,7 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @return string */ @@ -446,10 +511,12 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndDueDate + * @return $this */ public function setEnd_due_date($end_due_date) { @@ -458,10 +525,10 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 getEndDueDate * * @return string - * @deprecated. Instead use getEndDueDate */ public function getEnd_due_date() { @@ -469,9 +536,11 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @param string $start_payment_date + * + * @return $this */ public function setStartPaymentDate($start_payment_date) { @@ -480,7 +549,7 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -490,10 +559,12 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartPaymentDate + * @return $this */ public function setStart_payment_date($start_payment_date) { @@ -502,10 +573,10 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 getStartPaymentDate * * @return string - * @deprecated. Instead use getStartPaymentDate */ public function getStart_payment_date() { @@ -513,9 +584,11 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @param string $end_payment_date + * + * @return $this */ public function setEndPaymentDate($end_payment_date) { @@ -524,7 +597,7 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @return string */ @@ -534,10 +607,12 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndPaymentDate + * @return $this */ public function setEnd_payment_date($end_payment_date) { @@ -546,10 +621,10 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 getEndPaymentDate * * @return string - * @deprecated. Instead use getEndPaymentDate */ public function getEnd_payment_date() { @@ -557,9 +632,11 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @param string $start_creation_date + * + * @return $this */ public function setStartCreationDate($start_creation_date) { @@ -568,7 +645,7 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -578,10 +655,12 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartCreationDate + * @return $this */ public function setStart_creation_date($start_creation_date) { @@ -590,10 +669,10 @@ class InvoicingSearch extends PPModel } /** - * Start invoice 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 getStartCreationDate * * @return string - * @deprecated. Instead use getStartCreationDate */ public function getStart_creation_date() { @@ -601,9 +680,11 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @param string $end_creation_date + * + * @return $this */ public function setEndCreationDate($end_creation_date) { @@ -612,7 +693,7 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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). * * @return string */ @@ -622,10 +703,12 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndCreationDate + * @return $this */ public function setEnd_creation_date($end_creation_date) { @@ -634,10 +717,10 @@ class InvoicingSearch extends PPModel } /** - * End invoice 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 getEndCreationDate * * @return string - * @deprecated. Instead use getEndCreationDate */ public function getEnd_creation_date() { @@ -647,7 +730,9 @@ class InvoicingSearch extends PPModel /** * Offset of the search results. * - * @param PayPal\Api\number $page + * @param \PayPal\Api\number $page + * + * @return $this */ public function setPage($page) { @@ -658,18 +743,19 @@ class InvoicingSearch extends PPModel /** * Offset of the search results. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getPage() { return $this->page; } - /** * Page size of the search results. * - * @param PayPal\Api\number $page_size + * @param \PayPal\Api\number $page_size + * + * @return $this */ public function setPageSize($page_size) { @@ -680,7 +766,7 @@ class InvoicingSearch extends PPModel /** * Page size of the search results. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getPageSize() { @@ -690,8 +776,10 @@ class InvoicingSearch extends PPModel /** * Page size of the search results. * - * @param PayPal\Api\number $page_size - * @deprecated. Instead use setPageSize + * @deprecated Instead use setPageSize + * + * @param \PayPal\Api\number $page_size + * @return $this */ public function setPage_size($page_size) { @@ -701,9 +789,9 @@ class InvoicingSearch extends PPModel /** * Page size of the search results. + * @deprecated Instead use getPageSize * - * @return PayPal\Api\number - * @deprecated. Instead use getPageSize + * @return \PayPal\Api\number */ public function getPage_size() { @@ -713,7 +801,9 @@ class InvoicingSearch extends PPModel /** * A flag indicating whether total count is required in the response. * - * @param boolean $total_count_required + * @param bool $total_count_required + * + * @return $this */ public function setTotalCountRequired($total_count_required) { @@ -724,7 +814,7 @@ class InvoicingSearch extends PPModel /** * A flag indicating whether total count is required in the response. * - * @return boolean + * @return bool */ public function getTotalCountRequired() { @@ -734,8 +824,10 @@ class InvoicingSearch extends PPModel /** * A flag indicating whether total count is required in the response. * - * @param boolean $total_count_required - * @deprecated. Instead use setTotalCountRequired + * @deprecated Instead use setTotalCountRequired + * + * @param bool $total_count_required + * @return $this */ public function setTotal_count_required($total_count_required) { @@ -745,9 +837,9 @@ class InvoicingSearch extends PPModel /** * A flag indicating whether total count is required in the response. + * @deprecated Instead use getTotalCountRequired * - * @return boolean - * @deprecated. Instead use getTotalCountRequired + * @return bool */ public function getTotal_count_required() { diff --git a/lib/PayPal/Api/MerchantInfo.php b/lib/PayPal/Api/MerchantInfo.php index 41bd0cc..a5a38eb 100644 --- a/lib/PayPal/Api/MerchantInfo.php +++ b/lib/PayPal/Api/MerchantInfo.php @@ -1,15 +1,35 @@ email; } - /** * First name of the merchant. 30 characters max. * * @param string $first_name + * + * @return $this */ public function setFirstName($first_name) { @@ -52,8 +73,10 @@ class MerchantInfo extends PPModel /** * First name of the merchant. 30 characters max. * + * @deprecated Instead use setFirstName + * * @param string $first_name - * @deprecated. Instead use setFirstName + * @return $this */ public function setFirst_name($first_name) { @@ -63,9 +86,9 @@ class MerchantInfo extends PPModel /** * First name of the merchant. 30 characters max. + * @deprecated Instead use getFirstName * * @return string - * @deprecated. Instead use getFirstName */ public function getFirst_name() { @@ -76,6 +99,8 @@ class MerchantInfo extends PPModel * Last name of the merchant. 30 characters max. * * @param string $last_name + * + * @return $this */ public function setLastName($last_name) { @@ -96,8 +121,10 @@ class MerchantInfo extends PPModel /** * Last name of the merchant. 30 characters max. * + * @deprecated Instead use setLastName + * * @param string $last_name - * @deprecated. Instead use setLastName + * @return $this */ public function setLast_name($last_name) { @@ -107,9 +134,9 @@ class MerchantInfo extends PPModel /** * Last name of the merchant. 30 characters max. + * @deprecated Instead use getLastName * * @return string - * @deprecated. Instead use getLastName */ public function getLast_name() { @@ -119,7 +146,9 @@ class MerchantInfo extends PPModel /** * Address of the merchant. * - * @param PayPal\Api\Address $address + * @param \PayPal\Api\Address $address + * + * @return $this */ public function setAddress($address) { @@ -130,18 +159,19 @@ class MerchantInfo extends PPModel /** * Address of the merchant. * - * @return PayPal\Api\Address + * @return \PayPal\Api\Address */ public function getAddress() { return $this->address; } - /** * Company business name of the merchant. 100 characters max. * * @param string $business_name + * + * @return $this */ public function setBusinessName($business_name) { @@ -162,8 +192,10 @@ class MerchantInfo extends PPModel /** * Company business name of the merchant. 100 characters max. * + * @deprecated Instead use setBusinessName + * * @param string $business_name - * @deprecated. Instead use setBusinessName + * @return $this */ public function setBusiness_name($business_name) { @@ -173,9 +205,9 @@ class MerchantInfo extends PPModel /** * Company business name of the merchant. 100 characters max. + * @deprecated Instead use getBusinessName * * @return string - * @deprecated. Instead use getBusinessName */ public function getBusiness_name() { @@ -185,7 +217,9 @@ class MerchantInfo extends PPModel /** * Phone number of the merchant. * - * @param PayPal\Api\Phone $phone + * @param \PayPal\Api\Phone $phone + * + * @return $this */ public function setPhone($phone) { @@ -196,18 +230,19 @@ class MerchantInfo extends PPModel /** * Phone number of the merchant. * - * @return PayPal\Api\Phone + * @return \PayPal\Api\Phone */ public function getPhone() { return $this->phone; } - /** * Fax number of the merchant. * - * @param PayPal\Api\Phone $fax + * @param \PayPal\Api\Phone $fax + * + * @return $this */ public function setFax($fax) { @@ -218,18 +253,19 @@ class MerchantInfo extends PPModel /** * Fax number of the merchant. * - * @return PayPal\Api\Phone + * @return \PayPal\Api\Phone */ public function getFax() { return $this->fax; } - /** * Website of the merchant. 2048 characters max. * * @param string $website + * + * @return $this */ public function setWebsite($website) { @@ -247,11 +283,12 @@ class MerchantInfo extends PPModel return $this->website; } - /** * Tax ID of the merchant. 100 characters max. * * @param string $tax_id + * + * @return $this */ public function setTaxId($tax_id) { @@ -272,8 +309,10 @@ class MerchantInfo extends PPModel /** * Tax ID of the merchant. 100 characters max. * + * @deprecated Instead use setTaxId + * * @param string $tax_id - * @deprecated. Instead use setTaxId + * @return $this */ public function setTax_id($tax_id) { @@ -283,9 +322,9 @@ class MerchantInfo extends PPModel /** * Tax ID of the merchant. 100 characters max. + * @deprecated Instead use getTaxId * * @return string - * @deprecated. Instead use getTaxId */ public function getTax_id() { @@ -296,6 +335,8 @@ class MerchantInfo extends PPModel * Option to display additional information such as business hours. 40 characters max. * * @param string $additional_info + * + * @return $this */ public function setAdditionalInfo($additional_info) { @@ -316,8 +357,10 @@ class MerchantInfo extends PPModel /** * Option to display additional information such as business hours. 40 characters max. * + * @deprecated Instead use setAdditionalInfo + * * @param string $additional_info - * @deprecated. Instead use setAdditionalInfo + * @return $this */ public function setAdditional_info($additional_info) { @@ -327,9 +370,9 @@ class MerchantInfo extends PPModel /** * Option to display additional information such as business hours. 40 characters max. + * @deprecated Instead use getAdditionalInfo * * @return string - * @deprecated. Instead use getAdditionalInfo */ public function getAdditional_info() { diff --git a/lib/PayPal/Api/Metadata.php b/lib/PayPal/Api/Metadata.php index baf6e32..ffab420 100644 --- a/lib/PayPal/Api/Metadata.php +++ b/lib/PayPal/Api/Metadata.php @@ -1,15 +1,36 @@ last_sent_by; } + /** + * URL representing the payer's view of the invoice. + * + * @param string $payer_view_url + * @throws \InvalidArgumentException + * @return $this + */ + public function setPayerViewUrl($payer_view_url) + { + UrlValidator::validate($payer_view_url, "PayerViewUrl"); + $this->payer_view_url = $payer_view_url; + return $this; + } + + /** + * URL representing the payer's view of the invoice. + * + * @return string + */ + public function getPayerViewUrl() + { + 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/Notification.php b/lib/PayPal/Api/Notification.php index d4d90ff..80f352d 100644 --- a/lib/PayPal/Api/Notification.php +++ b/lib/PayPal/Api/Notification.php @@ -1,15 +1,28 @@ subject; } - /** * Note to the payer. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -49,11 +63,12 @@ class Notification extends PPModel return $this->note; } - /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant + * @param bool $send_to_merchant + * + * @return $this */ public function setSendToMerchant($send_to_merchant) { @@ -64,7 +79,7 @@ class Notification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @return boolean + * @return bool */ public function getSendToMerchant() { @@ -74,8 +89,10 @@ class Notification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant + * @deprecated Instead use setSendToMerchant + * + * @param bool $send_to_merchant + * @return $this */ public function setSend_to_merchant($send_to_merchant) { @@ -85,9 +102,9 @@ class Notification extends PPModel /** * A flag indicating whether a copy of the email has to be sent to the merchant. + * @deprecated Instead use getSendToMerchant * - * @return boolean - * @deprecated. Instead use getSendToMerchant + * @return bool */ public function getSend_to_merchant() { diff --git a/lib/PayPal/Api/PaymentDetail.php b/lib/PayPal/Api/PaymentDetail.php index afd2426..c5c12ad 100644 --- a/lib/PayPal/Api/PaymentDetail.php +++ b/lib/PayPal/Api/PaymentDetail.php @@ -1,15 +1,32 @@ type; } - /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. * * @param string $transaction_id + * + * @return $this */ public function setTransactionId($transaction_id) { @@ -52,8 +70,10 @@ class PaymentDetail extends PPModel /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. * + * @deprecated Instead use setTransactionId + * * @param string $transaction_id - * @deprecated. Instead use setTransactionId + * @return $this */ public function setTransaction_id($transaction_id) { @@ -63,9 +83,9 @@ class PaymentDetail extends PPModel /** * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * @deprecated Instead use getTransactionId * * @return string - * @deprecated. Instead use getTransactionId */ public function getTransaction_id() { @@ -74,8 +94,11 @@ class PaymentDetail extends PPModel /** * Type of the transaction. + * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"] * * @param string $transaction_type + * + * @return $this */ public function setTransactionType($transaction_type) { @@ -96,8 +119,10 @@ class PaymentDetail extends PPModel /** * Type of the transaction. * + * @deprecated Instead use setTransactionType + * * @param string $transaction_type - * @deprecated. Instead use setTransactionType + * @return $this */ public function setTransaction_type($transaction_type) { @@ -107,9 +132,9 @@ class PaymentDetail extends PPModel /** * Type of the transaction. + * @deprecated Instead use getTransactionType * * @return string - * @deprecated. Instead use getTransactionType */ public function getTransaction_type() { @@ -117,9 +142,11 @@ class PaymentDetail extends PPModel } /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * 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). * * @param string $date + * + * @return $this */ public function setDate($date) { @@ -128,7 +155,7 @@ class PaymentDetail extends PPModel } /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * 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). * * @return string */ @@ -137,11 +164,13 @@ class PaymentDetail extends PPModel return $this->date; } - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * Payment mode or method. This field is mandatory if the value of the type field is EXTERNAL. + * Valid Values: ["BANK_TRANSFER", "CASH", "CHECK", "CREDIT_CARD", "DEBIT_CARD", "PAYPAL", "WIRE_TRANSFER", "OTHER"] * * @param string $method + * + * @return $this */ public function setMethod($method) { @@ -150,7 +179,7 @@ class PaymentDetail extends PPModel } /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * Payment mode or method. This field is mandatory if the value of the type field is EXTERNAL. * * @return string */ @@ -159,11 +188,12 @@ class PaymentDetail extends PPModel return $this->method; } - /** * Optional note associated with the payment. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -181,5 +211,4 @@ class PaymentDetail extends PPModel return $this->note; } - } diff --git a/lib/PayPal/Api/PaymentTerm.php b/lib/PayPal/Api/PaymentTerm.php index 85b0e21..c5c6ed5 100644 --- a/lib/PayPal/Api/PaymentTerm.php +++ b/lib/PayPal/Api/PaymentTerm.php @@ -1,15 +1,28 @@ type; } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @param string $date + * + * @return $this */ public function setDate($date) { @@ -40,7 +55,7 @@ class RefundDetail extends PPModel } /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). * * @return string */ @@ -49,11 +64,12 @@ class RefundDetail extends PPModel return $this->date; } - /** * Optional note associated with the refund. * * @param string $note + * + * @return $this */ public function setNote($note) { @@ -71,5 +87,4 @@ class RefundDetail extends PPModel return $this->note; } - } diff --git a/lib/PayPal/Api/Search.php b/lib/PayPal/Api/Search.php index ad1aebc..5b3d846 100644 --- a/lib/PayPal/Api/Search.php +++ b/lib/PayPal/Api/Search.php @@ -1,15 +1,44 @@ email; } - /** * Initial letters of the recipient's first name. * * @param string $recipient_first_name + * + * @return $this */ public function setRecipientFirstName($recipient_first_name) { @@ -52,8 +82,10 @@ class Search extends PPModel /** * Initial letters of the recipient's first name. * + * @deprecated Instead use setRecipientFirstName + * * @param string $recipient_first_name - * @deprecated. Instead use setRecipientFirstName + * @return $this */ public function setRecipient_first_name($recipient_first_name) { @@ -63,9 +95,9 @@ class Search extends PPModel /** * Initial letters of the recipient's first name. + * @deprecated Instead use getRecipientFirstName * * @return string - * @deprecated. Instead use getRecipientFirstName */ public function getRecipient_first_name() { @@ -76,6 +108,8 @@ class Search extends PPModel * Initial letters of the recipient's last name. * * @param string $recipient_last_name + * + * @return $this */ public function setRecipientLastName($recipient_last_name) { @@ -96,8 +130,10 @@ class Search extends PPModel /** * Initial letters of the recipient's last name. * + * @deprecated Instead use setRecipientLastName + * * @param string $recipient_last_name - * @deprecated. Instead use setRecipientLastName + * @return $this */ public function setRecipient_last_name($recipient_last_name) { @@ -107,9 +143,9 @@ class Search extends PPModel /** * Initial letters of the recipient's last name. + * @deprecated Instead use getRecipientLastName * * @return string - * @deprecated. Instead use getRecipientLastName */ public function getRecipient_last_name() { @@ -120,6 +156,8 @@ class Search extends PPModel * Initial letters of the recipient's business name. * * @param string $recipient_business_name + * + * @return $this */ public function setRecipientBusinessName($recipient_business_name) { @@ -140,8 +178,10 @@ class Search extends PPModel /** * Initial letters of the recipient's business name. * + * @deprecated Instead use setRecipientBusinessName + * * @param string $recipient_business_name - * @deprecated. Instead use setRecipientBusinessName + * @return $this */ public function setRecipient_business_name($recipient_business_name) { @@ -151,9 +191,9 @@ class Search extends PPModel /** * Initial letters of the recipient's business name. + * @deprecated Instead use getRecipientBusinessName * * @return string - * @deprecated. Instead use getRecipientBusinessName */ public function getRecipient_business_name() { @@ -164,6 +204,8 @@ class Search extends PPModel * The invoice number that appears on the invoice. * * @param string $number + * + * @return $this */ public function setNumber($number) { @@ -181,11 +223,13 @@ class Search extends PPModel return $this->number; } - /** * Status of the invoice. + * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED"] * * @param string $status + * + * @return $this */ public function setStatus($status) { @@ -203,11 +247,12 @@ class Search extends PPModel return $this->status; } - /** * Lower limit of total amount. * - * @param PayPal\Api\Currency $lower_total_amount + * @param \PayPal\Api\Currency $lower_total_amount + * + * @return $this */ public function setLowerTotalAmount($lower_total_amount) { @@ -218,7 +263,7 @@ class Search extends PPModel /** * Lower limit of total amount. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getLowerTotalAmount() { @@ -228,8 +273,10 @@ class Search extends PPModel /** * Lower limit of total amount. * - * @param PayPal\Api\Currency $lower_total_amount - * @deprecated. Instead use setLowerTotalAmount + * @deprecated Instead use setLowerTotalAmount + * + * @param \PayPal\Api\Currency $lower_total_amount + * @return $this */ public function setLower_total_amount($lower_total_amount) { @@ -239,9 +286,9 @@ class Search extends PPModel /** * Lower limit of total amount. + * @deprecated Instead use getLowerTotalAmount * - * @return PayPal\Api\Currency - * @deprecated. Instead use getLowerTotalAmount + * @return \PayPal\Api\Currency */ public function getLower_total_amount() { @@ -251,7 +298,9 @@ class Search extends PPModel /** * Upper limit of total amount. * - * @param PayPal\Api\Currency $upper_total_amount + * @param \PayPal\Api\Currency $upper_total_amount + * + * @return $this */ public function setUpperTotalAmount($upper_total_amount) { @@ -262,7 +311,7 @@ class Search extends PPModel /** * Upper limit of total amount. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getUpperTotalAmount() { @@ -272,8 +321,10 @@ class Search extends PPModel /** * Upper limit of total amount. * - * @param PayPal\Api\Currency $upper_total_amount - * @deprecated. Instead use setUpperTotalAmount + * @deprecated Instead use setUpperTotalAmount + * + * @param \PayPal\Api\Currency $upper_total_amount + * @return $this */ public function setUpper_total_amount($upper_total_amount) { @@ -283,9 +334,9 @@ class Search extends PPModel /** * Upper limit of total amount. + * @deprecated Instead use getUpperTotalAmount * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUpperTotalAmount + * @return \PayPal\Api\Currency */ public function getUpper_total_amount() { @@ -293,9 +344,11 @@ class Search extends PPModel } /** - * 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). * * @param string $start_invoice_date + * + * @return $this */ public function setStartInvoiceDate($start_invoice_date) { @@ -304,7 +357,7 @@ class Search extends PPModel } /** - * 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). * * @return string */ @@ -314,10 +367,12 @@ class Search extends PPModel } /** - * 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 - * @deprecated. Instead use setStartInvoiceDate + * @return $this */ public function setStart_invoice_date($start_invoice_date) { @@ -326,10 +381,10 @@ class Search extends PPModel } /** - * 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 getStartInvoiceDate * * @return string - * @deprecated. Instead use getStartInvoiceDate */ public function getStart_invoice_date() { @@ -337,9 +392,11 @@ class Search extends PPModel } /** - * 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). * * @param string $end_invoice_date + * + * @return $this */ public function setEndInvoiceDate($end_invoice_date) { @@ -348,7 +405,7 @@ class Search extends PPModel } /** - * 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). * * @return string */ @@ -358,10 +415,12 @@ class Search extends PPModel } /** - * 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 - * @deprecated. Instead use setEndInvoiceDate + * @return $this */ public function setEnd_invoice_date($end_invoice_date) { @@ -370,10 +429,10 @@ class Search extends PPModel } /** - * 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 getEndInvoiceDate * * @return string - * @deprecated. Instead use getEndInvoiceDate */ public function getEnd_invoice_date() { @@ -381,9 +440,11 @@ class Search extends PPModel } /** - * Start invoice 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). * * @param string $start_due_date + * + * @return $this */ public function setStartDueDate($start_due_date) { @@ -392,7 +453,7 @@ class Search extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -402,10 +463,12 @@ class Search extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartDueDate + * @return $this */ public function setStart_due_date($start_due_date) { @@ -414,10 +477,10 @@ class Search extends PPModel } /** - * Start invoice 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 getStartDueDate * * @return string - * @deprecated. Instead use getStartDueDate */ public function getStart_due_date() { @@ -425,9 +488,11 @@ class Search extends PPModel } /** - * End invoice 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). * * @param string $end_due_date + * + * @return $this */ public function setEndDueDate($end_due_date) { @@ -436,7 +501,7 @@ class Search extends PPModel } /** - * End invoice 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). * * @return string */ @@ -446,10 +511,12 @@ class Search extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndDueDate + * @return $this */ public function setEnd_due_date($end_due_date) { @@ -458,10 +525,10 @@ class Search extends PPModel } /** - * End invoice 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 getEndDueDate * * @return string - * @deprecated. Instead use getEndDueDate */ public function getEnd_due_date() { @@ -469,9 +536,11 @@ class Search extends PPModel } /** - * Start invoice 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). * * @param string $start_payment_date + * + * @return $this */ public function setStartPaymentDate($start_payment_date) { @@ -480,7 +549,7 @@ class Search extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -490,10 +559,12 @@ class Search extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartPaymentDate + * @return $this */ public function setStart_payment_date($start_payment_date) { @@ -502,10 +573,10 @@ class Search extends PPModel } /** - * Start invoice 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 getStartPaymentDate * * @return string - * @deprecated. Instead use getStartPaymentDate */ public function getStart_payment_date() { @@ -513,9 +584,11 @@ class Search extends PPModel } /** - * End invoice 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). * * @param string $end_payment_date + * + * @return $this */ public function setEndPaymentDate($end_payment_date) { @@ -524,7 +597,7 @@ class Search extends PPModel } /** - * End invoice 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). * * @return string */ @@ -534,10 +607,12 @@ class Search extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndPaymentDate + * @return $this */ public function setEnd_payment_date($end_payment_date) { @@ -546,10 +621,10 @@ class Search extends PPModel } /** - * End invoice 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 getEndPaymentDate * * @return string - * @deprecated. Instead use getEndPaymentDate */ public function getEnd_payment_date() { @@ -557,9 +632,11 @@ class Search extends PPModel } /** - * Start invoice 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). * * @param string $start_creation_date + * + * @return $this */ public function setStartCreationDate($start_creation_date) { @@ -568,7 +645,7 @@ class Search extends PPModel } /** - * Start invoice 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). * * @return string */ @@ -578,10 +655,12 @@ class Search extends PPModel } /** - * Start invoice 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 - * @deprecated. Instead use setStartCreationDate + * @return $this */ public function setStart_creation_date($start_creation_date) { @@ -590,10 +669,10 @@ class Search extends PPModel } /** - * Start invoice 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 getStartCreationDate * * @return string - * @deprecated. Instead use getStartCreationDate */ public function getStart_creation_date() { @@ -601,9 +680,11 @@ class Search extends PPModel } /** - * End invoice 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). * * @param string $end_creation_date + * + * @return $this */ public function setEndCreationDate($end_creation_date) { @@ -612,7 +693,7 @@ class Search extends PPModel } /** - * End invoice 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). * * @return string */ @@ -622,10 +703,12 @@ class Search extends PPModel } /** - * End invoice 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 - * @deprecated. Instead use setEndCreationDate + * @return $this */ public function setEnd_creation_date($end_creation_date) { @@ -634,10 +717,10 @@ class Search extends PPModel } /** - * End invoice 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 getEndCreationDate * * @return string - * @deprecated. Instead use getEndCreationDate */ public function getEnd_creation_date() { @@ -647,7 +730,9 @@ class Search extends PPModel /** * Offset of the search results. * - * @param PayPal\Api\number $page + * @param \PayPal\Api\number $page + * + * @return $this */ public function setPage($page) { @@ -658,18 +743,19 @@ class Search extends PPModel /** * Offset of the search results. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getPage() { return $this->page; } - /** * Page size of the search results. * - * @param PayPal\Api\number $page_size + * @param \PayPal\Api\number $page_size + * + * @return $this */ public function setPageSize($page_size) { @@ -680,7 +766,7 @@ class Search extends PPModel /** * Page size of the search results. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getPageSize() { @@ -690,8 +776,10 @@ class Search extends PPModel /** * Page size of the search results. * - * @param PayPal\Api\number $page_size - * @deprecated. Instead use setPageSize + * @deprecated Instead use setPageSize + * + * @param \PayPal\Api\number $page_size + * @return $this */ public function setPage_size($page_size) { @@ -701,9 +789,9 @@ class Search extends PPModel /** * Page size of the search results. + * @deprecated Instead use getPageSize * - * @return PayPal\Api\number - * @deprecated. Instead use getPageSize + * @return \PayPal\Api\number */ public function getPage_size() { @@ -713,7 +801,9 @@ class Search extends PPModel /** * A flag indicating whether total count is required in the response. * - * @param boolean $total_count_required + * @param bool $total_count_required + * + * @return $this */ public function setTotalCountRequired($total_count_required) { @@ -724,7 +814,7 @@ class Search extends PPModel /** * A flag indicating whether total count is required in the response. * - * @return boolean + * @return bool */ public function getTotalCountRequired() { @@ -734,8 +824,10 @@ class Search extends PPModel /** * A flag indicating whether total count is required in the response. * - * @param boolean $total_count_required - * @deprecated. Instead use setTotalCountRequired + * @deprecated Instead use setTotalCountRequired + * + * @param bool $total_count_required + * @return $this */ public function setTotal_count_required($total_count_required) { @@ -745,9 +837,9 @@ class Search extends PPModel /** * A flag indicating whether total count is required in the response. + * @deprecated Instead use getTotalCountRequired * - * @return boolean - * @deprecated. Instead use getTotalCountRequired + * @return bool */ public function getTotal_count_required() { diff --git a/lib/PayPal/Api/ShippingCost.php b/lib/PayPal/Api/ShippingCost.php index 3b5ca2e..e3a1651 100644 --- a/lib/PayPal/Api/ShippingCost.php +++ b/lib/PayPal/Api/ShippingCost.php @@ -1,15 +1,27 @@ amount; } - /** * Tax percentage on shipping amount. * - * @param PayPal\Api\Tax $tax + * @param \PayPal\Api\Tax $tax + * + * @return $this */ public function setTax($tax) { @@ -42,12 +55,11 @@ class ShippingCost extends PPModel /** * Tax percentage on shipping amount. * - * @return PayPal\Api\Tax + * @return \PayPal\Api\Tax */ public function getTax() { return $this->tax; } - } diff --git a/lib/PayPal/Api/ShippingInfo.php b/lib/PayPal/Api/ShippingInfo.php index 83e96f2..fb5533e 100644 --- a/lib/PayPal/Api/ShippingInfo.php +++ b/lib/PayPal/Api/ShippingInfo.php @@ -1,15 +1,29 @@ phone; } - /** * Address of the invoice recipient. * - * @param PayPal\Api\Address $address + * @param \PayPal\Api\Address $address + * + * @return $this */ public function setAddress($address) { @@ -174,12 +199,11 @@ class ShippingInfo extends PPModel /** * Address of the invoice recipient. * - * @return PayPal\Api\Address + * @return \PayPal\Api\Address */ public function getAddress() { return $this->address; } - } diff --git a/lib/PayPal/Api/Tax.php b/lib/PayPal/Api/Tax.php index 751faf5..fc02674 100644 --- a/lib/PayPal/Api/Tax.php +++ b/lib/PayPal/Api/Tax.php @@ -1,15 +1,29 @@ id; } - /** * Name of the tax. 10 characters max. * * @param string $name + * + * @return $this */ public function setName($name) { @@ -49,11 +64,12 @@ class Tax extends PPModel return $this->name; } - /** * Rate of the specified tax. Range of 0.001 to 99.999. * - * @param PayPal\Api\number $percent + * @param \PayPal\Api\number $percent + * + * @return $this */ public function setPercent($percent) { @@ -64,18 +80,19 @@ class Tax extends PPModel /** * Rate of the specified tax. Range of 0.001 to 99.999. * - * @return PayPal\Api\number + * @return \PayPal\Api\number */ public function getPercent() { return $this->percent; } - /** * Tax in the form of money. Cannot be specified in a request. * - * @param PayPal\Api\Currency $amount + * @param \PayPal\Api\Currency $amount + * + * @return $this */ public function setAmount($amount) { @@ -86,12 +103,11 @@ class Tax extends PPModel /** * Tax in the form of money. Cannot be specified in a request. * - * @return PayPal\Api\Currency + * @return \PayPal\Api\Currency */ public function getAmount() { return $this->amount; } - }