kaliop / abacusadvancebundle
Kaliop的Abacus Advance Bundle
1.3.0
2019-01-07 14:22 UTC
Requires
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2024-08-24 05:11:13 UTC
README
API,用于轻松连接到Abacus AD网关API,版本v0.9.14
此API网关允许您
- 轻松调用Abacus ADvance API
- 接收ADvance在某些配置中发出的http回调
外部文档
要求
- guzzlehttp/guzzle: ~6.0
- symfony - 各种组件:Config、OptionsResolver、HttpFoundation、Serializer、HttpKernel、DependencyInjection
安装
- 使用composer安装包
- 在您的Sf应用kernel中激活Abacus\AdvanceBundle\AbacusAdvanceBundle
- 设置所需的参数(请参阅此包中的parameters.yml)
使用包
向ADvance发起API调用
要调用ADvance,您必须获取abacus.advance.api
作为服务,并从中获取您需要的特定服务:门卫访问允许、记录网络活动、获取产品列表等...
每个服务可以返回一个或多个预格式化的响应。
接收回调
待文档...
使用本地API占位符模拟ADvance
待文档...
示例
门卫访问允许
// Get Abacus ADvance api as a service $advanceApiGateway = $this->get('abacus.advance.api'); // Get GateKeeper service $gateKeeperService = $advanceApiGateway->getGateKeeper(); // Call API and get response (NB: can throw an exception) $accessAllowResponse = $gateKeeperService ->accessAllowed( [ 'Url' => 'myUrl', 'CookieID' => 'myAnonymousUserId', ] ); // Use response methods $access = $accessAllowResponse->hasAccessGranted(); // true|false $accessStatus = $accessAllowResponse->getAccessStatus(); // GateKeeper::ACCESS_GRANTED|GateKeeper::ACCESS_DENIED // Or get response as Abacus returned to us $rawResponse = $accessAllowResponse->getRawResponse(); // See also getData, getVersion, getStatusCode, getStatusMessages functions
作者
- Rémi Souverain
- Yann Roseau
- Gaetano Giunta