Simplify_Webhook

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/Webhook.php  
  1. class Simplify_Webhook extends Simplify_Object { 
  2. /** 
  3. * Creates an Simplify_Webhook object 
  4. * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  5. * <dt><tt>url</tt></dt> <dd>Endpoint URL <strong>required </strong></dd></dl> 
  6. * @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/> 
  7. * @return Webhook a Webhook object. 
  8. */ 
  9. static public function createWebhook($hash, $authentication = null) { 
  10.  
  11. $args = func_get_args(); 
  12. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  13.  
  14. $instance = new Simplify_Webhook(); 
  15. $instance->setAll($hash); 
  16.  
  17. $object = Simplify_PaymentsApi::createObject($instance, $authentication); 
  18. return $object; 
  19.  
  20.  
  21.  
  22.  
  23. /** 
  24. * Deletes an Simplify_Webhook object. 
  25. * @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> 
  26. */ 
  27. public function deleteWebhook($authentication = null) { 
  28.  
  29. $args = func_get_args(); 
  30. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); 
  31.  
  32. $obj = Simplify_PaymentsApi::deleteObject($this, $authentication); 
  33. $this->properties = null; 
  34. return true; 
  35.  
  36.  
  37. /** 
  38. * Retrieve Simplify_Webhook objects. 
  39. * @param array criteria a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  40. * <dt><tt>filter</tt></dt> <dd>Filters to apply to the list. </dd> 
  41. * <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> 
  42. * <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> 
  43. * <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> dateCreated</tt>.</dd></dl> 
  44. * @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> 
  45. * @return ResourceList a ResourceList object that holds the list of Webhook objects and the total 
  46. * number of Webhook objects available for the given criteria. 
  47. * @see ResourceList 
  48. */ 
  49. static public function listWebhook($criteria = null, $authentication = null) { 
  50.  
  51. $args = func_get_args(); 
  52. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  53.  
  54. $val = new Simplify_Webhook(); 
  55. $list = Simplify_PaymentsApi::listObject($val, $criteria, $authentication); 
  56.  
  57. return $list; 
  58.  
  59.  
  60. /** 
  61. * Retrieve a Simplify_Webhook object from the API 
  62. * @param string id the id of the Webhook object to retrieve 
  63. * @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> 
  64. * @return Webhook a Webhook object 
  65. */ 
  66. static public function findWebhook($id, $authentication = null) { 
  67.  
  68. $args = func_get_args(); 
  69. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  70.  
  71. $val = new Simplify_Webhook(); 
  72. $val->id = $id; 
  73.  
  74. $obj = Simplify_PaymentsApi::findObject($val, $authentication); 
  75.  
  76. return $obj; 
  77.  
  78.  
  79. /** 
  80. * Updates an Simplify_Webhook object. 
  81. * The properties that can be updated: 
  82. * <dl style="padding-left:10px;"> 
  83. * <dt><tt>url</tt></dt> <dd>Endpoint URL <strong>required </strong></dd></dl> 
  84. * @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> 
  85. * @return Webhook a Webhook object. 
  86. */ 
  87. public function updateWebhook($authentication = null) { 
  88.  
  89. $args = func_get_args(); 
  90. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); 
  91.  
  92. $object = Simplify_PaymentsApi::updateObject($this, $authentication); 
  93. return $object; 
  94.  
  95. /** 
  96. * @ignore 
  97. */ 
  98. public function getClazz() { 
  99. return "Webhook";