zangra/exact-online-bundle
Composer 安装命令:
composer require zangra/exact-online-bundle
包简介
A Bundle for Exact Online API
README 文档
README
Author: Bianchi Jefferson / Lambot Maxime
Mail: jefferson@zangra.com / maxime@zangra.com
Exact Online doc: https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Content-getting-started
Requirements
Symfony HTTP Client 5.1branch for:
Symfony version 4.4
php version 7.2
STEP 1
Create your APP on : https://apps.exactonline.com/be/fr-BE/V2/Manage/
STEP 2
composer require zangra/exact-online-bundle
STEP 3
Now you can use multi account ( by country )
config/package/exact_online.yaml
exact_online:
Belgium:
baseUrl: https://start.exactonline.be/
apiUrl: api/v1
authUrl: api/oauth2/auth
tokenUrl: api/oauth2/token
redirectUrl: https://YOURURL/ExactRequest
clientId: YOURID
clientSecret: YOURSECRET
France:
baseUrl: https://start.exactonline.fr/
apiUrl: api/v1
authUrl: api/oauth2/auth
tokenUrl: api/oauth2/token
redirectUrl: https://YOURURL/ExactRequest
clientId: YOURID
clientSecret: YOURSECRET
Nerderland:
baseUrl: https://start.exactonline.nl/
apiUrl: api/v1
authUrl: api/oauth2/auth
tokenUrl: api/oauth2/token
redirectUrl: https://YOURURL/ExactRequest
clientId: YOURID
clientSecret: YOURSECRET
Spain:
baseUrl: https://start.exactonline.es/
apiUrl: api/v1
authUrl: api/oauth2/auth
tokenUrl: api/oauth2/token
redirectUrl: https://YOURURL/ExactRequest
clientId: YOURID
clientSecret: YOURSECRET
STEP 4
You need to update your database:php app/console doctrine:schema:update --force
STEP 5
In your controller :
use zangra\ExactOnlineBundle\Manager\ExactManager;
public function indexAction(Request $request, ExactManager $exactManager)
{
// the code sended by exact online when the first auth
$code = $request->query->get('code');
//$exactManager->init($code); // use init for the first Authentification, after that you should to use forceRefreshToken();
$exactManager->forceRefreshToken();
}
Next go to http:// YOUR URL.com/ExactRequest Your authentication login will be required, this session will expire after 10 minutes The token is automatically reniew when you launch an Request to Exact with self::refreshAccessToken();
Usage
Init
$code = $request->query->get('code');
$exactManager = $this->get("exact_online.manager");
//$exactManager->init($code); // first init
$exactManager->forceRefreshToken(); // after first init
getList($page, $maxPerPage)
(with pagination)$listAccount = $exactManager->getModel("Account")->getList(1,5);
foreach ($listAccount as $account){
dump($account);
}
findBy()
$criteria = array('AddressLine1' => 'Koningin Astridlaan 166');
$select = array ("AddressLine1", "BusinessType", "CountryName", "Created");
$orderBy = array('Created' => 'desc');
$limit = 1 ;
$account = $exactManager->getModel("Account")->findBy($criteria,$select,$orderBy,$limit);
dump($account);
find
(guid)account = $exactManager->getModel("Account")->find("587707b8-94aa-426a-b7db-56d434d9e83a");
persist()
$item = new Item();
$item->setCode(rand());
$item->setCostPriceStandard(5);
$item->setDescription("description de test");
$item->setIsSalesItem(true);
$item->setSalesVatCode('VN');
$exactManager->persist($item);
update()
$account = $exactManager->getModel("Account")->find("587707b8-94aa-426a-b7db-56d434d9e83a");
$account->setWebsite("https://zangra.com");
$exactManager->update($account);
remove()
$account = $exactManager->getModel("Account")->find("587707b8-94aa-426a-b7db-56d434d9e83a");
$exactManager->remove($account);
zangra/exact-online-bundle 适用场景与选型建议
zangra/exact-online-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 06 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「php」 「api」 「online」 「exact」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zangra/exact-online-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zangra/exact-online-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zangra/exact-online-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The bundle for easy using json-rpc api on your project
A PSR-7 compatible library for making CRUD API endpoints
Bundle Symfony DaplosBundle
Alfabank REST API integration
Biblioteca PHP pura para pagamentos SISP/Vinti4 de Cabo Verde.
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-25