Download the PHP package adexos/m2-jane-sdk-bridge without Composer
On this page you can find all versions of the php package adexos/m2-jane-sdk-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adexos/m2-jane-sdk-bridge
More information about adexos/m2-jane-sdk-bridge
Files in adexos/m2-jane-sdk-bridge
Package m2-jane-sdk-bridge
Short Description Adexos Jane SDK Bridge for Magento 2
License
Informations about the package m2-jane-sdk-bridge
SDK Bridge from JanePHP to Magento 2
How to install
You can install it by typing : composer require adexos/m2-jane-sdk-bridge
How to use
This SDK Bridge is a tool to easier Jane SDK generated client your implementation through your Magento 2 application.
In your di.xml, you have to declare :
Where your Vendor\MySDKBridge\Http\MyClient is
You must extends this specific class to have autocompletion for your injected client.
Then, in a class you can inject :
Authentication
You may want to use authentication provided by JanePHP in a generic way (API key or Bearer for example).
JanePHP generates (if needed) an authentication class in the Authentication folder of your SDK :
PathTo\Generated\Authentication\ApiKeyAuthentication
To do so, use the ApiKeyPluginWrapper provided in this module and add it to your plugins :
You can use following auth methods :
- Bearer authorization
- Basic auth authorization
/!\ If you want encrypt your API Key or password, you can use the Magento 2 backend_model
Magento\Config\Model\Config\Backend\Encryptedin yoursystem.xmlfile like this example:
Disclaimer
Your PHP application must implement its own Client or have some packages installed to handle :
Psr\Http\Client\ClientInterfacePSR-18Psr\Http\Message\RequestFactoryInterfacePSR-17Psr\Http\Message\StreamFactoryInterfacePSR-17
In this package :
- PSR-18 is handled by
symfony/http-client >= 4.4 - PSR-17 is handled by
nyholm/psr7 ^1.4
You can use the package you want as long as it respects the PSR standards.
Logger
- The bridge implement the http logger plugin and if you active this feature you can log all request and response to a loggerInterface. You can admin this in Configuration section of your magento.
All versions of m2-jane-sdk-bridge with dependencies
nyholm/psr7 Version ^1.4
symfony/http-client Version >= 4.4
php-http/logger-plugin Version ^1.3