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 
  9 /**
 10  * Class Details
 11  *
 12  * Additional details of the payment amount.
 13  *
 14  * @package PayPal\Api
 15  *
 16  * @property string subtotal
 17  * @property string shipping
 18  * @property string tax
 19  * @property string handling_fee
 20  * @property string shipping_discount
 21  * @property string insurance
 22  * @property string gift_wrap
 23  * @property string fee
 24  */
 25 class Details extends PayPalModel
 26 {
 27     /**
 28      * Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places.
 29      *
 30      * @param string|double $subtotal
 31      * 
 32      * @return $this
 33      */
 34     public function setSubtotal($subtotal)
 35     {
 36         NumericValidator::validate($subtotal, "Subtotal");
 37         $subtotal = FormatConverter::formatToPrice($subtotal);
 38         $this->subtotal = $subtotal;
 39         return $this;
 40     }
 41 
 42     /**
 43      * Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places.
 44      *
 45      * @return string
 46      */
 47     public function getSubtotal()
 48     {
 49         return $this->subtotal;
 50     }
 51 
 52     /**
 53      * Amount charged for shipping. 10 characters max with support for 2 decimal places.
 54      *
 55      * @param string|double $shipping
 56      * 
 57      * @return $this
 58      */
 59     public function setShipping($shipping)
 60     {
 61         NumericValidator::validate($shipping, "Shipping");
 62         $shipping = FormatConverter::formatToPrice($shipping);
 63         $this->shipping = $shipping;
 64         return $this;
 65     }
 66 
 67     /**
 68      * Amount charged for shipping. 10 characters max with support for 2 decimal places.
 69      *
 70      * @return string
 71      */
 72     public function getShipping()
 73     {
 74         return $this->shipping;
 75     }
 76 
 77     /**
 78      * Amount charged for tax. 10 characters max with support for 2 decimal places.
 79      *
 80      * @param string|double $tax
 81      * 
 82      * @return $this
 83      */
 84     public function setTax($tax)
 85     {
 86         NumericValidator::validate($tax, "Tax");
 87         $tax = FormatConverter::formatToPrice($tax);
 88         $this->tax = $tax;
 89         return $this;
 90     }
 91 
 92     /**
 93      * Amount charged for tax. 10 characters max with support for 2 decimal places.
 94      *
 95      * @return string
 96      */
 97     public function getTax()
 98     {
 99         return $this->tax;
100     }
101 
102     /**
103      * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
104      *
105      * @param string|double $handling_fee
106      * 
107      * @return $this
108      */
109     public function setHandlingFee($handling_fee)
110     {
111         NumericValidator::validate($handling_fee, "Handling Fee");
112         $handling_fee = FormatConverter::formatToPrice($handling_fee);
113         $this->handling_fee = $handling_fee;
114         return $this;
115     }
116 
117     /**
118      * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
119      *
120      * @return string
121      */
122     public function getHandlingFee()
123     {
124         return $this->handling_fee;
125     }
126 
127     /**
128      * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
129      *
130      * @param string|double $shipping_discount
131      * 
132      * @return $this
133      */
134     public function setShippingDiscount($shipping_discount)
135     {
136         NumericValidator::validate($shipping_discount, "Shipping Discount");
137         $shipping_discount = FormatConverter::formatToPrice($shipping_discount);
138         $this->shipping_discount = $shipping_discount;
139         return $this;
140     }
141 
142     /**
143      * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
144      *
145      * @return string
146      */
147     public function getShippingDiscount()
148     {
149         return $this->shipping_discount;
150     }
151 
152     /**
153      * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
154      *
155      * @param string|double $insurance
156      * 
157      * @return $this
158      */
159     public function setInsurance($insurance)
160     {
161         NumericValidator::validate($insurance, "Insurance");
162         $insurance = FormatConverter::formatToPrice($insurance);
163         $this->insurance = $insurance;
164         return $this;
165     }
166 
167     /**
168      * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
169      *
170      * @return string
171      */
172     public function getInsurance()
173     {
174         return $this->insurance;
175     }
176 
177     /**
178      * Amount being charged as gift wrap fee.
179      *
180      * @param string|double $gift_wrap
181      * 
182      * @return $this
183      */
184     public function setGiftWrap($gift_wrap)
185     {
186         NumericValidator::validate($gift_wrap, "Gift Wrap");
187         $gift_wrap = FormatConverter::formatToPrice($gift_wrap);
188         $this->gift_wrap = $gift_wrap;
189         return $this;
190     }
191 
192     /**
193      * Amount being charged as gift wrap fee.
194      *
195      * @return string
196      */
197     public function getGiftWrap()
198     {
199         return $this->gift_wrap;
200     }
201 
202     /**
203      * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
204      *
205      * @param string|double $fee
206      * 
207      * @return $this
208      */
209     public function setFee($fee)
210     {
211         NumericValidator::validate($fee, "Fee");
212         $fee = FormatConverter::formatToPrice($fee);
213         $this->fee = $fee;
214         return $this;
215     }
216 
217     /**
218      * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
219      *
220      * @return string
221      */
222     public function getFee()
223     {
224         return $this->fee;
225     }
226 
227 }
228 
API documentation generated by ApiGen