これは、現時点で WP eCommerce で利用できる唯一の方法です。
UPS から配送料を取得する以外のことを行う WP プラグインを知りません。配送ダイジェストを生成し、UPS に送信して配送ラベルを取得できるカスタム プラグインを誰かに作成してもらう必要があります。
このようなプラグインを作成するために開始できるコードを次に示します。
$xmlRequest1='<?xml version="1.0" encoding="ISO-8859-1"?>
<AccessRequest>
<AccessLicenseNumber>ACCESS LICENCE NUMBER</AccessLicenseNumber>
<UserId>UPS USERNAME</UserId>
<Password>UPS PASSWORD</Password>
</AccessRequest>
<?xml version="1.0" encoding="ISO-8859-1"?>
<ShipmentAcceptRequest>
<Request>
<TransactionReference>
<CustomerContext>Customer Comment</CustomerContext>
</TransactionReference>
<RequestAction>ShipAccept</RequestAction>
<RequestOption>1</RequestOption>
</Request>
<ShipmentDigest>SHIPMENT DIGEST</ShipmentDigest>
</ShipmentAcceptRequest>
';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://wwwcie.ups.com/ups.app/xml/ShipAccept");
// uncomment the next line if you get curl error 60: error setting certificate verify locations
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3600);
//if ($this->logfile) {
// error_log("UPS REQUEST: " . $xmlRequest . "\n", 3, $this->logfile);
//}
$xmlResponse = curl_exec ($ch); // SHIP ACCEPT RESPONSE
//echo curl_errno($ch);
$xml = $xmlResponse;
preg_match_all( "/\<ShipmentAcceptResponse\>(.*?)\<\/ShipmentAcceptResponse\>/s",
$xml, $bookblocks );
foreach( $bookblocks[1] as $block )
{
preg_match_all( "/\<GraphicImage\>(.*?)\<\/GraphicImage\>/",
$block, $author ); // GET LABEL
preg_match_all( "/\<TrackingNumber\>(.*?)\<\/TrackingNumber\>/",
$block, $tracking ); // GET TRACKING NUMBER
//echo( $author[1][0]."\n" );
}
echo '<img src="data:image/gif;base64,'. $author[1][0]. '"/>';
コードソース: http://webcollage.wordpress.com/2011/05/13/ups-label-print-with-php/
そして、ここhttp://webcollage.wordpress.com/2011/05/10/ups-shipping-confirmation-code-in-php/ で、配送ダイジェストがどのように見えるかがわかります