Screen: ShopSite > Orders
Note: |
The information on this page applies to Orders only.
For information on automated XML uploads and downloads of Products or Pages, see
Database Automated XML Upload/Download.
|
You can use a merchant-supplied program to automatically download a store’s orders as an XML-formatted text file. This help page describes the programmatic interface; the XML DTD is described on Orders Download XML Format.
Your orders download program must send a request to a ShopSite CGI program (db_xml.cgi) and provide the merchant’s user ID and password to start the download. To keep order information secure, the ShopSite CGI program should be invoked through a secure connection (https). If the connection is not secure, customer credit card information will not be included in the download.
The db_xml.cgi program can accept these optional parameters:
Note: | CVV2 information is only stored by ShopSite when the store is accepting credit cards for manual processing. This information is purged from ShopSite when orders are viewed or downloaded. Sometimes it is necessary to download the order information before authorizations occur, such as when using order managing software. For example, let's say that you manually authorize your credit card transactions and have an order manager that automatically downloads information from ShopSite. When those orders are downloaded to the order manager, the CVV2 information is purged from ShopSite, even if it is not used by the order manager. By setting the value for the "pay" parameter to "no_cvv" ( pay=no_cvv ), the CVV2 information will remain in ShopSite until the order is viewed or downloaded through the back office. |
While it is possible to use startorder and endorder or startdate and enddate to download a specific set of orders, you do not have to use both the start and end value. You could, for example, use startdate without enddate to download all the orders that have come in since the last time you downloaded orders.
The db_xml.cgi will output the following line, followed by the XML order information:
Content-type: application/x-www-form-urlencoded\n\n
This simple example program uses a non-secure connection to request order information, starting with order number 1962. Because the CGI directory on the server requires authentication, the program sends the user ID and password in encrypted form. This program does not process the XML, so it does not test the response values (Success or Failure).
if ((msg_socket = getconnection("mystore.com",80)) == -1)
{
printf("Big trouble, no socket connection\n");
exit(1);
}
/* create the HTTP header */
sprintf(send_msg,
"GET /cgi-bin/ss/db_xml.cgi?startorder=1962 HTTP/1.0\n"
"Host: mystore.com:80\r\n"
"Authorization: Basic ZGFycmVuOmRhcnJlbg==\r\n\n"); /* userid:password has been encrypted using mimencode.*/
/* send the HTTP header */
count = send(msg_socket, send_msg, strlen(send_msg),0);
/* loop to receive order info */
while (count = recv(msg_socket, buf, 2048, 0))
{
buf[count] = '\0';
printf("%s",buf); /* since just testing write the order info to the screen */
/* Here is where you would create a buffer /*
/* containing all the order info */
/* and then process that information */
}
close(msg_socket);
The getconnection() function creates a socket link to the specified host on port 80. Once the socket connection has been established the program will "send" the HTTP header that specifies the CGI to invoked along with any parameters (in this case startorder=1962 for the starting order to download), the Host and the Authorization which is needed because the CGI is in a userid/password protected web server directory.
ShopSite Help and Resource Center Last updated: March 01, 2010 Give Feedback |
ShopSite Shopping Cart Software |