承接 metmax-io/cbr-api-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

metmax-io/cbr-api-php

Composer 安装命令:

composer require metmax-io/cbr-api-php

包简介

CBR Top WSAPI client wrapper

README 文档

README

Latest Version on Packagist Tests Total Downloads

A PHP wrapper for interacting with CBR Top Webservices API and supports the AuthenticationService, ReservationService, ReferenceDataService. This way you are able to handle the following operations:

  • Submitting a new application or changing an existing application;
  • Requesting open applications;
  • Request previously purchased capacity via TOP;
  • Reservation of requests at own capacity;
  • Requesting the results;
  • Request reference data such as the permitted products and locations, your registered instructors, your agreements with other trainers, and the available languages of the products;
  • Changing the password;

Installation

You can install the package via composer:

composer require metmax-io/cbr-api-php

Create the environment file

cp .env.dist .env

Usage

The API consists of 3 endpoints:

  • Authentication
  • ReferenceData
  • Reservation

The API's are separated in different folders but can be used similarly.

Get a list of physical CBR locations

use MetMax\Cbr\ReferenceData\ReferenceDataClientFactory;
use MetMax\Cbr\ReferenceData\Type\LocationsRequest;

$referenceData = ReferenceDataClientFactory::factory('username', 'password');
$locations = $referenceData->getLocations(new LocationsRequest());

Testing

The package php-http/vcr-plugin is being used to mock SOAP calls towards the CBR API. Responses will be stored inside the fixtures/vcr/ directory.

When a fixture isn't available, an actual HTTP call will be initiated, while the response will be stored as a fixture. If you want to update existing fixtures or creating new endpoints, make sure that the API credentials are configured within the .env file.

Run full testsuite

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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