Drop us a message hello@spinbits.io
This package is implementation of communication with BaseLinker Connector ("integration file"). For further details please refer to https://connectors.baselinker.com/exec/docs/index.php .
This package provides only core action handler. It's ready to be extended with your own ecommerce (Sylius, or other php-based products) action handlers.
For integration with Sylius, please go to https://github.com/spinbits/sylius-baselinker-plugin
Via Composer
$ composer require spinbits/baselinker-sdkIn order to use this package, instantiate your Baselinker handler:
$baselinkerPassword = 'secret-password';
$baselinkerHandler = new Spinbits\BaselinkerSdk\RequestHandler($baselinkerPassword);Register example handlers with $actionName from BaseLinker API:
$fileVersionHandler = new Spinbits\BaselinkerSdk\Handler\Common\FileVersionActionHandler();
$baselinkerHandler->registerHandler('FileVersion', $fileVersionHandler);You can register handler with some depending parameter also:
$supportedMethods = new Spinbits\BaselinkerSdk\Handler\Common\SupportedMethodsActionHandler($baselinkerHandler);
$baselinkerHandler->registerHandler('SupportedMethodsActionHandler', $supportedMethods);Before your handle request you should create Input object which receives array passed in POST request as a parameter.
Let's assumer that $request is for example Symfony\Component\HttpFoundation\Request object. We can use:
$input = new Spinbits\BaselinkerSdk\Rest\Input($request->request->all());In order to process incoming request you can just run:
$response = $baselinkerHandler->handle($input);The result to return controller response is:
$response->getContent();
/* returns example response:
[
'platform' => "Common spinbits baslinker plugin",
'version' => "4.0.0",
'standard' => 4,
]
*/Example handlers, common for all implementations can be found in src\Handler\Common.
Please see CHANGELOG for more information on what has changed recently.
$ composer testPlease see CONTRIBUTING for details.
If you discover any security related issues, please email office@spinbits.io instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.