http://api.1shoppingcart.com/index.php?title=OneShopNotificationListener.php&feed=atom&action=history OneShopNotificationListener.php - Revision history 2024-03-28T10:51:55Z Revision history for this page on the wiki MediaWiki 1.17.0 http://api.1shoppingcart.com/index.php?title=OneShopNotificationListener.php&diff=206&oldid=prev Chrisn at 14:12, 29 May 2008 2008-05-29T14:12:17Z <p></p> <table style="background-color: white; color:black;"> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr valign='top'> <td colspan='2' style="background-color: white; color:black;">← Older revision</td> <td colspan='2' style="background-color: white; color:black;">Revision as of 14:12, 29 May 2008</td> </tr><tr><td colspan="2" class="diff-lineno">Line 3:</td> <td colspan="2" class="diff-lineno">Line 3:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; #TODO: Add your Merchant <del class="diffchange diffchange-inline">Id </del>as <del class="diffchange diffchange-inline">first parameter </del>and Merchant Key as <del class="diffchange diffchange-inline">second parameter&#160; &#160; </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; # TODO: Add your Merchant <ins class="diffchange diffchange-inline">ID </ins>as <ins class="diffchange diffchange-inline">the First Parameter, </ins>and <ins class="diffchange diffchange-inline">your </ins>Merchant Key as <ins class="diffchange diffchange-inline">Second Parameter.</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;&quot;,&quot;&quot;,&quot;https://www.mcssl.com&quot;);</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;&quot;,&quot;&quot;,&quot;https://www.mcssl.com&quot;);</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; #Load the request body into XML and check that the result has been parsed into XML</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; # Load the request body into XML and check that the result has been parsed into XML <ins class="diffchange diffchange-inline">&#160; </ins></div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&#160; &#160; </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; if ($requestBodyXML-&gt;loadXML($HTTP_RAW_POST_DATA) == true)</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; if ($requestBodyXML-&gt;loadXML($HTTP_RAW_POST_DATA) == true)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; {</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; {</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">&#160; &#160; &#160; &#160; #TODO: Verify syntax to get the node name of the domdocument</del></div></td><td colspan="2">&#160;</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; $notificationType = $requestBodyXML-&gt;documentElement-&gt;nodeName;&#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; $notificationType = $requestBodyXML-&gt;documentElement-&gt;nodeName;&#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; $tokenNode = $requestBodyXML-&gt;getElementsByTagName('Token')-&gt;item(0)-&gt;nodeValue;&#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; $tokenNode = $requestBodyXML-&gt;getElementsByTagName('Token')-&gt;item(0)-&gt;nodeValue;&#160; &#160;</div></td></tr> <tr><td colspan="2" class="diff-lineno">Line 24:</td> <td colspan="2" class="diff-lineno">Line 22:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; default:</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; default:</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; #May have other types of notifications in the future</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; # May have other types of notifications in the future</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; break;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; break;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td></tr> <tr><td colspan="2" class="diff-lineno">Line 32:</td> <td colspan="2" class="diff-lineno">Line 30:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; if ($apiResultXML-&gt;loadXML($apiResult)==true)</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; if ($apiResultXML-&gt;loadXML($apiResult)==true)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; {&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; {&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; #Check if the API returned an error</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; # Check if the API returned an error</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; $apiSuccess = $apiResultXML-&gt;getElementsByTagName('Response')-&gt;item(0)-&gt;getAttribute('success');</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; $apiSuccess = $apiResultXML-&gt;getElementsByTagName('Response')-&gt;item(0)-&gt;getAttribute('success');</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; if ($apiSuccess == 'true')</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; if ($apiSuccess == 'true')</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; {</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; {</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; #TODO: Do something with the <del class="diffchange diffchange-inline">apiResultXML&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; # TODO: Do something <ins class="diffchange diffchange-inline">useful </ins>with the <ins class="diffchange diffchange-inline">XML&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; </ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; }</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; else</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; else</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; {</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; {</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; </del>#TODO: <del class="diffchange diffchange-inline">Alert or log that </del>the <del class="diffchange diffchange-inline">API </del>returned <del class="diffchange diffchange-inline">a success of false </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins># TODO: <ins class="diffchange diffchange-inline">Do something with </ins>the <ins class="diffchange diffchange-inline">error </ins>returned <ins class="diffchange diffchange-inline">by the API</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; }</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; else</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; else</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; {</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; {</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; #TODO: Do something with the <del class="diffchange diffchange-inline">xmlErr </del>to either notify or log that the XML could not be parsed&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; &#160; &#160; # TODO: Do something with the <ins class="diffchange diffchange-inline">xml error </ins>to either notify or log that the XML could not be parsed&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; }</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; }</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; }</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; else</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; else</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; {</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; {</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; #TODO: Do something with the <del class="diffchange diffchange-inline">xmlErr </del>to either notify or log that the XML could not be parsed </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160; &#160; # TODO: Do something with the <ins class="diffchange diffchange-inline">xml error </ins>to either notify or log that the XML could not be parsed </div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; }&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; }&#160; &#160; &#160; &#160; &#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>?&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>?&gt;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;/pre&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;/pre&gt;</div></td></tr> </table> Chrisn http://api.1shoppingcart.com/index.php?title=OneShopNotificationListener.php&diff=188&oldid=prev Chrisn at 20:36, 28 May 2008 2008-05-28T20:36:30Z <p></p> <table style="background-color: white; color:black;"> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr valign='top'> <td colspan='2' style="background-color: white; color:black;">← Older revision</td> <td colspan='2' style="background-color: white; color:black;">Revision as of 20:36, 28 May 2008</td> </tr><tr><td colspan="2" class="diff-lineno">Line 2:</td> <td colspan="2" class="diff-lineno">Line 2:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;?php</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;?php</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;<del class="diffchange diffchange-inline">118303</del>&quot;,&quot;<del class="diffchange diffchange-inline">0</del>&quot;,&quot;https://www.mcssl.com&quot;);</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; <ins class="diffchange diffchange-inline">#TODO: Add your Merchant Id as first parameter and Merchant Key as second parameter&#160; &#160; </ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;&quot;,&quot;&quot;,&quot;https://www.mcssl.com&quot;);</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td></tr> </table> Chrisn http://api.1shoppingcart.com/index.php?title=OneShopNotificationListener.php&diff=106&oldid=prev Chrisn at 20:00, 26 May 2008 2008-05-26T20:00:10Z <p></p> <table style="background-color: white; color:black;"> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr valign='top'> <td colspan='2' style="background-color: white; color:black;">← Older revision</td> <td colspan='2' style="background-color: white; color:black;">Revision as of 20:00, 26 May 2008</td> </tr><tr><td colspan="2" class="diff-lineno">Line 3:</td> <td colspan="2" class="diff-lineno">Line 3:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; include('../Library/OneShopAPI.php');</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&minus;</td><td style="background: #ffa; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;<del class="diffchange diffchange-inline">80086</del>&quot;,&quot;<del class="diffchange diffchange-inline">dfd9e90384e842d18c4ef74ed08a4673</del>&quot;,&quot;<del class="diffchange diffchange-inline">http</del>://<del class="diffchange diffchange-inline">localhost</del>&quot;);</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $API = new OneShopAPI(&quot;<ins class="diffchange diffchange-inline">118303</ins>&quot;,&quot;<ins class="diffchange diffchange-inline">0</ins>&quot;,&quot;<ins class="diffchange diffchange-inline">https</ins>://<ins class="diffchange diffchange-inline">www.mcssl.com</ins>&quot;);</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&#160;&#160; &#160; $requestBodyXML = new DOMDocument();</div></td></tr> </table> Chrisn http://api.1shoppingcart.com/index.php?title=OneShopNotificationListener.php&diff=99&oldid=prev Chrisn: New page: <pre> <?php include('../Library/OneShopAPI.php'); $API = new OneShopAPI("80086","dfd9e90384e842d18c4ef74ed08a4673","http://localhost"); $requestBodyXML = new DOMDocum... 2008-05-26T19:44:06Z <p>New page: &lt;pre&gt; &lt;?php include(&#039;../Library/OneShopAPI.php&#039;); $API = new OneShopAPI(&quot;80086&quot;,&quot;dfd9e90384e842d18c4ef74ed08a4673&quot;,&quot;http://localhost&quot;); $requestBodyXML = new DOMDocum...</p> <p><b>New page</b></p><div>&lt;pre&gt;<br /> &lt;?php<br /> include('../Library/OneShopAPI.php');<br /> <br /> $API = new OneShopAPI(&quot;80086&quot;,&quot;dfd9e90384e842d18c4ef74ed08a4673&quot;,&quot;http://localhost&quot;);<br /> <br /> $requestBodyXML = new DOMDocument();<br /> <br /> #Load the request body into XML and check that the result has been parsed into XML<br /> <br /> if ($requestBodyXML-&gt;loadXML($HTTP_RAW_POST_DATA) == true)<br /> {<br /> #TODO: Verify syntax to get the node name of the domdocument<br /> $notificationType = $requestBodyXML-&gt;documentElement-&gt;nodeName; <br /> $tokenNode = $requestBodyXML-&gt;getElementsByTagName('Token')-&gt;item(0)-&gt;nodeValue; <br /> switch ($notificationType)<br /> { <br /> case &quot;NewOrder&quot;:<br /> <br /> $apiResult = $API-&gt;GetOrderById($tokenNode); <br /> <br /> break;<br /> <br /> default:<br /> #May have other types of notifications in the future<br /> break;<br /> }<br /> <br /> $apiResultXML = new DOMDocument(); <br /> <br /> if ($apiResultXML-&gt;loadXML($apiResult)==true)<br /> { <br /> #Check if the API returned an error<br /> $apiSuccess = $apiResultXML-&gt;getElementsByTagName('Response')-&gt;item(0)-&gt;getAttribute('success');<br /> <br /> if ($apiSuccess == 'true')<br /> {<br /> #TODO: Do something with the apiResultXML <br /> }<br /> else<br /> {<br /> #TODO: Alert or log that the API returned a success of false <br /> }<br /> }<br /> else<br /> {<br /> #TODO: Do something with the xmlErr to either notify or log that the XML could not be parsed <br /> }<br /> }<br /> else<br /> {<br /> #TODO: Do something with the xmlErr to either notify or log that the XML could not be parsed <br /> } <br /> ?&gt;<br /> &lt;/pre&gt;</div> Chrisn