Simplify_Refund

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/Refund.php  
  1. class Simplify_Refund extends Simplify_Object { 
  2. /** 
  3. * Creates an Simplify_Refund 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 refund in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1] <strong>required </strong></dd> 
  6. * <dt><tt>payment</tt></dt> <dd>ID of the payment for the refund <strong>required </strong></dd> 
  7. * <dt><tt>reason</tt></dt> <dd>Reason for the refund </dd> 
  8. * <dt><tt>reference</tt></dt> <dd>Custom reference field to be used with outside systems. </dd> 
  9. * <dt><tt>replayId</tt></dt> <dd>An identifier that can be sent to uniquely identify a refund request to facilitate retries due to I/O related issues. This identifier must be unique for your account (sandbox or live) across all of your refunds. If supplied, we will check for a refund on your account that matches this identifier. If found we will return an identical response to that of the original request. [max length: 50, min length: 1] </dd> 
  10. * <dt><tt>statementDescription.name</tt></dt> <dd>Merchant name. <strong>required </strong></dd> 
  11. * <dt><tt>statementDescription.phoneNumber</tt></dt> <dd>Merchant contact phone number. </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 Refund a Refund object. 
  14. */ 
  15. static public function createRefund($hash, $authentication = null) { 
  16.  
  17. $args = func_get_args(); 
  18. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  19.  
  20. $instance = new Simplify_Refund(); 
  21. $instance->setAll($hash); 
  22.  
  23. $object = Simplify_PaymentsApi::createObject($instance, $authentication); 
  24. return $object; 
  25.  
  26.  
  27.  
  28. /** 
  29. * Retrieve Simplify_Refund objects. 
  30. * @param array criteria a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  31. * <dt><tt>filter</tt></dt> <dd>Filters to apply to the list. </dd> 
  32. * <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> 
  33. * <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> 
  34. * <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> amount</tt><tt> description</tt><tt> dateCreated</tt><tt> paymentDate</tt>.</dd></dl> 
  35. * @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> 
  36. * @return ResourceList a ResourceList object that holds the list of Refund objects and the total 
  37. * number of Refund objects available for the given criteria. 
  38. * @see ResourceList 
  39. */ 
  40. static public function listRefund($criteria = null, $authentication = null) { 
  41.  
  42. $args = func_get_args(); 
  43. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  44.  
  45. $val = new Simplify_Refund(); 
  46. $list = Simplify_PaymentsApi::listObject($val, $criteria, $authentication); 
  47.  
  48. return $list; 
  49.  
  50.  
  51. /** 
  52. * Retrieve a Simplify_Refund object from the API 
  53. * @param string id the id of the Refund object to retrieve 
  54. * @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> 
  55. * @return Refund a Refund object 
  56. */ 
  57. static public function findRefund($id, $authentication = null) { 
  58.  
  59. $args = func_get_args(); 
  60. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  61.  
  62. $val = new Simplify_Refund(); 
  63. $val->id = $id; 
  64.  
  65. $obj = Simplify_PaymentsApi::findObject($val, $authentication); 
  66.  
  67. return $obj; 
  68.  
  69. /** 
  70. * @ignore 
  71. */ 
  72. public function getClazz() { 
  73. return "Refund";