public function gateways($slug) { $gateway = Payment_gateways::findOneBySlug($slug); $this->throwModelNotFoundException($gateway); if ($this->isRequestMethod('post')) { $data = $this->getRequest()->request->get('gateway'); if (empty($data['enable'])) { $data['enable'] = 0; } $gateway->handleData($data); if ($gateway->save()) { $this->addFlash(lang('gateway_update_success'), 'success'); redirect(current_url()); } $this->addFlash($gateway->errors->string); } $this->template->set('gateway', $gateway); $this->template->render(); }
public function gateway($gateway) { $gateway = Payment_gateways::findOneBySlug($gateway); $transactionManager = $this->get('core.payment.transactions.manager'); $transaction = $transactionManager->createForSubscription(array('amount' => 1000, 'description' => 'test 111'), $this->getUser(), $gateway); echo $transaction->id; }