Пример #1
0
 /**
  * Create a transaction record and return it. 
  * @param int $user_id
  * @param string $user_email
  * @param WpPlan $plan
  * @param string $type
  * @return array TMR as array
  */
 private static function createTMR($user_id, $user_email, $plan, $type)
 {
     $price = $plan->getPrice();
     $tmr = array('tmr_type' => $type, 'tmr_user_id' => $user_id, 'tmr_mail' => $user_email, 'tmr_ip' => IP::sanitizeIP(wfGetIP()), 'tmr_amount' => -$price['amount'], 'tmr_currency' => $price['currency'], 'tmr_desc' => 'wpp-' . $plan->getName(), 'tmr_status' => 'PE');
     wfRunHooks('CreateTransaction', array(&$tmr));
     return $tmr;
 }