function submitshipmenttojet($oid, $jsondata) { require_once 'HTTP/Request2.php'; require_once 'AuthAPI.php'; require_once 'OrdersAPI.php'; //$LINE_BREAK = "\r\n"; $LINE_BREAK = "<BR>"; $authobj = new AuthAPI(); $authinfo = new AuthInfo(); $authinfo = $authobj->GetToken(); $authobj->VerifyToken($authinfo); $orderobj = new OrdersAPI(); $result = $orderobj->PutOrderShipment($authinfo, $oid, $jsondata); $strret = ""; if (strlen($result) > 0) { $strret = $strret . "Shipment Error for Order : " . $oid . $LINE_BREAK; $strret = $strret . "Error is : " . $result . $LINE_BREAK; } else { $strret = $strret . "Shipment Order Success " . $LINE_BREAK; } return $strret; }
<?php require_once 'HTTP/Request2.php'; require_once 'AuthAPI.php'; require_once 'TaxonomyAPI.php'; require_once 'ProductAPI.php'; require_once 'OrdersAPI.php'; require_once 'ReturnAPI.php'; //$DELIM = "\r\n"; $DELIM = ","; $MULTIVAL_DELIM = ";"; $NEW_LINE = "\n"; $authobj = new AuthAPI(); $authinfo = new AuthInfo(); $authinfo = $authobj->GetToken(); $authobj->VerifyToken($authinfo); $taxobj = new TaxonomyAPI(); $productobj = new ProductAPI(); $returnobj = new ReturnAPI(); function Convert2Date($datestr) { if (empty($datestr)) { return ""; } date_default_timezone_set('America/New_York'); $dt = new DateTime($datestr); return $dt->format('Y-m-d'); } function SafeGetProperty($obj, $property) { if (property_exists($obj, $property)) { return $obj->{$property};
// "No Content" status } private function deleteType() { if ($this->get_request_method() != "DELETE") { $this->response('', 406); } $id = (int) $this->_request['id']; if ($id > 0) { $query = "DELETE FROM tblagenttype WHERE typeID = {$id}"; $r = $this->mysqli->query($query) or die($this->mysqli->error . __LINE__); $success = array('status' => "Success", "msg" => "Successfully deleted one record."); $this->response($this->json($success), 200); } else { $this->response('', 204); } // If no records "No Content" status } /* * Encode array into JSON */ private function json($data) { if (is_array($data)) { return json_encode($data); } } } // Initiiate Library $api = new AuthAPI(); $api->processApi();