/** * Creates an Simplify_Refund object * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> * <dt><tt>amount</tt></dt> <dd>Amount of the refund in minor units. Example: 1000 = 10.00 <strong>required </strong></dd> * <dt><tt>payment</tt></dt> <dd>ID of the payment for the refund <strong>required </strong></dd> * <dt><tt>reason</tt></dt> <dd>Reason for the refund </dd></dl> * @param string publicKey Public key. If null, the value of static Simplify::$publicKey will be used * @param string privateKey Private key. If null, the value of static Simplify::$privateKey will be used * @return Refund a Refund object. */ public static function createRefund($hash, $publicKey = null, $privateKey = null) { $instance = new Simplify_Refund(); $instance->setAll($hash); $object = Simplify_PaymentsApi::createObject($instance, $publicKey, $privateKey); return $object; }
/** * Creates an Simplify_Refund object * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> * <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> * <dt><tt>payment</tt></dt> <dd>ID of the payment for the refund <strong>required </strong></dd> * <dt><tt>reason</tt></dt> <dd>Reason for the refund </dd> * <dt><tt>reference</tt></dt> <dd>Custom reference field to be used with outside systems. </dd> * <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> * <dt><tt>statementDescription.name</tt></dt> <dd>Merchant name. <strong>required </strong></dd> * <dt><tt>statementDescription.phoneNumber</tt></dt> <dd>Merchant contact phone number. </dd></dl> * @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/> * @return Refund a Refund object. */ public static function createRefund($hash, $authentication = null) { $args = func_get_args(); $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); $instance = new Simplify_Refund(); $instance->setAll($hash); $object = Simplify_PaymentsApi::createObject($instance, $authentication); return $object; }