Developer Guide¶
This section provides technical documentation for developers working with the Innosend Magento 2 modules.
Overview¶
The Innosend integration consists of three core modules that work together:
flowchart TB
subgraph Magento["Magento 2 Store"]
direction TB
Order["Order Module (OrderConnector)"]
Pickup["Pickup Points Module (PickupPoints)"]
Integration["Integration Module (Core)"]
Order --> Integration
Pickup --> Integration
end
API["Innosend API<br/>api.innosend.eu"]
Integration --> API
Module Structure¶
Innosend_Integration¶
The core module providing API connectivity:
magento2-integration/src/
├── Api/
│ ├── CarrierInterface.php
│ ├── ClientInterface.php
│ ├── OrderInterface.php
│ └── PickupPointInterface.php
├── Block/Adminhtml/System/Config/
│ ├── ApiKeyComment.php
│ ├── TestConnection.php
│ └── TestTokenConnection.php
├── Controller/
│ ├── Adminhtml/System/Config/
│ │ └── TestConnection.php
│ └── Api/Ping.php
├── Model/
│ ├── Api/
│ │ ├── Carrier.php
│ │ └── Client.php
│ ├── Config/Source/Mode.php
│ └── Config.php
├── etc/
│ ├── adminhtml/system.xml
│ ├── config.xml
│ ├── di.xml
│ └── module.xml
└── registration.php
Innosend_PickupPoints¶
The checkout integration for pickup point selection:
magento2-pickup-points/src/
├── Api/
│ ├── Data/
│ │ ├── OrderPickupPointInterface.php
│ │ └── QuotePickupPointInterface.php
│ └── Webapi/
│ ├── GuestSavePickupPointInterface.php
│ └── SavePickupPointInterface.php
├── Block/Checkout/
│ └── PickupPoint.php
├── Controller/Ajax/
│ ├── GetPickupPoints.php
│ └── SavePickupPoint.php
├── Model/
│ ├── Carrier/PickupPoints.php
│ ├── Order/PickupPoint.php
│ ├── Quote/PickupPoint.php
│ └── PickupPointRepository.php
├── Observer/
│ ├── QuoteSubmitBefore.php
│ └── SalesOrderPlaceAfter.php
├── view/frontend/
│ ├── layout/checkout_index_index.xml
│ ├── templates/pickup-points/
│ └── web/js/
└── etc/
├── db_schema.xml
├── di.xml
├── events.xml
└── extension_attributes.xml
Innosend_OrderConnector¶
The order synchronization module:
magento2-order-connector/src/
├── Model/
│ ├── Config.php
│ ├── OrderMapper.php
│ └── StatusSync.php
├── Observer/
│ └── SalesOrderPlaceAfter.php
├── Plugin/Sales/
│ └── OrderRepositoryPlugin.php
├── Service/
│ └── CustomerOrderService.php
└── etc/
├── adminhtml/system.xml
├── crontab.xml
├── di.xml
└── events.xml
Developer Resources¶
| Topic | Description |
|---|---|
| Architecture | Detailed system architecture and data flow |
| API Reference | API interfaces and usage examples |
| Extending Modules | Customization and extension points |
Quick Reference¶
Namespaces¶
| Module | Namespace |
|---|---|
| Integration | Innosend\Integration\ |
| Pickup Points | Innosend\PickupPoints\ |
| Order Connector | Innosend\OrderConnector\ |
Key Interfaces¶
// API Client
Innosend\Integration\Api\ClientInterface
// Pickup Point Data
Innosend\PickupPoints\Api\Data\QuotePickupPointInterface
Innosend\PickupPoints\Api\Data\OrderPickupPointInterface
// Order Mapping
Innosend\OrderConnector\Model\OrderMapper
Database Tables¶
| Table | Description |
|---|---|
innosend_quote_pickup_point |
Pickup points linked to quotes |
innosend_order_pickup_point |
Pickup points linked to orders |
Events¶
| Event | Triggered When |
|---|---|
sales_order_place_after |
Order is placed (triggers sync) |
checkout_submit_before |
Before quote converts to order |
REST API Endpoints¶
| Endpoint | Method | Description |
|---|---|---|
/V1/innosend/pickup-points |
POST | Save pickup point for cart |
/V1/innosend/guest-pickup-points |
POST | Save pickup point for guest cart |
/innosend/api/ping |
GET | Health check endpoint |
Development Setup¶
Enable Developer Mode¶
Enable Debug Logging¶
Run Tests¶
# Unit tests
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist \
vendor/innosend/magento2-integration/src/Test
# Integration tests
vendor/bin/phpunit -c dev/tests/integration/phpunit.xml.dist \
vendor/innosend/magento2-integration/src/Test
Coding Standards¶
The modules follow Magento 2 coding standards:
- PSR-4 autoloading
- Magento 2 extension development best practices
- Dependency injection via constructor
- Interface-based service contracts
Code Quality Tools¶
# PHP CodeSniffer
vendor/bin/phpcs --standard=Magento2 vendor/innosend/
# PHPStan
vendor/bin/phpstan analyse vendor/innosend/ --level=6
Support for Developers¶
- Technical Documentation: This developer guide
- Source Code: Available via Composer
- Support: support@innosend.eu
Contributing¶
To contribute improvements or report issues:
- Review the existing documentation
- Test changes in a development environment
- Contact Innosend with your proposed changes