Write a magento plugin to connect Magento Store data to Custora. The plugin should be available via Magento Connect, where customers can choose to install the plugin, and it will make the store's data available to Custora, and ping a Custora URL to tell our web app that the data is available.
The goal is to make the Custora/Magento integration as seamless as possible.
The plugin will make an API available to Custora so that we can pull in three data feeds: Customers, Transactions, and Order Items.
## Deliverables
**Magento Plug In Specification
Synopsis
We need a way to integrate clients Magento Stores to Custora. The plugin should be available via Magento Connect, where customers can choose to install the plugin, and it will make the store's data available to Custora, and ping a Custora URL to tell our web app that the data is available.
The goal is to make the Custora/Magento integration as seamless as possible.
The plugin will make an API available to Custora so that we can pull in three data feeds: Customers, Transactions, and Order Items.
Data Feeds
We will get three data feeds, one for each of Customers, Transactions and Order Items. Feeds will be provided as a URL that the Custora app calls GET on and the results are returned as a quoted CSV.
The quoted CSV has all fields enclosed in quotes and separated by commas. Quotes in the fields will be escaped by a \". Slashes ("\") will be escaped as ("\\").
Every time that the custora hits the feed url, it will return the entire customer/transaction/item history.
Customer Data: The customer data feed should include customer id, email address, sign up date, customer group name, and custom fields like gender and age.
Order Data: The order feed contains customer ID, date of purchase, revenue, and cost, as well as custom fields such as device used to place the order (whatever we can get from magento).
Order Items: An order items feed includes the details of the items in each order (customer id, date of purchase, revenue, cost, and custom fields such as brand and category of the item purchased).
Data Security
On installing the magento connect plugin, the store will ping Custora with a randomly generated secure key. This key will be provided as part of the query string (or cookie or http header) in all future custora requests to the server. The data feeds will not be available without this secure key.
Notifying Custora of Install
When the plugin is installed from magento connect, the magento store will post to a custora url (something like <[login to view URL]>). This post request will include a secure key for access to the feed (see above) as well as the store url, the email address of the store administrator, the name of their store, their primary currency, and their timezone. This will automatically create a custora account for the magento user. After installing the plugin, the customer will be redirected to a URL ot [login to view URL] with instructions for how to set up their account at custora, and how to provide payment information.
Inside Magento
Depending on the complexity, we may also want to add a link, or a single screen within Magento that can a user can click to connect to Custora. In this case, the plugin will need to listen for a security token upon creation of the account in Custora.**