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\PayPalResourceModel;
  6 use PayPal\Validation\ArgumentValidator;
  7 use PayPal\Rest\ApiContext;
  8 
  9 /**
 10  * Class Refund
 11  *
 12  * A refund transaction.
 13  *
 14  * @package PayPal\Api
 15  *
 16  * @property string id
 17  * @property \PayPal\Api\Amount amount
 18  * @property string state
 19  * @property string reason
 20  * @property string invoice_number
 21  * @property string sale_id
 22  * @property string capture_id
 23  * @property string parent_payment
 24  * @property string description
 25  * @property string create_time
 26  * @property string update_time
 27  * @property string reason_code
 28  * @property \PayPal\Api\Links[] links
 29  */
 30 class Refund extends PayPalResourceModel
 31 {
 32     /**
 33      * ID of the refund transaction. 17 characters max.
 34      *
 35      * @param string $id
 36      * 
 37      * @return $this
 38      */
 39     public function setId($id)
 40     {
 41         $this->id = $id;
 42         return $this;
 43     }
 44 
 45     /**
 46      * ID of the refund transaction. 17 characters max.
 47      *
 48      * @return string
 49      */
 50     public function getId()
 51     {
 52         return $this->id;
 53     }
 54 
 55     /**
 56      * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max.
 57      *
 58      * @param \PayPal\Api\Amount $amount
 59      * 
 60      * @return $this
 61      */
 62     public function setAmount($amount)
 63     {
 64         $this->amount = $amount;
 65         return $this;
 66     }
 67 
 68     /**
 69      * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max.
 70      *
 71      * @return \PayPal\Api\Amount
 72      */
 73     public function getAmount()
 74     {
 75         return $this->amount;
 76     }
 77 
 78     /**
 79      * State of the refund.
 80      * Valid Values: ["pending", "completed", "failed"]
 81      *
 82      * @param string $state
 83      * 
 84      * @return $this
 85      */
 86     public function setState($state)
 87     {
 88         $this->state = $state;
 89         return $this;
 90     }
 91 
 92     /**
 93      * State of the refund.
 94      *
 95      * @return string
 96      */
 97     public function getState()
 98     {
 99         return $this->state;
100     }
101 
102     /**
103      * Reason description for the Sale transaction being refunded.
104      *
105      * @param string $reason
106      * 
107      * @return $this
108      */
109     public function setReason($reason)
110     {
111         $this->reason = $reason;
112         return $this;
113     }
114 
115     /**
116      * Reason description for the Sale transaction being refunded.
117      *
118      * @return string
119      */
120     public function getReason()
121     {
122         return $this->reason;
123     }
124 
125     /**
126      * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters.
127      *
128      * @param string $invoice_number
129      * 
130      * @return $this
131      */
132     public function setInvoiceNumber($invoice_number)
133     {
134         $this->invoice_number = $invoice_number;
135         return $this;
136     }
137 
138     /**
139      * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters.
140      *
141      * @return string
142      */
143     public function getInvoiceNumber()
144     {
145         return $this->invoice_number;
146     }
147 
148     /**
149      * ID of the Sale transaction being refunded. 
150      *
151      * @param string $sale_id
152      * 
153      * @return $this
154      */
155     public function setSaleId($sale_id)
156     {
157         $this->sale_id = $sale_id;
158         return $this;
159     }
160 
161     /**
162      * ID of the Sale transaction being refunded. 
163      *
164      * @return string
165      */
166     public function getSaleId()
167     {
168         return $this->sale_id;
169     }
170 
171     /**
172      * ID of the sale transaction being refunded.
173      *
174      * @param string $capture_id
175      * 
176      * @return $this
177      */
178     public function setCaptureId($capture_id)
179     {
180         $this->capture_id = $capture_id;
181         return $this;
182     }
183 
184     /**
185      * ID of the sale transaction being refunded.
186      *
187      * @return string
188      */
189     public function getCaptureId()
190     {
191         return $this->capture_id;
192     }
193 
194     /**
195      * ID of the payment resource on which this transaction is based.
196      *
197      * @param string $parent_payment
198      * 
199      * @return $this
200      */
201     public function setParentPayment($parent_payment)
202     {
203         $this->parent_payment = $parent_payment;
204         return $this;
205     }
206 
207     /**
208      * ID of the payment resource on which this transaction is based.
209      *
210      * @return string
211      */
212     public function getParentPayment()
213     {
214         return $this->parent_payment;
215     }
216 
217     /**
218      * Description of what is being refunded for.
219      *
220      * @param string $description
221      * 
222      * @return $this
223      */
224     public function setDescription($description)
225     {
226         $this->description = $description;
227         return $this;
228     }
229 
230     /**
231      * Description of what is being refunded for.
232      *
233      * @return string
234      */
235     public function getDescription()
236     {
237         return $this->description;
238     }
239 
240     /**
241      * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
242      *
243      * @param string $create_time
244      * 
245      * @return $this
246      */
247     public function setCreateTime($create_time)
248     {
249         $this->create_time = $create_time;
250         return $this;
251     }
252 
253     /**
254      * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
255      *
256      * @return string
257      */
258     public function getCreateTime()
259     {
260         return $this->create_time;
261     }
262 
263     /**
264      * Time that the resource was last updated.
265      *
266      * @param string $update_time
267      * 
268      * @return $this
269      */
270     public function setUpdateTime($update_time)
271     {
272         $this->update_time = $update_time;
273         return $this;
274     }
275 
276     /**
277      * Time that the resource was last updated.
278      *
279      * @return string
280      */
281     public function getUpdateTime()
282     {
283         return $this->update_time;
284     }
285 
286     /**
287      * The reason code for the refund state being pending
288      * Valid Values: ["ECHECK"]
289      *
290      * @param string $reason_code
291      * 
292      * @return $this
293      */
294     public function setReasonCode($reason_code)
295     {
296         $this->reason_code = $reason_code;
297         return $this;
298     }
299 
300     /**
301      * The reason code for the refund state being pending
302      *
303      * @return string
304      */
305     public function getReasonCode()
306     {
307         return $this->reason_code;
308     }
309 
310     /**
311      * Shows details for a refund, by ID.
312      *
313      * @param string $refundId
314      * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
315      * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
316      * @return Refund
317      */
318     public static function get($refundId, $apiContext = null, $restCall = null)
319     {
320         ArgumentValidator::validate($refundId, 'refundId');
321         $payLoad = "";
322         $json = self::executeCall(
323             "/v1/payments/refund/$refundId",
324             "GET",
325             $payLoad,
326             null,
327             $apiContext,
328             $restCall
329         );
330         $ret = new Refund();
331         $ret->fromJson($json);
332         return $ret;
333     }
334 
335 }
336 
API documentation generated by ApiGen