It has been some time since I last used my coding "skills", but I'm eager to get back into "the zone" :).
Here's what I'm trying to do. Based on this: http://www.e-junkie.com/ej/help.integration.htm - I can see that E-Junkie sends some data to my server, according to an URL specified within my product settings. Let's say this URL is "example.com/store"
Now, I'm testing free checkout, which is supposed to send data back to example.com/store, like in case of other payment methods.
I would like to use php CURL to grab the data sent by E-Junkie - I believe it can happen in the background. In the past, I used CURL to send data to specific APIs, but this time it's something new to me, I have to receive, explode, and save data in the background - I guess the server does this without any browser interaction. My basic CURL settings look like this:
// Initiate the curl session
$ch = curl_init();
// Set the URL
curl_setopt( $ch, CURLOPT_POST, $url);
// Allow the headers
curl_setopt($ch, CURLOPT_HEADER, true);
// Return the output instead of displaying it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($ch);
Here's where I'm a bit lost, I guess due to my years of coding absence. What do I assign to the $url variable? The example.com/store or some E-Junkie URL? Or maybe I should ignore the $url variable at all and set CURLOPT_POST to true?
And how should I explode the $content array (because I believe it's sent as an array) so I can pick up specific variables like buyer's email or e-junkie item number?
Saving everything into database after figuring these things out will be a piece of cake :).