Backend Integration
The Composer plugin for Self-Managed Commerce is an implementation of the following extension points:
- Shopping Cart Events Extension Point.
- Shopping Cart Item Events Extension Point
- Customer Events Extension Point
- Order Release Events Extension Point
Therefore this plugin is compatible with Self-Managed Commerce 8.6.0 and later.
Plugin Integration
-
Open the
ext-plugin-config
module in yourep-commerce
source code repository. -
Open
pom.xml
and add the following within the<dependencies>
section:<dependency>
<groupId>com.elasticpath.xpf</groupId>
<artifactId>ep-composer-plugin</artifactId>
<version>1.0.0</version>
</dependency> -
Open
extensions/plugins/ext-plugin-config/src/main/resources/extensions.json
and add the following entry to theextensions
array:{
"identifier": {
"pluginId": "elasticpath-composerplugin-*",
"extensionClass": "com.elasticpath.plugins.composer.extensions.CustomerEventsExtension",
"extensionPointKey": "CUSTOMER_EVENT"
},
"enabled": true,
"priority": 1050,
"defaultSelectorMode": "DEFAULT_ALL",
"settings": [
{
"key": "API_KEY",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-api-key"
}
]
},
{
"key": "WEBHOOK_URL",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-webhook-url"
}
]
}
]
},
{
"identifier": {
"pluginId": "elasticpath-composerplugin-*",
"extensionClass": "com.elasticpath.plugins.composer.extensions.ShoppingCartEventsExtension",
"extensionPointKey": "SHOPPING_CART_EVENT"
},
"enabled": true,
"priority": 1050,
"defaultSelectorMode": "DEFAULT_ALL",
"settings": [
{
"key": "API_KEY",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-api-key"
}
]
},
{
"key": "WEBHOOK_URL",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-webhook-url"
}
]
}
]
},
{
"identifier": {
"pluginId": "elasticpath-composerplugin-*",
"extensionClass": "com.elasticpath.plugins.composer.extensions.ShoppingCartItemEventsExtension",
"extensionPointKey": "SHOPPING_CART_ITEM_EVENT"
},
"enabled": true,
"priority": 1050,
"defaultSelectorMode": "DEFAULT_ALL",
"settings": [
{
"key": "API_KEY",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-api-key"
}
]
},
{
"key": "WEBHOOK_URL",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-webhook-url"
}
]
}
]
},
{
"identifier": {
"pluginId": "elasticpath-composerplugin-*",
"extensionClass": "com.elasticpath.plugins.composer.extensions.OrderReleaseEventsExtension",
"extensionPointKey": "SHOPPING_CART_ITEM_EVENT"
},
"enabled": true,
"priority": 1050,
"defaultSelectorMode": "DEFAULT_ALL",
"settings": [
{
"key": "API_KEY",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-api-key"
}
]
},
{
"key": "WEBHOOK_URL",
"dataType": "SHORT_TEXT",
"collectionType": "SINGLE",
"values": [
{
"value": "my-webhook-url"
}
]
}
]
} -
The
API_KEY
andWEBHOOK_URL
values above will need to be updated with the correct values later, but for now just leave them as-is. -
Commit your changes.
-
Follow the steps in Configuring the Plugin to finish setting up the plugin.