當前位置: 首頁>>代碼示例>>PHP>>正文


PHP soapclient::AddAPACShippingPackage方法代碼示例

本文整理匯總了PHP中soapclient::AddAPACShippingPackage方法的典型用法代碼示例。如果您正苦於以下問題:PHP soapclient::AddAPACShippingPackage方法的具體用法?PHP soapclient::AddAPACShippingPackage怎麽用?PHP soapclient::AddAPACShippingPackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在soapclient的用法示例。


在下文中一共展示了soapclient::AddAPACShippingPackage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

     $goodsinfo['customsName'] = $hsinfo['customsName'];
     $customsNameEN = $hsinfo['customsNameEN'] ? $hsinfo['customsNameEN'] : $ebay_itemtitle;
     $customsName = $hsinfo['customsName'] ? $goodsinfo['customsName'] : $ebay_itemtitle;
     $DeclaredValue = 1;
     //不知從哪裏獲取,定義為1
     if (!in_array($ebay_itemid . '-' . $ebay_tid, $unique_item_tid)) {
         $unique_item_tid[] = $ebay_itemid . '-' . $ebay_tid;
         $item[] = array('CurrencyCode' => $ebay_currency, 'EBayEmail' => $ebay_usermail, 'EBayBuyerID' => $ebay_userid, 'EBayItemID' => $ebay_itemid, 'EBayItemTitle' => $ebay_itemtitle, 'EBayMessage' => '', 'EBaySiteID' => "0", 'EBayTransactionID' => $ebay_tid, 'Note' => '', 'OrderSalesRecordNumber' => $recordnumber, 'PaymentDate' => $ebay_paidtime, 'PayPalEmail' => "0", 'PayPalMessage' => '', 'PostedQTY' => $ebay_amount, 'ReceivedAmount' => $ebay_total, 'SalesRecordNumber' => $recordnumber, 'SoldDate' => $ebay_createdtime, 'SoldPrice' => $ebay_itemprice, 'SoldQTY' => $ebay_amount, 'SKU' => array('SKUID' => $sku, 'Weight' => $weight * $ebay_amount, 'CustomsTitleCN' => $customsName, 'CustomsTitleEN' => $customsNameEN . ' ' . $sku, 'DeclaredValue' => $DeclaredValue * $ebay_amount, 'OriginCountryName' => "China", 'OriginCountryCode' => "CN"));
     }
 }
 sort($item);
 //EUB異常訂單申請訂單,修改料號,沒有對應的物品交易號,不能申請跟蹤號問題解決
 $params = array('Version' => "3.0.0", 'APIDevUserID' => $APIDevUserID, 'APIPassword' => $APIPassword, 'APISellerUserID' => $APISellerUserID, 'MessageID' => "135625622432", "OrderDetail" => array("PickUpAddress" => $PickUpAddress, "ShipFromAddress" => $ShipFromAddress, "ShipToAddress" => $ShipToAddress, "ItemList" => array("Item" => $item), "EMSPickUpType" => $shiptype, "ReturnAddress" => $ReturnAddress));
 var_dump($params);
 try {
     $functions = @$soapclient->AddAPACShippingPackage(array("AddAPACShippingPackageRequest" => $params));
 } catch (Exception $e) {
     print $e->getMessage();
     continue;
 }
 var_dump($shipOrderId, $APIDevUserID, $functions);
 foreach ($functions as $aa) {
     $bb = (array) $aa;
     $ack = $bb['Ack'];
     if ($ack != 'Failure') {
         $TrackCode = $bb['TrackCode'];
         echo $TrackCode . "\n";
         $trackNumberData = array('tracknumber' => $TrackCode, 'shipOrderId' => $shipOrderId, 'createdTime' => time());
         if (!WhOrderTracknumberModel::insert($trackNumberData)) {
             echo $log .= "發貨單-{$shipOrderId}插入跟蹤號{$TrackCode}信息表失敗\n";
         }
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:wh_eub_tracknumber_ebay.php

示例2: isset


//.........這裏部分代碼省略.........
     		$skuInfo = $memc_obj->get_extral("sku_info_" . $sku);
     		$DeclaredValue = $skuInfo['goods_sbjz'] * $amount ? $skuInfo['goods_sbjz'] * $amount : 1; //申報價值
     		$Weight = $skuInfo['goods_weight'] * $amount ? $skuInfo['goods_weight'] * $amount : 0.01; //重量
     		$CustomsTitleCN = $skuInfo['goods_zysbmc'] ? $skuInfo['goods_zysbmc'] : $sku; //中文申報名稱
     		$CustomsTitleEN = $skuInfo['goods_ywsbmc'] ? $skuInfo['goods_ywsbmc'] : $sku; //英文申報名稱
     		$OriginCountryCode = 'CN'; //原產地簡碼
     		//echo "##".$EBayItemID."##";
     		/*if((!in_array($ebay_itemid.'-'.$ebay_tid, $unique_item_tid))){
     			$unique_item_tid[] = $ebay_itemid.'-'.$ebay_tid;
     			$item[$i]		= array(
     			'CurrencyCode' => $ebay_currency,
     			'EBayEmail' => $ebay_usermail,
     			'EBayBuyerID' => $ebay_userid,
     			'EBayItemID' => $ebay_itemid,
     			'EBayItemTitle' => $ebay_itemtitle,
     			'EBayMessage' => $ebay_note,
     			'EBaySiteID' => "0",
     			'EBayTransactionID' => $ebay_tid,  
     			'Note' => $ebay_noteb,  
     			'OrderSalesRecordNumber' => $recordnumber,
     			'PaymentDate' => $ebay_paidtime,
     			'PayPalEmail' => "0",
     			'PayPalMessage' => $ebay_note,
     			'PostedQTY' => $ebay_amount,
     			'ReceivedAmount' => $ebay_total,
     			'SalesRecordNumber' => $recordnumber1,
     			'SoldDate'			=> $ebay_createdtime,
     			'SoldPrice'			=> $ebay_itemprice,
     			'SoldQTY' 			=> $ebay_amount,
     			'SKU'				=>array(
     								'SKUID' => $sku,
     								'Weight' => $weight * $ebay_amount,
     								'CustomsTitleCN' => $goods_zysbmc,
     								'CustomsTitleEN' => $goods_ywsbmc.' '.$sku,
     								'DeclaredValue' => $goods_sbjz*$ebay_amount,
     								'OriginCountryName' => "China",
     								'OriginCountryCode' => "CN",
     								)
     			);
     		}*/
     $where = "WHERE omOrderId='{$omOrderId}'";
     $orderarr = OrderindexModel::showSearchOrderList("om_unshipped_order", $where);
     //print_r($orderarr);
     $unique_item_tid = array();
     foreach ($orderarr as $key => $order) {
         foreach ($order['orderDetail'] as $k => $detail) {
             $sku = $detail['orderDetailData']['sku'];
             $amount = $detail['orderDetailData']['amount'];
             //$goods = ExportsToXlsModel::getGoods($detail['orderDetailData']['sku']);
             $skus = GoodsModel::get_realskuinfo($detail['orderDetailData']['sku']);
             foreach ($skus as $k => $v) {
                 $goods = GoodsModel::getSkuList($k);
                 if (!in_array($detail['orderDetailExtenData']['itemId'] . '-' . $detail['orderDetailExtenData']['transId'], $unique_item_tid)) {
                     $unique_item_tid[] = $detail['orderDetailExtenData']['itemId'] . '-' . $detail['orderDetailExtenData']['transId'];
                     $Item[] = array('EBayBuyerID' => $order['orderUserInfoData']['platformUsername'], 'EBayItemID' => $detail['orderDetailExtenData']['itemId'], 'EBayEmail' => $order['orderUserInfoData']['email'], 'EBayTransactionID' => $detail['orderDetailExtenData']['transId'], 'PostedQTY' => $detail['orderDetailData']['amount'], 'EBaySiteID' => "0", 'PayPalEmail' => "0", 'EBayItemTitle' => $detail['orderDetailExtenData']['itemTitle'], 'OrderSalesRecordNumber' => $order['orderData']['recordNumber'], 'EBayMessage' => $order['orderExtenData']['feedback'], 'CurrencyCode' => $order['orderExtenData']['currency'], 'SoldDate' => date("Y-m-d", $order['orderData']['ordersTime']), 'SoldPrice' => $detail['orderDetailData']['itemPrice'], 'SoldQTY' => $detail['orderDetailData']['amount'], 'ReceivedAmount' => $order['orderData']['actualTotal'], 'PayPalMessage' => $order['orderExtenData']['feedback'], 'PaymentDate' => date("Y-m-d", $order['orderData']['paymentTime']), 'SalesRecordNumber' => $order['orderData']['recordNumber'], 'Note' => isset($order['orderNote'][0]['content']) ? $order['orderNote'][0]['content'] : "", 'SKU' => array('SKUID' => $detail['orderDetailData']['sku'], 'Weight' => $goods['goodsWeight'] * $amount * $v, 'CustomsTitleCN' => $goods['goodsName'], 'CustomsTitleEN' => $sku, 'DeclaredValue' => $detail['orderDetailData']['itemPrice'] * $amount * $v, 'OriginCountryName' => "China", 'OriginCountryCode' => "CN"));
                 }
             }
         }
     }
     $url_test = "http://epacketws.pushauction.net/v3/orderservice.asmx?WSDL";
     $url = "http://shippingapi.ebay.cn/production/v3/orderservice.asmx?wsdl";
     $soapclient = new soapclient($url);
     $params = array('Version' => "3.0.0", 'APIDevUserID' => $APIDevUserID, 'APIPassword' => $APIPassword, 'APISellerUserID' => $APISellerUserID, "OrderDetail" => array("PickUpAddress" => $PickUpAddress, "ShipFromAddress" => $ShipFromAddress, "ShipToAddress" => $ShipToAddress, "ItemList" => array("Item" => $Item), "EMSPickUpType" => $shiptype, "ReturnAddress" => $ReturnAddress));
     try {
         //print_r($params);
         $functions = $soapclient->AddAPACShippingPackage(array("AddAPACShippingPackageRequest" => $params));
         //echo "dfg";
         foreach ($functions as $value) {
             $bb = (array) $value;
             $ack = $bb['Ack'];
             if ($ack == 'Success') {
                 $TrackCode = $bb['TrackCode'];
                 //這裏插入記錄到records表中
                 $tName = 'om_order_tracknumber';
                 $set = "SET omOrderId='{$omOrderId}',addUser='{$addUser}',tracknumber='{$TrackCode}',createdTime='" . time() . "'";
                 $affectRow = OmAvailableModel::insertRow($tName, $set);
                 if ($affectRow) {
                     self::$errCode = '200';
                     self::$errMsg = "success";
                     return 200;
                 } else {
                     self::$errCode = '0011';
                     self::$errMsg = "添加跟蹤號失敗";
                     return 11;
                 }
             } else {
                 $tName = 'om_order_notes';
                 $set = "SET omOrderId='{$omOrderId}',content='{$bb['Message']}',userId='{$addUser}',createdTime='" . time() . "'";
                 $affectRow = OmAvailableModel::insertRow($tName, $set);
                 self::$errCode = '0012';
                 self::$errMsg = $bb['Message'];
                 return 12;
             }
         }
     } catch (Exception $e) {
         self::$errCode = '0013';
         self::$errMsg = $e->getMessage();
         return 0;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:101,代碼來源:omEUBTrackNumber.action.php


注:本文中的soapclient::AddAPACShippingPackage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。