The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

XML datafeed for beginner

solikesimonsolikesimon Member
in Help edited May 2012
So the time has come where I need to start doing some more things with Foxycart.

Is there a tutorial and example code that explains in a step by step manner way how to implement the XML datafeed?

I've had a look at the documentation but need a bit of a push in the right direction..
Comments
  • lancelance Member, Community Support Member
    @solikesimon -

    I haven't yet seen a really excellent tutorial providing step by step instructions on XML implementation, probably because the way you would implement the datafeed is dependent on what you are trying to do. You might want to start here:

    http://wiki.foxycart.com/integration/start

    Many of these are XML integrations, or at least the start of XML integrations.

    The docs (http://wiki.foxycart.com/v/0.7.2/transaction_xml_datafeed) are useful to understand the XML schema and get an overview of what you can expect, but it won't be particularly useful to you in terms of actual data extraction.

    If you can give me an idea of what you want to do and the systems you are working with, I can try to be a bit more specific.

    Lance
  • lancelance Member, Community Support Member
    @solikesimon (response to whisper) -

    When integrating with any system, either your own or a third-party API, you'll first want to setup a datafeed endpoint on your site that can receive the POSTed XML feed and decrypt it. Once you have decrypted it, you can transact against the XML however you want. You could write it to the database (you could also write encrypted data to the DB if necessary), you could parse it and pass it along to a third-party service, or you could modify your filesystem or DB based on the contents. You could also use the contents to generate your own e-mail receipts or self-host downloads.

    What is your development environment? PHP / MySQL? How comfortable are you with XML and XML transactions via APIs?

    Lance
  • The environment is PHP and MySQL. I'm fairly comfortable with XML but API's are new.

    I guess hoping too find example code for the datafeed endpoint, decryption and database insert is asking too much?
  • lancelance Member, Community Support Member
    edited May 2012
    I've responded via Whisper with a little more insight into the API integration, but in general you should consider starting here:

    http://wiki.foxycart.com/integration/foxycart/test_xml_write_to_file

    You can place this in your endpoint, point the datafeed there, get things decoded and take it from there. In PHP you can use SimpleXMLElement to load the XML up into an object and then you an easily iterate through the object and extract any of the data you need to write it to the database.

    Lance
  • This gives me an idea of what I need to do moving forward. No doubt I'll have more questions once I get stuck into it.

    Thanks again for your help!
  • lancelance Member, Community Support Member
    I'm glad this gives you something to start with. This is definitely an advanced task, so do post again as needed and we'll do what we can to provide assistance.

    Lance
Sign In or Register to comment.