Agence Dn'D - Oro API connector
Dn'D Oro Api Connector for Oro Commerce >= 1.0, (*1)
This connector between OroCommerce REST API and Alexa Amazon Echo Dot, (*2)
Requirements
DndOroApiConnectorBundle |
OroCommerce ,Community Edition |
v1.0.* |
v1.* |
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:, (*3)
$ cd /my/orocommerce/installation/dir
$ curl -sS https://getcomposer.org/installer | php
Then, install DndOroApiConnectorBundle with composer:, (*4)
composer require agencednd/oro-api-connector-bundle
This command requires you to have Composer installed globally, as explained
in the installation chapter
of the Composer documentation., (*5)
Step 2: Enable the Bundle
The bundle is automatically enabled., (*6)
Step 3: ReGenerate the API doc
The bundle expose a controller as API, so you have to regenerate the API doc, (*7)
php app/console oro:api:doc:cache:clear -e prod
Step 4: Copy the script folder into web folder
The Amazon Function needs to get a wsse header to be authenticated on the Oro's API. The WSSE header is generated from a script in your OroCommerce application.
To access of this script, you need to copy the files from vendor/ to web/ with this command line., (*8)
cp -R vendor/agencednd/alexa-connector-bundle/Resources/public/scripts/ web/scripts
In web/scripts/generate-wsse-header.php, you have to put your API key : oroUrl/admin/user/profile/view generate key, (*9)
- Modify the .htpasswd in ./web/scripts with this
# generate your user and password
'user:passwd'
- Modify the .htaccess with the good path to .htpasswd
From the "scripts" folder in console, (*10)
echo $PWD
Copy the path prompted, (*11)
Then modify the .htaccess AuthUserFile with the string pasted and .htaccess like
/srv/www/orocommerce/web/scripts/.htpasswd, (*12)
So, the OAuth2 is on the roadmap of the Oro team and will replace de WSSE., (*13)
Step 6: Create an AWS Lambda Function
Part 1
Part 2, (*14)
In your intent model put the content of alexa/intents.json, (*15)
In your AWS Lambda Function put the content of index.js, (*16)
Step 7: Replace in AWS Function
Line 23, (*17)
var oroHost = 'example.com';
With your URL., (*18)
Line 28 :, (*19)
auth: 'user:passwd',
Replace user:passwd by your user password generated for .htpasswd, (*20)
Let's Play
Roadmap
Index.js:
* TODO Wording rewrite website/shop to store
* TODO Refactoring : call token with getApiOption like in getAverageShoppingCart, (*21)
API:
* Convert revenue in one currency
* Get new opportunities
* Replace WSSE by OAuth2 when it is available
* Push notifications of new orders, (*22)
About us
Founded by lovers of innovation and design, Agence Dn'D assists companies for 11 years in the creation and development of customized digital (open source) solutions for web and E-commerce., (*23)