astelbe/sdk-php
Composer 安装命令:
composer require astelbe/sdk-php
包简介
SDK used for a PHP Website to access Astel API and telecom data
README 文档
README
It is a lightweight, Astel API client library for PHP. The SDK is best suited for implementing some functionnalities on your own. For example: telecom product catalog listing, options, joint offer for comparing, ordering and sales reporting. The whole Astel.be website is written using this SDK and the API as source of data.
You can either implement your own website using this SDK or use easily integrable off-the-shelf tools - Web Integration Modules. These modules are injectable on any internet facing application or website by inserting some html tags in your own code.
Astel SDK Installation
Install via Composer.
$ composer require astelbe/sdk-php
And use in your PHP code:
require_once 'vendor/autoload.php';
or, simply, download an archive of our code and upload it on your application.
Usage
See our developer site for more examples.
Astel SDK Initialisation
// All methods require authentication. To get your Astel API Private Token credentials, contact us require_once 'vendor/autoload.php'; use AstelSDK\Model\Partner; use AstelSDK\Model\Brand; $envParticle = ''; // '' for production, 'sta' for staging env $apiToken = '12345abcde'; // API Private Token provided by Astel $isDebug = false; // For more debug info $logPath = null; // Null for no logs, a valid writable path for file logs $isPrivate = true; // Default private / professionnal param (Optionnal) $language = 'FR'; // Default language used by the page (Optionnal) $AstelApiContext = new AstelSDK\AstelContext($envParticle, $apiToken, $isDebug, $logPath); $AstelApiContext->setIsPrivate($isPrivate); $AstelApiContext->setLanguage($language); // Utils debug function registering AstelSDK\AstelContext::registerUtilsFunctions();
Now you are ready to call the API and retrieve data.
Product Example
$Product = AstelSDK\Model\Product::getInstance(); $products = $Product->find('all', [ '_embed' => 'play_description,commission,web', 'brand_id' => 3 // VOO ]); debug($products); $productVOOOne = $Product->find('first', [ 'id' => '1999', // VOO One '_embed' => 'play_description,commission,web', ]); debug($productVOOOne);
It retrieves all VOO Products and their full description, the commission and cashback associated and web links for product page, and the second example retrieves a single product : Voo One.
Discount Example:
$Discount = Discount::getInstance(); $discounts = $Discount->find('all', [ 'brand_id' => 3, '_embed' => 'subscription_periods/product/commission,subscription_periods/product/web', 'order' => '-weight', 'count' => 50, ]); debug($discounts);
It retrieves the 50 first active VOO discounts, order them by weight and retrives the associated recursive models: subscription_periods/product/commission and subscription_periods/product/web.
Supported Platforms
- PHP 7.0 or higher
How to contribute
All submissions are welcome. Fork the repository, read the rest of this README file and make some changes. Once you're done with your changes send a pull request. Thanks!
Need Help? Found a bug?
Just submit a issue if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
Don't hesitate to contact Astel at direction@astel.be for more info or help for your integration.
astelbe/sdk-php 适用场景与选型建议
astelbe/sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.24k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 astelbe/sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 astelbe/sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2018-12-05