Ejemplo n.º 1
0
 public function paymestatus()
 {
     $data = $this->data;
     $data['title'] = 'Payme Test';
     $this->load->model('payme_model');
     $result = $this->payme_model->GetActiveTransactions();
     foreach ($result as $transaction) {
         $data['testdata'][] = PayMe::GetTransactionStatus($transaction['transid'], $transaction['hash']);
     }
     $this->load->template('test/index', $data);
 }
Ejemplo n.º 2
0
 public function pay($id)
 {
     $data = $this->data;
     $data['title'] = 'Payment';
     if ($this->input->server('REQUEST_METHOD') == 'POST') {
         $this->load->model('Payme_model');
         /* Start transaction */
         $amount = $this->Webshop_model->GetOrderTotal($id);
         $bankID = $this->input->post('bank');
         $purchaseID = $id;
         $description = 'Uw order bij Mos OrderNo ' . $id;
         $returnURL = 'http://tmtl-06.ict-lab.nl/store/status/' . $id;
         $failURL = 'http://tmtl-06.ict-lab.nl/store/cancel/' . $id;
         $data = PayMe::StartTransaction($amount, $bankID, $purchaseID, $description, $returnURL, $failURL);
         $this->Payme_model->SaveTransaction($data['transid'], $data['sha1']);
         if ($this->Webshop_model->AddTransaction($id, $data['transid'])) {
             redirect($data['fwdurl']);
         } else {
             exit('Something went seriously wrong');
         }
     } else {
         /* Display orderdetails */
         $orderDetails = $this->Webshop_model->GetOrderDetails($id);
         $total = $this->Webshop_model->GetOrderTotal($id);
         $data['orderDetails'] = $orderDetails;
         $data['orderDetails']['total'] = $total;
         $data['payme']['banklist'] = PayMe::GetBankList();
         $this->load->template('store/payment', $data);
     }
 }