Example #1
0
 /**
  * Creates an Simplify_Plan object
  * @param     array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;">
  *     <dt><tt>amount</tt></dt>    <dd>Amount of payment for the plan in minor units. Example: 1000 = 10.00 <strong>required </strong></dd>
  *     <dt><tt>currency</tt></dt>    <dd>Currency code (ISO-4217) for the plan. Must match the currency associated with your account. <strong>required </strong><strong>default:USD</strong></dd>
  *     <dt><tt>frequency</tt></dt>    <dd>Frequency of payment for the plan. Example: Monthly <strong>required </strong></dd>
  *     <dt><tt>name</tt></dt>    <dd>Name of the plan <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    Plan a Plan object.
  */
 public static function createPlan($hash, $publicKey = null, $privateKey = null)
 {
     $instance = new Simplify_Plan();
     $instance->setAll($hash);
     $object = Simplify_PaymentsApi::createObject($instance, $publicKey, $privateKey);
     return $object;
 }
Example #2
0
 /**
  * Creates an Simplify_Plan object
  * @param     array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;">
  *     <dt><tt>amount</tt></dt>    <dd>Amount of payment for the plan in minor units. Example: 1000 = 10.00 [min value: 50, max value: 99999999] <strong>required </strong></dd>
  *     <dt><tt>currency</tt></dt>    <dd>Currency code (ISO-4217) for the plan. Must match the currency associated with your account. [default: USD] <strong>required </strong></dd>
  *     <dt><tt>frequency</tt></dt>    <dd>Frequency of payment for the plan. Example: Monthly <strong>required </strong></dd>
  *     <dt><tt>name</tt></dt>    <dd>Name of the plan [max length: 50, min length: 2] <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    Plan a Plan object.
  */
 public static function createPlan($hash, $authentication = null)
 {
     $args = func_get_args();
     $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2);
     $instance = new Simplify_Plan();
     $instance->setAll($hash);
     $object = Simplify_PaymentsApi::createObject($instance, $authentication);
     return $object;
 }
Example #3
0
<?php

require_once "./lib/Simplify.php";
Simplify::$publicKey = 'sbpb_YmFhN2JmZTMtZDBkZi00MzA5LWI5M2EtYTBjNjlkNTE3ZTVm';
Simplify::$privateKey = 'Eu/MTPwWMsL97YuJ5XCI8oIW0Sl7uGskdUbY4VXsWsx5YFFQL0ODSXAOkNtXTToq';
$plan = Simplify_Plan::createPlan(array('amount' => '1000', 'renewalReminderLeadDays' => '7', 'name' => 'plan2', 'billingCycle' => 'FIXED', 'frequency' => 'WEEKLY', 'billingCycleLimit' => '4', 'frequencyPeriod' => '2'));
print_r($plan);
print_r($plan->id);
?>