コード例 #1
0
ファイル: GetUser.php プロジェクト: dewawi/dewawi
$session->token = $token;
$session->site = 0;
// 0 = US;
$session->location = $location;
// Make a GetUser API call and print results
try {
    $client = new eBaySOAP($session);
    // Default value is to use the user in the Auth & Auth token
    $params = array('Version' => $compatibilityLevel);
    $results = $client->GetUser($params);
    print "<pre> \n";
    print_r($results->User);
    print "</pre> \n";
    print "<p>---\n";
    // Or you can specify a UserID
    $UserID = 'ebay_user_name';
    $params = array('Version' => $compatibilityLevel, 'UserID' => $UserID);
    $results = $client->GetUser($params);
    print "<pre> \n";
    print_r($results->User);
    print "</pre> \n";
} catch (SOAPFault $f) {
    print $f;
    // error handling
}
// Uncomment below to view SOAP envelopes
print "<pre> \n";
print "Request: \n" . $client->__getLastRequest() . "\n";
print "----- \n";
print "Response: \n" . $client->__getLastResponse() . "\n";
print "</pre> \n";
コード例 #2
0
ファイル: Shipment.php プロジェクト: heshuai64/ebo
 private function CompleteSale($token, $transactionId, $itemId, $shipmentMethod, $shippedOn, $postalReferenceNo)
 {
     global $argv;
     $session = $this->configEbay($token);
     try {
         $client = new eBaySOAP($session);
         /*
         if(!empty($postalReferenceNo)){
         	switch ($shipmentMethod){
         		case "M":
         			$ShippingCarrierUsed = "UPS";
         			break;
         			
         		case "U":
         			$ShippingCarrierUsed = "UPS";
         			break;
         			
         		default:
         			$ShippingCarrierUsed = "Other";
         		break;
         	}
         	$Shipment = array("ShipmentTrackingNumber"=>$postalReferenceNo, "ShippedTime"=>$shippedOn, "ShippingCarrierUsed"=>$ShippingCarrierUsed);
         	$params = array("Version"=>"607", "ItemID"=>$itemId, "Paid"=> true, "Shipment"=>$Shipment, "Shipped"=>true, "TransactionID"=>$transactionId);
         	print_r($params);
         	$results = $client->CompleteSale($params);
         }else{
         	$params = array("Version"=>"607", "ItemID"=>$itemId, "Paid"=> true, "Shipped"=>true, "TransactionID"=>$transactionId);
         	print_r($params);
         	$results = $client->CompleteSale($params);
         }
         */
         $tmp = strtotime($shippedOn);
         $shippedOn = date("Y-m-d\\TH:i:s.000\\Z", $tmp - 8 * 60 * 60);
         $Shipment = array("ShippedTime" => $shippedOn);
         $params = array("Version" => "607", "ItemID" => $itemId, "Paid" => true, "Shipment" => $Shipment, "Shipped" => true, "TransactionID" => $transactionId);
         $this->log("synceBayShipped", print_r($params, true));
         $results = $client->CompleteSale($params);
         if ($argv[3] == "debug") {
             print_r($results);
             file_put_contents($this->config['log']['shipments'] . "CompleteSale_Request.xml", $client->__getLastRequest());
             file_put_contents($this->config['log']['shipments'] . "CompleteSale_Response.xml", $client->__getLastResponse());
         }
         if (!empty($results->Ack) && $results->Ack == "Success") {
             $this->log("synceBayShipped", "Success");
             $this->updateEbayShipStatus($transactionId, $itemId, 1);
         } else {
             /*
             		    if(!empty($results->Errors)){
                 print_r($results->Errors);
             		    }else{
             			echo $results->faultstring;
             		    }
             */
             @$this->log("synceBayShipped", "Error:" . $results->Errors->LongMessage);
             $this->updateEbayShipStatus($transactionId, $itemId, 2);
         }
         //exit;
         //sleep(1);
     } catch (SOAPFault $f) {
         print $f;
         // error handling
     }
 }
コード例 #3
0
ファイル: ebay.php プロジェクト: heshuai64/ebo
 private function endItem($item)
 {
     $sql = "select id from site where name = '" . $item['Site'] . "'";
     $result = mysql_query($sql);
     $row = mysql_fetch_assoc($result);
     $this->configEbay($row['id']);
     try {
         $client = new eBaySOAP($this->session);
         $Version = $this->version;
         $params = array('Version' => $Version, 'ItemID' => $item['ItemID'], 'EndingReason' => 'NotAvailable');
         $results = $client->EndItem($params);
         if (!empty($results->Errors)) {
             $this->parseEbayResponse("end", $item, $results);
         } elseif ($results->Ack == "Success") {
             $sql_2 = "update items set Status = 9,EndTime = '" . $results->EndTime . "' where Id = '" . $item['Id'] . "'";
             echo $sql_2 . "<br>";
             $result_2 = mysql_query($sql_2);
         }
         $this->saveFetchData("endItem-Request-" . date("YmdHis") . ".xml", $client->__getLastRequest());
         $this->saveFetchData("endItem-Response-" . date("YmdHis") . ".xml", $client->__getLastResponse());
     } catch (SOAPFault $f) {
         print $f;
         // error handling
     }
 }