Simplify_InvoiceItem

Copyright (c) 2013 - 2015 MasterCard International Incorporated All rights reserved.

Defined (1)

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

/includes/gateways/simplify-commerce/includes/Simplify/InvoiceItem.php  
  1. class Simplify_InvoiceItem extends Simplify_Object { 
  2. /** 
  3. * Creates an Simplify_InvoiceItem object 
  4. * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  5. * <dt><tt>amount</tt></dt> <dd>Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: -9999900, max value: 9999900] <strong>required </strong></dd> 
  6. * <dt><tt>description</tt></dt> <dd>Individual items of an invoice [max length: 1024] </dd> 
  7. * <dt><tt>invoice</tt></dt> <dd>The ID of the invoice this item belongs to. </dd> 
  8. * <dt><tt>product</tt></dt> <dd>Product ID this item relates to. </dd> 
  9. * <dt><tt>quantity</tt></dt> <dd>Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999, default: 1] </dd> 
  10. * <dt><tt>reference</tt></dt> <dd>User defined reference field. [max length: 255] </dd> 
  11. * <dt><tt>tax</tt></dt> <dd>The tax ID of the tax charge in the invoice item. </dd></dl> 
  12. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.<i/> 
  13. * @return InvoiceItem a InvoiceItem object. 
  14. */ 
  15. static public function createInvoiceItem($hash, $authentication = null) { 
  16.  
  17. $args = func_get_args(); 
  18. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  19.  
  20. $instance = new Simplify_InvoiceItem(); 
  21. $instance->setAll($hash); 
  22.  
  23. $object = Simplify_PaymentsApi::createObject($instance, $authentication); 
  24. return $object; 
  25.  
  26.  
  27.  
  28.  
  29. /** 
  30. * Deletes an Simplify_InvoiceItem object. 
  31. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i> 
  32. */ 
  33. public function deleteInvoiceItem($authentication = null) { 
  34.  
  35. $args = func_get_args(); 
  36. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); 
  37.  
  38. $obj = Simplify_PaymentsApi::deleteObject($this, $authentication); 
  39. $this->properties = null; 
  40. return true; 
  41.  
  42.  
  43. /** 
  44. * Retrieve a Simplify_InvoiceItem object from the API 
  45. * @param string id the id of the InvoiceItem object to retrieve 
  46. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i> 
  47. * @return InvoiceItem a InvoiceItem object 
  48. */ 
  49. static public function findInvoiceItem($id, $authentication = null) { 
  50.  
  51. $args = func_get_args(); 
  52. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  53.  
  54. $val = new Simplify_InvoiceItem(); 
  55. $val->id = $id; 
  56.  
  57. $obj = Simplify_PaymentsApi::findObject($val, $authentication); 
  58.  
  59. return $obj; 
  60.  
  61.  
  62. /** 
  63. * Updates an Simplify_InvoiceItem object. 
  64. * The properties that can be updated: 
  65. * <dl style="padding-left:10px;"> 
  66. * <dt><tt>amount</tt></dt> <dd>Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1] </dd> 
  67. * <dt><tt>description</tt></dt> <dd>Individual items of an invoice </dd> 
  68. * <dt><tt>quantity</tt></dt> <dd>Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999] </dd> 
  69. * <dt><tt>reference</tt></dt> <dd>User defined reference field. </dd> 
  70. * <dt><tt>tax</tt></dt> <dd>The tax ID of the tax charge in the invoice item. </dd></dl> 
  71. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i> 
  72. * @return InvoiceItem a InvoiceItem object. 
  73. */ 
  74. public function updateInvoiceItem($authentication = null) { 
  75.  
  76. $args = func_get_args(); 
  77. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); 
  78.  
  79. $object = Simplify_PaymentsApi::updateObject($this, $authentication); 
  80. return $object; 
  81.  
  82. /** 
  83. * @ignore 
  84. */ 
  85. public function getClazz() { 
  86. return "InvoiceItem";