| Author |
Message |
pubblog1409

Joined: 16 Feb 2008
Posts: 3
|
Posted: Jul 15, 2009 09:03am Post subject: post notification of sale to a cgi script |
|
|
I am selling downloadable software in my Modular Merchant store. My system relies on the copy of the notification of sale email that is sent to my email address. I then pipe the email to a script that parses it and enters the customer's information and license key into a database. When the customer enters the license key into the software, it checks against the database and activates the software.
The problem is that the notification of sale email suffers from sporadic delays, sometimes by as much as two hours or more, which means that the customer is unable to activate the software.
It would be nice to have a feature that sends an HTTP post to a CGI script on my server, when there is a sale, thereby eliminating the email delay. |
|
Mail Bag

Answering Your Questions Since... 9:30am
Joined: 28 Aug 2005
Posts: 198
|
Posted: Jul 15, 2009 04:11pm Post subject: |
|
|
| Quote: | | It would be nice to have a feature that sends an HTTP post to a CGI script on my server |
The "custom script slots" that are available can be used to send an HTTP post to a URL. A list of the available custom script slots is included on page 27 of the Developer's Guide. The Developer's Guide also lists the structure of both the database and the PHP variables used in the customer's shopping session. The Developer's Guide is designed to be an overview, a starting point for developers familiar with database and PHP concepts.
A recommended method of posting requests to other domains and capturing the response is to use PHP's cURL functions. More information and some examples on this are available at: http://us3.php.net/manual/en/book.curl.php Below is an example of how PHP's curl functionality could be used to submit some text to another domain and capture that site's response. | Code: | <?php
$ch = curl_init(); // initialize cURL
if($ch) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$data = 'example='.urlencode('example_data');
curl_setopt($ch, CURLOPT_URL, 'http://www.MyDomain.com/MyPage.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
if($response === false) { /* error */ }
curl_close($ch);
} // end if($ch)
?> |
_________________ Modular Merchant Mail Bag
Answering your questions, queries and puzzlers.
Modular Merchant shopping cart software, website hosting, and custom programming. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|