Simplify_Tax

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/Tax.php  
  1. class Simplify_Tax extends Simplify_Object { 
  2. /** 
  3. * Creates an Simplify_Tax object 
  4. * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  5. * <dt><tt>label</tt></dt> <dd>The label of the tax object. [max length: 255] <strong>required </strong></dd> 
  6. * <dt><tt>rate</tt></dt> <dd>The tax rate. Decimal value up three decimal places. e.g 12.501. [max length: 6] <strong>required </strong></dd></dl> 
  7. * @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/> 
  8. * @return Tax a Tax object. 
  9. */ 
  10. static public function createTax($hash, $authentication = null) { 
  11.  
  12. $args = func_get_args(); 
  13. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  14.  
  15. $instance = new Simplify_Tax(); 
  16. $instance->setAll($hash); 
  17.  
  18. $object = Simplify_PaymentsApi::createObject($instance, $authentication); 
  19. return $object; 
  20.  
  21.  
  22.  
  23.  
  24. /** 
  25. * Deletes an Simplify_Tax object. 
  26. * @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> 
  27. */ 
  28. public function deleteTax($authentication = null) { 
  29.  
  30. $args = func_get_args(); 
  31. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); 
  32.  
  33. $obj = Simplify_PaymentsApi::deleteObject($this, $authentication); 
  34. $this->properties = null; 
  35. return true; 
  36.  
  37.  
  38. /** 
  39. * Retrieve Simplify_Tax objects. 
  40. * @param array criteria a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  41. * <dt><tt>filter</tt></dt> <dd>Filters to apply to the list. </dd> 
  42. * <dt><tt>max</tt></dt> <dd>Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20] </dd> 
  43. * <dt><tt>offset</tt></dt> <dd>Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0] </dd> 
  44. * <dt><tt>sorting</tt></dt> <dd>Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either <tt>asc</tt> for ascending or <tt>desc</tt> for descending). Sortable properties are: <tt> id</tt><tt> label</tt>.</dd></dl> 
  45. * @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> 
  46. * @return ResourceList a ResourceList object that holds the list of Tax objects and the total 
  47. * number of Tax objects available for the given criteria. 
  48. * @see ResourceList 
  49. */ 
  50. static public function listTax($criteria = null, $authentication = null) { 
  51.  
  52. $args = func_get_args(); 
  53. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  54.  
  55. $val = new Simplify_Tax(); 
  56. $list = Simplify_PaymentsApi::listObject($val, $criteria, $authentication); 
  57.  
  58. return $list; 
  59.  
  60.  
  61. /** 
  62. * Retrieve a Simplify_Tax object from the API 
  63. * @param string id the id of the Tax object to retrieve 
  64. * @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> 
  65. * @return Tax a Tax object 
  66. */ 
  67. static public function findTax($id, $authentication = null) { 
  68.  
  69. $args = func_get_args(); 
  70. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  71.  
  72. $val = new Simplify_Tax(); 
  73. $val->id = $id; 
  74.  
  75. $obj = Simplify_PaymentsApi::findObject($val, $authentication); 
  76.  
  77. return $obj; 
  78.  
  79. /** 
  80. * @ignore 
  81. */ 
  82. public function getClazz() { 
  83. return "Tax";