PayPalApiPayoutItem

Class PayoutItem.

Defined (1)

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

/classes/lib/PayPal/Api/PayoutItem.php  
  1. class PayoutItem extends PayPalResourceModel 
  2. /** 
  3. * The type of identification for the payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. 
  4. * @param string $recipient_type 
  5. * @return $this 
  6. */ 
  7. public function setRecipientType($recipient_type) 
  8. $this->recipient_type = $recipient_type; 
  9. return $this; 
  10.  
  11. /** 
  12. * The type of identification for the payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. 
  13. * @return string 
  14. */ 
  15. public function getRecipientType() 
  16. return $this->recipient_type; 
  17.  
  18. /** 
  19. * The amount of money to pay a receiver. 
  20. * @param \PayPal\Api\Currency $amount 
  21. * @return $this 
  22. */ 
  23. public function setAmount($amount) 
  24. $this->amount = $amount; 
  25. return $this; 
  26.  
  27. /** 
  28. * The amount of money to pay a receiver. 
  29. * @return \PayPal\Api\Currency 
  30. */ 
  31. public function getAmount() 
  32. return $this->amount; 
  33.  
  34. /** 
  35. * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. 
  36. * @param string $note 
  37. * @return $this 
  38. */ 
  39. public function setNote($note) 
  40. $this->note = $note; 
  41. return $this; 
  42.  
  43. /** 
  44. * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. 
  45. * @return string 
  46. */ 
  47. public function getNote() 
  48. return $this->note; 
  49.  
  50. /** 
  51. * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. 
  52. * @param string $receiver 
  53. * @return $this 
  54. */ 
  55. public function setReceiver($receiver) 
  56. $this->receiver = $receiver; 
  57. return $this; 
  58.  
  59. /** 
  60. * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. 
  61. * @return string 
  62. */ 
  63. public function getReceiver() 
  64. return $this->receiver; 
  65.  
  66. /** 
  67. * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. 
  68. * @param string $sender_item_id 
  69. * @return $this 
  70. */ 
  71. public function setSenderItemId($sender_item_id) 
  72. $this->sender_item_id = $sender_item_id; 
  73. return $this; 
  74.  
  75. /** 
  76. * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. 
  77. * @return string 
  78. */ 
  79. public function getSenderItemId() 
  80. return $this->sender_item_id; 
  81.  
  82. /** 
  83. * Obtain the status of a payout item by passing the item ID to the request URI. 
  84. * @param string $payoutItemId 
  85. * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. 
  86. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls 
  87. * @return PayoutItemDetails 
  88. */ 
  89. public static function get($payoutItemId, $apiContext = null, $restCall = null) 
  90. ArgumentValidator::validate($payoutItemId, 'payoutItemId'); 
  91. $payLoad = ""; 
  92. $json = self::executeCall( 
  93. "/v1/payments/payouts-item/$payoutItemId",  
  94. "GET",  
  95. $payLoad,  
  96. null,  
  97. $apiContext,  
  98. $restCall 
  99. ); 
  100. $ret = new PayoutItemDetails(); 
  101. $ret->fromJson($json); 
  102. return $ret; 
  103.  
  104. /** 
  105. * Cancels the unclaimed payment using the items id passed in the request URI. If an unclaimed item is not claimed within 30 days, the funds will be automatically returned to the sender. This call can be used to cancel the unclaimed item prior to the automatic 30-day return. 
  106. * @param string $payoutItemId 
  107. * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. 
  108. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls 
  109. * @return PayoutItemDetails 
  110. */ 
  111. public static function cancel($payoutItemId, $apiContext = null, $restCall = null) 
  112. ArgumentValidator::validate($payoutItemId, 'payoutItemId'); 
  113. $payLoad = ""; 
  114. $json = self::executeCall( 
  115. "/v1/payments/payouts-item/$payoutItemId/cancel",  
  116. "POST",  
  117. $payLoad,  
  118. null,  
  119. $apiContext,  
  120. $restCall 
  121. ); 
  122. $ret = new PayoutItemDetails(); 
  123. $ret->fromJson($json); 
  124. return $ret; 
  125.