function getOrderStatusFromPlex($plexOrderId)
{
    $plexServiceRequestObject = new plexServiceRequest();
    $responseHandlerObject = new ResponseHandler();
    $paramArray = array(array('Name' => 'Customer_Code', 'Value' => '', 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Email_Address', 'Value' => '', 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Order_No', 'Value' => $plexOrderId, 'Required' => 'false', 'Output' => 'false'));
    $rawResponse = $plexServiceRequestObject->call('ExecuteDataSource', PLEX_GET_ORDER_STATUS, $paramArray);
    return $responseHandlerObject->getOrderStatusFromRawResponse($rawResponse);
}
Example #2
0
 private function addProductwithPlexOrder($plexOrderId, $orderObject, $Part_No, $Price, $Quantity)
 {
     try {
         $plexServiceRequestObject = new plexServiceRequest();
         $responseHandlerObject = new ResponseHandler();
         $plexuserUserId = 'PWPU' . str_pad($orderObject->get_user_id(), 6, '0', STR_PAD_LEFT);
         /*request parameter*/
         $paramArray = array(array('Name' => 'Customer_Code', 'Value' => $plexuserUserId, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Order_No', 'Value' => $plexOrderId, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Part_No', 'Value' => $Part_No, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Price', 'Value' => $Price, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Quantity', 'Value' => $Quantity, 'Required' => 'false', 'Output' => 'false'));
         /* adding product to plex order*/
         $rawResponse = $plexServiceRequestObject->call('ExecuteDataSource', PLEX_WRITE_NEW_ORDER_LINE, $paramArray);
         // echo '<pre>';
         // print_r($rawResponse);
         // echo '</pre>';
         return $rawResponse->ExecuteDataSourceResult->Message;
     } catch (Exception $exec) {
         PlexLog::addLog(' Error =>(' . $customerId . ') Exception occure while addProductwithPlexOrder. Message :' . $exec->getMessage());
         return '';
     }
 }
Example #3
0
 public function getShippingAddress($customerId)
 {
     try {
         $plexServiceRequestObject = new plexServiceRequest();
         $responseHandlerObject = new ResponseHandler();
         $plexuserUserId = 'PWPU' . str_pad($customerId, 6, '0', STR_PAD_LEFT);
         $user_info = get_userdata($customerId);
         $paramArray = array(array('Name' => 'Customer_Code', 'Value' => $plexuserUserId, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Ship_To', 'Value' => 1, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Email', 'Value' => $user_info->data->user_email, 'Required' => 'false', 'Output' => 'false'), array('Name' => 'Phone', 'Value' => get_user_meta($customerId, 'billing_phone', true), 'Required' => 'false', 'Output' => 'false'));
         $rawResponse = $plexServiceRequestObject->call('ExecuteDataSource', PLEX_GET_SHIP_TO_BILL_TO_ADDRESS, $paramArray);
         $ret = $responseHandlerObject->getCustomerAddressResponse($rawResponse);
         return $ret;
     } catch (Exception $exec) {
         PlexLog::addLog(' Error =>(' . $customerId . ') Exception occure while reading shipping address. Message :' . $exec->getMessage());
         return array();
     }
 }