function readItem($item_id) { $item = new PaymentItem($this->dbcon, $item_id); if (!isset($item->id)) { return false; } $this->item_record['description'] = $item->getData('description'); $this->item_record['Amount'] = sprintf($item->currency_format, $item->getData('Amount')); }
/** * @param array $attributes * @return PaymentItem */ public function addItem($attributes) { $item = new PaymentItem(); $item->attributes = $attributes; $item->transactionId = $this->id; if (!$item->save()) { throw new CException(sprintf('Failed to add item to transaction #%d.', $this->id)); } return $item; }