Esempio n. 1
0
 /**
  * Creates an Simplify_InvoiceItem 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 invoice item (minor units). Example: 1000 = 10.00 <strong>required </strong></dd>
  *     <dt><tt>currency</tt></dt>    <dd>Currency code (ISO-4217) for the invoice item. Must match the currency associated with your account. <strong>required </strong><strong>default:USD</strong></dd>
  *     <dt><tt>description</tt></dt>    <dd>Individual items of an invoice </dd>
  *     <dt><tt>invoice</tt></dt>    <dd>Description of the invoice item <strong>required </strong></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    InvoiceItem a InvoiceItem object.
  */
 public static function createInvoiceItem($hash, $publicKey = null, $privateKey = null)
 {
     $instance = new Simplify_InvoiceItem();
     $instance->setAll($hash);
     $object = Simplify_PaymentsApi::createObject($instance, $publicKey, $privateKey);
     return $object;
 }
Esempio n. 2
0
 /**
  * Creates an Simplify_Coupon object
  * @param     array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;">
  *     <dt><tt>amountOff</tt></dt>    <dd>Amount off of the price of the product in the smallest units of the currency of the merchant. While this field is optional, you must provide either amountOff or percentOff for a coupon. Example: 100 = $1.00USD [min value: 1] </dd>
  *     <dt><tt>couponCode</tt></dt>    <dd>Code that identifies the coupon to be used. [min length: 2] <strong>required </strong></dd>
  *     <dt><tt>description</tt></dt>    <dd>A brief section that describes the coupon. </dd>
  *     <dt><tt>durationInMonths</tt></dt>    <dd>DEPRECATED - Duration in months that the coupon will be applied after it has first been selected. [min value: 1, max value: 9999] </dd>
  *     <dt><tt>endDate</tt></dt>    <dd>Last date of the coupon in UTC millis that the coupon can be applied to a subscription. This ends at 23:59:59 of the merchant timezone. </dd>
  *     <dt><tt>maxRedemptions</tt></dt>    <dd>Maximum number of redemptions allowed for the coupon. A redemption is defined as when the coupon is applied to the subscription for the first time. [min value: 1] </dd>
  *     <dt><tt>numTimesApplied</tt></dt>    <dd>The number of times a coupon will be applied on a customer's subscription. [min value: 1, max value: 9999] </dd>
  *     <dt><tt>percentOff</tt></dt>    <dd>Percentage off of the price of the product. While this field is optional, you must provide either amountOff or percentOff for a coupon. The percent off is a whole number. [min value: 1, max value: 100] </dd>
  *     <dt><tt>startDate</tt></dt>    <dd>First date of the coupon in UTC millis that the coupon can be applied to a subscription. This starts at midnight of the merchant timezone. <strong>required </strong></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    Coupon a Coupon object.
  */
 public static function createCoupon($hash, $authentication = null)
 {
     $args = func_get_args();
     $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2);
     $instance = new Simplify_Coupon();
     $instance->setAll($hash);
     $object = Simplify_PaymentsApi::createObject($instance, $authentication);
     return $object;
 }