PayPalApiRefund

Class Refund.

Defined (1)

The class is defined in the following location(s).

/classes/lib/PayPal/Api/Refund.php  
  1. class Refund extends PayPalResourceModel 
  2. /** 
  3. * ID of the refund transaction. 17 characters max. 
  4. * @param string $id 
  5. * @return $this 
  6. */ 
  7. public function setId($id) 
  8. $this->id = $id; 
  9. return $this; 
  10.  
  11. /** 
  12. * ID of the refund transaction. 17 characters max. 
  13. * @return string 
  14. */ 
  15. public function getId() 
  16. return $this->id; 
  17.  
  18. /** 
  19. * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. 
  20. * @param \PayPal\Api\Amount $amount 
  21. * @return $this 
  22. */ 
  23. public function setAmount($amount) 
  24. $this->amount = $amount; 
  25. return $this; 
  26.  
  27. /** 
  28. * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. 
  29. * @return \PayPal\Api\Amount 
  30. */ 
  31. public function getAmount() 
  32. return $this->amount; 
  33.  
  34. /** 
  35. * State of the refund. 
  36. * Valid Values: ["pending", "completed", "failed"] 
  37. * @param string $state 
  38. * @return $this 
  39. */ 
  40. public function setState($state) 
  41. $this->state = $state; 
  42. return $this; 
  43.  
  44. /** 
  45. * State of the refund. 
  46. * @return string 
  47. */ 
  48. public function getState() 
  49. return $this->state; 
  50.  
  51. /** 
  52. * Reason description for the Sale transaction being refunded. 
  53. * @param string $reason 
  54. * @return $this 
  55. */ 
  56. public function setReason($reason) 
  57. $this->reason = $reason; 
  58. return $this; 
  59.  
  60. /** 
  61. * Reason description for the Sale transaction being refunded. 
  62. * @return string 
  63. */ 
  64. public function getReason() 
  65. return $this->reason; 
  66.  
  67. /** 
  68. * ID of the Sale transaction being refunded. 
  69. * @param string $sale_id 
  70. * @return $this 
  71. */ 
  72. public function setSaleId($sale_id) 
  73. $this->sale_id = $sale_id; 
  74. return $this; 
  75.  
  76. /** 
  77. * ID of the Sale transaction being refunded. 
  78. * @return string 
  79. */ 
  80. public function getSaleId() 
  81. return $this->sale_id; 
  82.  
  83. /** 
  84. * ID of the sale transaction being refunded. 
  85. * @param string $capture_id 
  86. * @return $this 
  87. */ 
  88. public function setCaptureId($capture_id) 
  89. $this->capture_id = $capture_id; 
  90. return $this; 
  91.  
  92. /** 
  93. * ID of the sale transaction being refunded. 
  94. * @return string 
  95. */ 
  96. public function getCaptureId() 
  97. return $this->capture_id; 
  98.  
  99. /** 
  100. * ID of the payment resource on which this transaction is based. 
  101. * @param string $parent_payment 
  102. * @return $this 
  103. */ 
  104. public function setParentPayment($parent_payment) 
  105. $this->parent_payment = $parent_payment; 
  106. return $this; 
  107.  
  108. /** 
  109. * ID of the payment resource on which this transaction is based. 
  110. * @return string 
  111. */ 
  112. public function getParentPayment() 
  113. return $this->parent_payment; 
  114.  
  115. /** 
  116. * Description of what is being refunded for. 
  117. * @param string $description 
  118. * @return $this 
  119. */ 
  120. public function setDescription($description) 
  121. $this->description = $description; 
  122. return $this; 
  123.  
  124. /** 
  125. * Description of what is being refunded for. 
  126. * @return string 
  127. */ 
  128. public function getDescription() 
  129. return $this->description; 
  130.  
  131. /** 
  132. * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). 
  133. * @param string $create_time 
  134. * @return $this 
  135. */ 
  136. public function setCreateTime($create_time) 
  137. $this->create_time = $create_time; 
  138. return $this; 
  139.  
  140. /** 
  141. * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). 
  142. * @return string 
  143. */ 
  144. public function getCreateTime() 
  145. return $this->create_time; 
  146.  
  147. /** 
  148. * Time that the resource was last updated. 
  149. * @param string $update_time 
  150. * @return $this 
  151. */ 
  152. public function setUpdateTime($update_time) 
  153. $this->update_time = $update_time; 
  154. return $this; 
  155.  
  156. /** 
  157. * Time that the resource was last updated. 
  158. * @return string 
  159. */ 
  160. public function getUpdateTime() 
  161. return $this->update_time; 
  162.  
  163. /** 
  164. * Retrieve details about a specific refund by passing the refund_id in the request URI. 
  165. * @param string $refundId 
  166. * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. 
  167. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls 
  168. * @return Refund 
  169. */ 
  170. public static function get($refundId, $apiContext = null, $restCall = null) 
  171. ArgumentValidator::validate($refundId, 'refundId'); 
  172. $payLoad = ""; 
  173. $json = self::executeCall( 
  174. "/v1/payments/refund/$refundId",  
  175. "GET",  
  176. $payLoad,  
  177. null,  
  178. $apiContext,  
  179. $restCall 
  180. ); 
  181. $ret = new Refund(); 
  182. $ret->fromJson($json); 
  183. return $ret; 
  184.