liamcrayden/softwareofexcellence-exact-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

liamcrayden/softwareofexcellence-exact-api

最新稳定版本:1.1.1

Composer 安装命令:

composer require liamcrayden/softwareofexcellence-exact-api

包简介

A PHP interface for interacting with the Software Of Excellence eXact API

README 文档

README

A simple PHP Library for interacting with Software Of Excellence eXact API

This library is based on the published documentation available at https://api.ex.softwareofexcellence.com/docs/ and utlises version 1.0 of the API.

Installation

The preferred method of installation is via Composer.

$ composer require liamcrayden/softwareofexcellence-exact-api

Basic Usage

Access tokens are managed for you. Simply initialise a new instance of ExactAPIClient with your client ID and secret, and add any required scopes.

use Crayden\SoftwareOfExcellenceExactAPI\ExactAPIClient;
use Crayden\SoftwareOfExcellenceExactAPI\APIs\SubscriptionAPI;

$exact = new ExactAPIClient( $client_id, $client_secret );
$exact->addScopes(['productsubscription.get', 'practice.get']);
$subscriptionAPI = new SubscriptionAPI( $exact );
print_r( $subscriptionAPI->getActiveSubscriptions() );
Array
(
    [0] => UKTEST1
    [1] => UKTEST2
)

Use with Laravel

This package includes a Service Provider for Laravel. Simply install via composer as normal and package discovery will run automatically. You can configure the Client ID and Client Secret in your .env file or by publishing and editing the configuration file.

$ php artisan vendor:publish --tag=soe_exact
SOE_EXACT_CLIENT_ID="your-client-id-here"
SOE_EXACT_CLIENT_SECRET="your-client-secret-here"
SOE_EXACT_ENVIRONMENT="qa or production"

A facade is included so that you can access a singleton instance of ExactAPIClient with your configuration loaded.

$subscriptionAPI = ExactAPIClient::subscriptionAPI();
print_r( $subscriptionAPI->getActiveSubscriptions() );

You are of course free to create a new instance of ExactAPIClient manually by specifying the client ID, client secret and environment manually.

License

This library is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-13