best-it / commercetools-message-serializer
Serializer for CommerceTools messages
Installs: 8 539
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1.3
- ext-json: *
- commercetools/php-sdk: ^1.0 || ^2.0
- symfony/messenger: ^4.2 || ^5.0
Requires (Dev)
- best-it/php_codesniffer: ^1.0
- phpunit/phpunit: ^6.0 || ^7.0
README
Just an very simple serializer for symfony messenger and CommerceTools messages.
Step 1: Add package
$ composer require best-it/commercetools-message-serializer
Step 2: Create service
# services.yaml services: BestIt\Messenger\CommerceToolsSerializer: class: BestIt\Messenger\CommerceToolsSerializer
Step 3: Use service
# messenger.yaml framework: messenger: serializer: default_serializer: 'BestIt\Messenger\CommerceToolsSerializer'
Every message has a header parameter X-CommerceTools-Message
which contains the full qualified class name of the
CommerceTools message (e.g.: Commercetools\Core\Model\Message\OrderCreatedMessage
).