Ejemplo n.º 1
0
 public function depositFormAction()
 {
     $this->view->order_info = Model_Deposit::getDeposit(JO_Session::get('deposit_id'));
     if (!$this->view->order_info) {
         return;
     }
     $this->view->currency = WM_Currency::getCurrency();
     if (JO_Registry::forceGet('paypal_sandbox_mode')) {
         $this->view->url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
     } else {
         $this->view->url = 'https://www.paypal.com/cgi-bin/webscr';
     }
     $this->view->paypal_email = JO_Registry::forceGet('paypal_email');
     $this->view->return = WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=users&action=success_deposit');
     $this->view->notify_url = WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=payments_paypal&action=callback_deposit');
     $this->view->cancel_return = WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=users&action=deposit');
     $this->view->email = JO_Session::get('email');
     $this->view->first_name = JO_Session::get('firstname');
     $this->view->last_name = JO_Session::get('lastname');
 }
Ejemplo n.º 2
0
 public function success_depositAction()
 {
     $this->noViewRenderer(true);
     $request = $this->getRequest();
     $info = Model_Deposit::getDeposit(JO_Session::get('deposit_id'));
     if ($info && $info['paid'] == 'true') {
         Model_Deposit::depositIsPay($info['id']);
         JO_Session::set('msg_success', $this->translate('You have successfully made a deposit!'));
     } else {
         JO_Session::clear('deposit_id');
         JO_Session::set('msg_error', $this->translate('Your payment have status ' . WM_Orderstatuses::orderStatuses($info['order_status_id'])));
     }
     $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=deposit'));
 }