定制 seravo/php-seravo-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

seravo/php-seravo-api

Composer 安装命令:

composer require seravo/php-seravo-api

包简介

PHP Library for Seravo API

README 文档

README

PHP Seravo API

A simple, object-oriented wrapper for the Seravo API, written in PHP.

Getting Started

API credentials are required to use the service. For more information and to request API credentials, please visit our website or contact help@seravo.com directly.

Requirements

  • PHP >= 8.2
  • PHP XML extension (php-xml)
  • ext-curl PHP cURL extension
  • ext-json PHP JSON extension
  • ext-mbstring PHP Multibyte String extension

Installation

Clone the project:

HTTPS

git clone https://github.com/Seravo/php-seravo-api.git

SSH

git clone git@github.com:Seravo/php-seravo-api.git

Install composer dependencies:

composer install

The package uses PSR-4 autoloader for class autoloading. Activate autoloading by requiring the Composer autoloader (Note the path to the vendor directory is relative to your project):

require 'vendor/autoload.php';

Environment Variables

The following environment variables are required to be set before using the library:

  • SERAVO_API_CLIENT_ID
  • SERAVO_API_SECRET

Optionally, you may pass these environment variables as well:

  • SERAVO_ENVIRONMENT
    • Defines the API environment (testing, staging, production) to be used. Defaults to production if omitted from .env and/or constructor.

These values must be set in the /.env file. See .env.example.

Basic Usage

See the examples directory for more detailed information about how to use the library.

Initializing the Client

To initialize the SeravoAPI client, instantiate the class with valid credentials and authenticate:

<?php

use Seravo\SeravoApi\SeravoAPI;

require_once 'vendor/autoload.php';

// Initialize client
$api = new SeravoAPI(
    clientId: 'your-client-id',
    secret: 'your-client-secret'
);

// Authenticate with given credentials
$api->authenticate();

Public API

Get Single Plan

Return a single Plan by ID:

<?php

use Seravo\SeravoApi\SeravoAPI;

require_once 'vendor/autoload.php';

$api = new SeravoAPI(
    clientId: 'your-client-id',
    secret: 'your-client-secret'
);

$api->authenticate();

$plan = $api->public->plans()->getById(id: 'plan-id');
var_dump($plan);

Order API

Get Single Order

Return a single Order by ID:

<?php

require_once 'vendor/autoload.php';

use Seravo\SeravoApi\SeravoAPI;

$api = new SeravoAPI(
    clientId: 'your-client-id',
    secret: 'your-client-secret'
);

$api->authenticate();

$order = $api->order->orders()->getById(id: 'your-order-id');
var_dump($order);
Create New Order

Create a new Order:

<?php

require_once 'vendor/autoload.php';

use Seravo\SeravoApi\SeravoAPI;
use Seravo\SeravoApi\Apis\Order\Request\Order\CreateOrderRequest;
use Seravo\SeravoApi\Apis\Order\Request\Order\Schema\Billing\PaperInvoice;
use Seravo\SeravoApi\Apis\Order\Request\Order\Schema\Company;
use Seravo\SeravoApi\Apis\Order\Request\Order\Schema\Contact;
use Seravo\SeravoApi\Apis\Order\Request\Order\Schema\Mail;
use Seravo\SeravoApi\Apis\Order\Response\Order\Domain;

$billing = new PaperInvoice(
    contact_email: 'john@doe.com',
    contact_name: 'John Doe',
    contact_phone: '0401234567',
    address: 'Testikatu 1',
    city: 'Helsinki',
    postal: '00100',
    name: 'John Doe'
);

$createOrderRequest = new CreateOrderRequest(
    accept_service_terms: true,
    domains: [ new Domain(name: 'mydomainexample123.fi', primary: true) ],
    contact: new Contact(email: 'john@doe.com', name: 'John Doe', phone: '0401234567'),
    migration: false,
    order_language: 'fi', // 'fi', 'en_US', 'sv_SE'
    order_trial_period: 0,
    site_location: 'FI',
    price_data: 'd289afc7-b02e-44b5-918b-da66aa3d8858',
    billing: $billing,
    company: new Company(id: '1', name: 'John Doe'),
    mail: new Mail(option: '1'),
);

$api = new SeravoAPI(
    clientId: 'your-client-id',
    secret: 'your-client-secret'
);

$api->authenticate();

try {
    $result = $api->order->orders()->create($createOrderRequest);
    var_dump($result);
} catch (\Exception $exception) {
    var_dump($exception);
}

Documentation

See our documentation for Order Module API & Public Module API.

License

This project is licensed under the MIT License - see the LICENSE file for details.

seravo/php-seravo-api 适用场景与选型建议

seravo/php-seravo-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 seravo/php-seravo-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 seravo/php-seravo-api 我们能提供哪些服务?
定制开发 / 二次开发

基于 seravo/php-seravo-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-27