Home Page
Services & Technology Sign Up Now! Vendor/Customer Login About SwiftCD Contact Us
 

 

Sample PHP Script for SwiftCD HTTP Post Order Submission

// Variables
$url = "http://www.swiftcd.com/Orders/SubmitOrders.asp";
$data = "<?xml version="1.0" encoding="UTF-8" ?>
<SwiftCDOrders CreateDt="12/1/2001 5:00pm" BatchId="100" SubmitterId="VendorIdentification" ContactInfo="cust@vendor.com">
<Order>
<CustomerId>NEWC</CustomerId>
<TransactionDate>9/5/2001 10:00am</TransactionDate>
<Items>
<CD>
<TrackingId>20010307-860-1</TrackingId>
<LabelId>1</LabelId>
<PackageId>1</PackageId>
<Quantity>1</Quantity>
<RegKeyTitle>Unlock Code</RegKeyTitle>
<RegKey>12345</RegKey>
<RegFileName>regkey.txt</RegFileName>
<RegFileContent>1ansrinta0-6iae0y52345</RegFileContent>
<Content>
<Product>
<ProductId>123456</ProductId>
<Title>Shareware CD</Title>
</Product>
</Content>
</CD>
</Items>
<Shipping>
<Method>1</Method>
<FirstName>Joe</FirstName>
<LastName>Consumer</LastName>
<Company>ABC Corporation</Company>
<Addr1>2295 Customer Way</Addr1>
<Addr2>Suite 100</Addr2>
<City>NoWhere</City>
<State>GA</State>
<Province></Province>
<Country>US</Country>
<Zip>30155</Zip>
<Email>email@thenet.com</Email>
<Phone>(800) 555-6699</Phone>
</Shipping>
</Order>
</SwiftCDOrders>";

$req =& new HTTP_Request($url);
$req->addHeader("Content-Type", "text/xml");
$req->addHeader("Content-Length", strlen($data));
$req->setMethod(HTTP_REQUEST_METHOD_POST);
$req->addRawPostData($data, true);
$req->sendRequest();
echo $req->getResponseBody();

 
back to top