/** * 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; }
/** * 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; }