Overview
  • Namespace
  • Class

Namespaces

  • PayPal
    • Api
    • Auth
    • Cache
    • Common
    • Converter
    • Core
    • Exception
    • Handler
    • Log
    • Rest
    • Security
    • Transport
    • Validation

Classes

  • PayPal\Api\Address
  • PayPal\Api\Agreement
  • PayPal\Api\AgreementDetails
  • PayPal\Api\AgreementStateDescriptor
  • PayPal\Api\AgreementTransaction
  • PayPal\Api\AgreementTransactions
  • PayPal\Api\AlternatePayment
  • PayPal\Api\Amount
  • PayPal\Api\Authorization
  • PayPal\Api\BankAccount
  • PayPal\Api\BankAccountsList
  • PayPal\Api\BankToken
  • PayPal\Api\BaseAddress
  • PayPal\Api\Billing
  • PayPal\Api\BillingAgreementToken
  • PayPal\Api\BillingInfo
  • PayPal\Api\CancelNotification
  • PayPal\Api\Capture
  • PayPal\Api\CarrierAccount
  • PayPal\Api\CarrierAccountToken
  • PayPal\Api\CartBase
  • PayPal\Api\ChargeModel
  • PayPal\Api\Cost
  • PayPal\Api\CountryCode
  • PayPal\Api\CreateProfileResponse
  • PayPal\Api\Credit
  • PayPal\Api\CreditCard
  • PayPal\Api\CreditCardHistory
  • PayPal\Api\CreditCardList
  • PayPal\Api\CreditCardToken
  • PayPal\Api\CreditFinancingOffered
  • PayPal\Api\Currency
  • PayPal\Api\CurrencyConversion
  • PayPal\Api\CustomAmount
  • PayPal\Api\DetailedRefund
  • PayPal\Api\Details
  • PayPal\Api\Error
  • PayPal\Api\ErrorDetails
  • PayPal\Api\ExtendedBankAccount
  • PayPal\Api\ExternalFunding
  • PayPal\Api\FileAttachment
  • PayPal\Api\FlowConfig
  • PayPal\Api\FmfDetails
  • PayPal\Api\FundingDetail
  • PayPal\Api\FundingInstrument
  • PayPal\Api\FundingOption
  • PayPal\Api\FundingSource
  • PayPal\Api\FuturePayment
  • PayPal\Api\HyperSchema
  • PayPal\Api\Image
  • PayPal\Api\Incentive
  • PayPal\Api\InputFields
  • PayPal\Api\InstallmentInfo
  • PayPal\Api\InstallmentOption
  • PayPal\Api\Invoice
  • PayPal\Api\InvoiceAddress
  • PayPal\Api\InvoiceItem
  • PayPal\Api\InvoiceNumber
  • PayPal\Api\InvoiceSearchResponse
  • PayPal\Api\Item
  • PayPal\Api\ItemList
  • PayPal\Api\Links
  • PayPal\Api\Measurement
  • PayPal\Api\MerchantInfo
  • PayPal\Api\MerchantPreferences
  • PayPal\Api\Metadata
  • PayPal\Api\NameValuePair
  • PayPal\Api\Notification
  • PayPal\Api\OpenIdAddress
  • PayPal\Api\OpenIdError
  • PayPal\Api\OpenIdSession
  • PayPal\Api\OpenIdTokeninfo
  • PayPal\Api\OpenIdUserinfo
  • PayPal\Api\Order
  • PayPal\Api\OverrideChargeModel
  • PayPal\Api\Participant
  • PayPal\Api\Patch
  • PayPal\Api\PatchRequest
  • PayPal\Api\Payee
  • PayPal\Api\Payer
  • PayPal\Api\PayerInfo
  • PayPal\Api\Payment
  • PayPal\Api\PaymentCard
  • PayPal\Api\PaymentCardToken
  • PayPal\Api\PaymentDefinition
  • PayPal\Api\PaymentDetail
  • PayPal\Api\PaymentExecution
  • PayPal\Api\PaymentHistory
  • PayPal\Api\PaymentInstruction
  • PayPal\Api\PaymentOptions
  • PayPal\Api\PaymentSummary
  • PayPal\Api\PaymentTerm
  • PayPal\Api\Payout
  • PayPal\Api\PayoutBatch
  • PayPal\Api\PayoutBatchHeader
  • PayPal\Api\PayoutItem
  • PayPal\Api\PayoutItemDetails
  • PayPal\Api\PayoutSenderBatchHeader
  • PayPal\Api\Phone
  • PayPal\Api\Plan
  • PayPal\Api\PlanList
  • PayPal\Api\PotentialPayerInfo
  • PayPal\Api\Presentation
  • PayPal\Api\PrivateLabelCard
  • PayPal\Api\ProcessorResponse
  • PayPal\Api\RecipientBankingInstruction
  • PayPal\Api\RedirectUrls
  • PayPal\Api\Refund
  • PayPal\Api\RefundDetail
  • PayPal\Api\RefundRequest
  • PayPal\Api\RelatedResources
  • PayPal\Api\Sale
  • PayPal\Api\Search
  • PayPal\Api\ShippingAddress
  • PayPal\Api\ShippingCost
  • PayPal\Api\ShippingInfo
  • PayPal\Api\Tax
  • PayPal\Api\Template
  • PayPal\Api\TemplateData
  • PayPal\Api\Templates
  • PayPal\Api\TemplateSettings
  • PayPal\Api\TemplateSettingsMetadata
  • PayPal\Api\Terms
  • PayPal\Api\Transaction
  • PayPal\Api\TransactionBase
  • PayPal\Api\Transactions
  • PayPal\Api\VerifyWebhookSignature
  • PayPal\Api\VerifyWebhookSignatureResponse
  • PayPal\Api\Webhook
  • PayPal\Api\WebhookEvent
  • PayPal\Api\WebhookEventList
  • PayPal\Api\WebhookEventType
  • PayPal\Api\WebhookEventTypeList
  • PayPal\Api\WebhookList
  • PayPal\Api\WebProfile
  • PayPal\Auth\OAuthTokenCredential
  • PayPal\Cache\AuthorizationCache
  • PayPal\Common\ArrayUtil
  • PayPal\Common\PayPalModel
  • PayPal\Common\PayPalResourceModel
  • PayPal\Common\PayPalUserAgent
  • PayPal\Common\ReflectionUtil
  • PayPal\Converter\FormatConverter
  • PayPal\Core\PayPalConfigManager
  • PayPal\Core\PayPalConstants
  • PayPal\Core\PayPalCredentialManager
  • PayPal\Core\PayPalHttpConfig
  • PayPal\Core\PayPalHttpConnection
  • PayPal\Core\PayPalLoggingManager
  • PayPal\Handler\OauthHandler
  • PayPal\Handler\RestHandler
  • PayPal\Log\PayPalDefaultLogFactory
  • PayPal\Log\PayPalLogger
  • PayPal\Rest\ApiContext
  • PayPal\Security\Cipher
  • PayPal\Transport\PayPalRestCall
  • PayPal\Validation\ArgumentValidator
  • PayPal\Validation\JsonValidator
  • PayPal\Validation\NumericValidator
  • PayPal\Validation\UrlValidator

Interfaces

  • PayPal\Handler\IPayPalHandler
  • PayPal\Log\PayPalLogFactory
  • PayPal\Rest\IResource

Exceptions

  • PayPal\Exception\PayPalConfigurationException
  • PayPal\Exception\PayPalConnectionException
  • PayPal\Exception\PayPalInvalidCredentialException
  • PayPal\Exception\PayPalMissingCredentialException
  1 <?php
  2 
  3 namespace PayPal\Api;
  4 
  5 use PayPal\Common\PayPalModel;
  6 use PayPal\Converter\FormatConverter;
  7 use PayPal\Validation\NumericValidator;
  8 use PayPal\Validation\UrlValidator;
  9 
 10 /**
 11  * Class InvoiceItem
 12  *
 13  * Information about a single line item.
 14  *
 15  * @package PayPal\Api
 16  *
 17  * @property string name
 18  * @property string description
 19  * @property \PayPal\Api\number quantity
 20  * @property \PayPal\Api\Currency unit_price
 21  * @property \PayPal\Api\Tax tax
 22  * @property string date
 23  * @property \PayPal\Api\Cost discount
 24  * @property string unit_of_measure
 25  */
 26 class InvoiceItem extends PayPalModel
 27 {
 28     /**
 29      * Name of the item. 200 characters max.
 30      *
 31      * @param string $name
 32      * 
 33      * @return $this
 34      */
 35     public function setName($name)
 36     {
 37         $this->name = $name;
 38         return $this;
 39     }
 40 
 41     /**
 42      * Name of the item. 200 characters max.
 43      *
 44      * @return string
 45      */
 46     public function getName()
 47     {
 48         return $this->name;
 49     }
 50 
 51     /**
 52      * Description of the item. 1000 characters max.
 53      *
 54      * @param string $description
 55      * 
 56      * @return $this
 57      */
 58     public function setDescription($description)
 59     {
 60         $this->description = $description;
 61         return $this;
 62     }
 63 
 64     /**
 65      * Description of the item. 1000 characters max.
 66      *
 67      * @return string
 68      */
 69     public function getDescription()
 70     {
 71         return $this->description;
 72     }
 73 
 74     /**
 75      * Quantity of the item. Range of -10000 to 10000.
 76      *
 77      * @param string|double $quantity
 78      * 
 79      * @return $this
 80      */
 81     public function setQuantity($quantity)
 82     {
 83         NumericValidator::validate($quantity, "Quantity");
 84         $quantity = FormatConverter::formatToPrice($quantity);
 85         $this->quantity = $quantity;
 86         return $this;
 87     }
 88 
 89     /**
 90      * Quantity of the item. Range of -10000 to 10000.
 91      *
 92      * @return string
 93      */
 94     public function getQuantity()
 95     {
 96         return $this->quantity;
 97     }
 98 
 99     /**
100      * Unit price of the item. Range of -1,000,000 to 1,000,000.
101      *
102      * @param \PayPal\Api\Currency $unit_price
103      * 
104      * @return $this
105      */
106     public function setUnitPrice($unit_price)
107     {
108         $this->unit_price = $unit_price;
109         return $this;
110     }
111 
112     /**
113      * Unit price of the item. Range of -1,000,000 to 1,000,000.
114      *
115      * @return \PayPal\Api\Currency
116      */
117     public function getUnitPrice()
118     {
119         return $this->unit_price;
120     }
121 
122     /**
123      * Tax associated with the item.
124      *
125      * @param \PayPal\Api\Tax $tax
126      * 
127      * @return $this
128      */
129     public function setTax($tax)
130     {
131         $this->tax = $tax;
132         return $this;
133     }
134 
135     /**
136      * Tax associated with the item.
137      *
138      * @return \PayPal\Api\Tax
139      */
140     public function getTax()
141     {
142         return $this->tax;
143     }
144 
145     /**
146      * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
147      *
148      * @param string $date
149      * 
150      * @return $this
151      */
152     public function setDate($date)
153     {
154         $this->date = $date;
155         return $this;
156     }
157 
158     /**
159      * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
160      *
161      * @return string
162      */
163     public function getDate()
164     {
165         return $this->date;
166     }
167 
168     /**
169      * The item discount, as a percent or an amount value.
170      *
171      * @param \PayPal\Api\Cost $discount
172      * 
173      * @return $this
174      */
175     public function setDiscount($discount)
176     {
177         $this->discount = $discount;
178         return $this;
179     }
180 
181     /**
182      * The item discount, as a percent or an amount value.
183      *
184      * @return \PayPal\Api\Cost
185      */
186     public function getDiscount()
187     {
188         return $this->discount;
189     }
190 
191     /**
192      * The image URL. Maximum length is 4000 characters.
193      * @deprecated Not publicly available
194      * @param string $image_url
195      * @throws \InvalidArgumentException
196      * @return $this
197      */
198     public function setImageUrl($image_url)
199     {
200         UrlValidator::validate($image_url, "ImageUrl");
201         $this->image_url = $image_url;
202         return $this;
203     }
204 
205     /**
206      * The image URL. Maximum length is 4000 characters.
207      * @deprecated Not publicly available
208      * @return string
209      */
210     public function getImageUrl()
211     {
212         return $this->image_url;
213     }
214 
215     /**
216      * The unit of measure of the item being invoiced.
217      * Valid Values: ["QUANTITY", "HOURS", "AMOUNT"]
218      *
219      * @param string $unit_of_measure
220      * 
221      * @return $this
222      */
223     public function setUnitOfMeasure($unit_of_measure)
224     {
225         $this->unit_of_measure = $unit_of_measure;
226         return $this;
227     }
228 
229     /**
230      * The unit of measure of the item being invoiced.
231      *
232      * @return string
233      */
234     public function getUnitOfMeasure()
235     {
236         return $this->unit_of_measure;
237     }
238 
239 }
240 
API documentation generated by ApiGen