Ejemplo n.º 1
0
 public function confirmShipping()
 {
     $uname = $this->input->get('user');
     $passwd = $this->input->get('pass');
     $order_ref = $this->input->get('order_reference');
     $orderstatus = $this->input->get('status');
     $orderstatus = 4;
     $authDetails = $this->invoice->_verifyCredentials($uname, $passwd, PAY_TYPE_BOOKSTORE);
     if (!empty($authDetails)) {
         if ($orderstatus > 0 && $orderstatus != "") {
             if ($this->search->checkOrder_Reference($order_ref)) {
                 $cur_status = $this->search->getSingleVal('ps_orders', 'current_state', array('reference' => $order_ref));
                 if (!$cur_status) {
                     $response = array('response' => 'shipped', 'message' => 'Order status has been changed');
                 } else {
                     $response = array('response' => 'already_shipped', 'message' => 'Order already has been shipped');
                 }
             } else {
                 $response = array('response' => 'reference_error', 'message' => 'Order Reference number does not exist');
             }
         } else {
             $response = array('response' => 'shipping_status_error', 'message' => 'Please provide the shipping status');
             // write message to the log file
             $this->errorlog->lwrite('You can not left the shipping status blank');
         }
     } else {
         $response = array('response' => 'user_not_found', 'message' => 'Username/password may be wrong.');
         // write message to the log file
         $this->errorlog->lwrite('An error occurred while trying to authenticate your account with username='******' and password='******'');
     }
     xml_viewpage($response);
 }
Ejemplo n.º 2
0
 public function reverse()
 {
     //get the parameters from url
     $caseId = $this->input->get('IdCaja');
     $origin_Guid = $this->input->get('GuidOrigen');
     $cancelGuid = $this->input->get('GuidDetalleAnular');
     $type = $this->input->get('Tipo');
     $reason = $this->input->get('Motivo');
     $order_detail = $this->search->getPaymentDetail($cancelGuid);
     if ($order_detail) {
         $invoice_num = $order_detail[0]['invoice_number'];
         $id = $order_detail[0]['id'];
         $update_date = date("Y-m-d H:i:s");
         $this->search->updateOrderDetail($invoice_num, $update_date);
         //update lms cancel status
         $this->search->updateLmsCancelStatus($cancelGuid, $type, $reason, $invoice_num, $id, $caseId, $origin_Guid);
         $invoiceDetails = array('CodRespuesta' => '100', 'DescRespuesta' => 'Cancellation successfully done.', 'GuidOrigen' => $origin_Guid, 'DetalleAnulacion' => 'ZZZZZZZZZZZZZ');
     } else {
         $invoiceDetails = array('CodRespuesta' => '101', 'DescRespuesta' => 'Transaction cancellation process has been failed');
         // write message to the log file
         $this->errorlog->lwrite('Transaction cancellation process has been failed');
     }
     //converts array into xml
     xml_viewpage($invoiceDetails);
 }