PayPalApiItemList

Class ItemList.

Defined (1)

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

/classes/lib/PayPal/Api/ItemList.php  
  1. class ItemList extends PayPalModel 
  2. /** 
  3. * List of items. 
  4. * @param \PayPal\Api\Item[] $items 
  5. * @return $this 
  6. */ 
  7. public function setItems($items) 
  8. $this->items = $items; 
  9. return $this; 
  10.  
  11. /** 
  12. * List of items. 
  13. * @return \PayPal\Api\Item[] 
  14. */ 
  15. public function getItems() 
  16. return $this->items; 
  17.  
  18. /** 
  19. * Append Items to the list. 
  20. * @param \PayPal\Api\Item $item 
  21. * @return $this 
  22. */ 
  23. public function addItem($item) 
  24. if (!$this->getItems()) { 
  25. return $this->setItems(array($item)); 
  26. } else { 
  27. return $this->setItems( 
  28. array_merge($this->getItems(), array($item)) 
  29. ); 
  30.  
  31. /** 
  32. * Remove Items from the list. 
  33. * @param \PayPal\Api\Item $item 
  34. * @return $this 
  35. */ 
  36. public function removeItem($item) 
  37. return $this->setItems( 
  38. array_diff($this->getItems(), array($item)) 
  39. ); 
  40.  
  41. /** 
  42. * Shipping address, if different than the payer address. 
  43. * @param \PayPal\Api\ShippingAddress $shipping_address 
  44. * @return $this 
  45. */ 
  46. public function setShippingAddress($shipping_address) 
  47. $this->shipping_address = $shipping_address; 
  48. return $this; 
  49.  
  50. /** 
  51. * Shipping address, if different than the payer address. 
  52. * @return \PayPal\Api\ShippingAddress 
  53. */ 
  54. public function getShippingAddress() 
  55. return $this->shipping_address; 
  56.  
  57. /** 
  58. * Shipping method used for this payment like USPSParcel etc. 
  59. * @param string $shipping_method 
  60. * @return $this 
  61. */ 
  62. public function setShippingMethod($shipping_method) 
  63. $this->shipping_method = $shipping_method; 
  64. return $this; 
  65.  
  66. /** 
  67. * Shipping method used for this payment like USPSParcel etc. 
  68. * @return string 
  69. */ 
  70. public function getShippingMethod() 
  71. return $this->shipping_method; 
  72.  
  73. /** 
  74. * Allows merchant's to share payer*s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer*s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan 
  75. * @param string $shipping_phone_number 
  76. * @return $this 
  77. */ 
  78. public function setShippingPhoneNumber($shipping_phone_number) 
  79. $this->shipping_phone_number = $shipping_phone_number; 
  80. return $this; 
  81.  
  82. /** 
  83. * Allows merchant's to share payer*s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer*s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan 
  84. * @return string 
  85. */ 
  86. public function getShippingPhoneNumber() 
  87. return $this->shipping_phone_number; 
  88.