having datafeed problems

betoranaldibetoranaldi Member
in Help edited July 2008
I seem to be having a problem with the datafeed. Using the inventory module as a guide I was able to create my own custom feed processor.

I retrieve the feed, decrypt it and process the content. the processor does it's thing (sends out an email and some other stuff) but it never seems to return "foxy" to mark the transaction as completed. In turn, the order keeps on being processed over and over again, resulting in many many emails being sent out.

When I look at the error log in foxycart admin panel, it just show that there was a datafeed error. Don't give any other information.

I checked over the code multiple times and all seems to be fine. How can I go about determining the problem? Is there a way foxycart can tell me what they are seeing?
  • lukeluke FoxyCart Team
    Hey betoranaldi.

    Check out the example files here: http://wiki.foxycart.com/integration?datasrt=&dataflt=tags:datafeed

    When you're referring to the processor not returning "foxy", you're talking about code that you wrote so it's hard for FoxyCart to have any details. Basically, all it knows is that it sent the data to your script and your script did not respond with a "foxy", so it sends it again. Using the example there (test_xml_post), you should be able to simulate a transaction datafeed post from FoxyCart and take a look at what your script is actually doing. One thing you can also try in your script is to write some logging to a file so that you can see what's happening "behind the scenes" in your script without printing out things that would mess up the "foxy" return string.

    Please let us know if that helps you out.
  • I understand that my script is processing the feed and I used the test scripts found on the wiki page .

    I also used the same logging that was in the modx inventory example.

    I'm 99% sure that my script is functioning correctly.

    doing some other testing i created a feed processor that does nothing except return "foxy"
    $output = "foxy";
    return $output;

    I still get a feed error in the admin panel... what is happening?

  • lukeluke FoxyCart Team
    Shouldn't "return" be a "print"?

    You are trying to output the word "foxy", right?
  • lukeluke FoxyCart Team
    By testing the script, you should be able to post an example encrypted xml to your feedpage and it should print out nothing but "foxy" (no quotes). Does it do that?
  • Luke, that did the trick. Once I changed the return to echo everything worked properly.

    It seems that I was getting confused with the return, mainly because it should be used as a snippet and not plain code.

    Thank you for pointing out such a simple thing to me, I appreciate it.
  • lukeluke FoxyCart Team
    No prob, glad I could help. I actually thought I was being the stupid one if you were using a snippet. :)

    Glad you got it working.
  • brettbrett FoxyCart Team
    Sorry to post late, but if you use the Test XML script it's much, much easier than trying to test through FoxyCart itself.
Sign In or Register to comment.