fitboxmedia/konnektive-api
Composer 安装命令:
composer require fitboxmedia/konnektive-api
包简介
A PHP implementation of the Konnektive CRM v2 API
README 文档
README
What It Is
A simple API integration that allows developers to interact with Konnektive CRM's v2 API. All methods are implemented and fully validated as of September 24, 2018
Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
Why Use This
When processing transactions and customer data through offers, marketers can benefit substantially from the use of a well tested and consistent 3rd party API integration.
Installation
Use composer require fitboxmedia/konnektive-api or add it manually to composer.json (See latest version in badges).
Getting Started
Konnektive crm integration can be implemented easily by simply filling up one of the request classes and handing it off to the dispatcher for processing like so:
use Konnektive\Dispatcher; class OfferProcessor { public function addCustomerNote(){ $dispatcher = new Dispatcher(); /** * @var $request \Konnektive\Request\Customer\AddCustomerNoteRequest; */ $request = new AddCustomerNoteRequest(); $request->loginId = "SomeValidStringForID"; $request->password = "SomeValidPassword"; $request->customerId = "123123"; $request->message = "TestMessage"; /** * @var $response \Konnektive\Response\Response; */ $response = $dispatcher->handle($request); if($response->isSuccessful()){ //Do the thing. } } }
Note: Custom handlers can be created and passed to Dispatcher during construction.
Custom Handlers
If you would like to use a custom handler for the dispatch of your request, you can create a new Handler class that implements the IHandler interface:
use Konnektive\Contracts\IHandler; class CustomHandler implements IHandler { /** * @var $request \Konnektive\Request\Request * @return \Konnektive\Response\Response */ public function handle(Request $request){ //Handle that request return new Response(/* Some response data from cUrl */); } }
The new CustomHandler can be passed into the dispatcher at construction or later:
$dispatcher = new Dispatcher(new CustomHandler()); //// $dispatcher->setHandler(new CustomHandler());
Validation
All requests will be validated prior to executing the handler. All validation failures are provided through the \Illuminate\Validation\ValidationException. These exceptions are not caught and must be handled in your own code! Validation can also be done prior to dispatch by calling validate() on the request object:
/** * @var $request \Konnektive\Request\Customer\AddCustomerNoteRequest; */ $request = new AddCustomerNoteRequest(); $request->loginId = "SomeValidStringForID"; $request->message = "TestMessage"; try { $request->validate(); } catch(ValidationException $ex){ //Fails for customerId and password }
Requirements
- PHP 7.0+
fitboxmedia/konnektive-api 适用场景与选型建议
fitboxmedia/konnektive-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 630 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fitboxmedia/konnektive-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fitboxmedia/konnektive-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 630
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-09