Overview¶
Requirements¶
- PHP 5.3+
- composer
All composer dependencies are included in the Expressly provided integration releases on GitHub.
Include¶
Inside your composer.json, you need to include:
"require": {
"expressly/php-common": "2.4.1""
}
Or, run the command:
composer require expressly/php-common:2.4.1
Create a Client¶
In order to make use of the DI container, to include, override, or extend any code we provide, a new instance of the Expressly Client is required.
use Expressly;
/*
* $merchantType is a string to help us identify your system type in logs.
* Example constants in: Expressly\Entity\MerchantType
*/
$client = new Client($merchantType, array());
$app = $client->getApp();
Configuration¶
All configuration values associated with the repository are contained within config.yml.
To run the application in development mode, you can override the Expressly\Client parameters:
$client = new Expressly\Client(
$merchantType,
array(
'external' => array(
'hosts' => array(
'default' => 'http://dev.expresslyapp.com/api/v2',
'admin' => 'http://dev.expresslyapp.com/api/admin'
)
)
)
);
You can override any part of the container configuration defined in config.yml using the above method.
Checklist¶
For a working Expressly integration, using this library, the following need to be checked off:
- Include the project via composer (or alternative).
- Change Configuration if needed (for development purposes).
- Create a Client.
- Create a localized MerchantProvider: must extend MerchantProviderInterface, and register it with the application:
use Expressly\Provider\MerchantProviderInterface;
class MyMerchantProvider implements MerchantProviderInterface {
// your implementation
}
$app['merchant.provider'] = $app->share(function ($app) {
return new MyMerchantProvider();
});
Roadmap¶
[composer] | PHP package manager: https://getcomposer.org/ |
[config.yml] | src/Resources/config/config.yml |
[Silex] | Silex PHP Microframework: http://silex.sensiolabs.org/ |
[Pimple] | DI implementation: http://pimple.sensiolabs.org/ |
[DI] | Dependency Injection |
[MerchantProviderInterface] | src/Provider/MerchantProviderInterface.php (ExpresslyProviderMerchantProviderInterface) |