定制 thepublicgood/names 二次开发

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

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

thepublicgood/names

Composer 安装命令:

composer require thepublicgood/names

包简介

API client for domains.co.za resellers.

README 文档

README

Tests

PHP client for the domains.co.za reseller API.

A full-featured PHP client for working with the domains.co.za reseller API. This is brand new and is a work in progress. It should not be used in production. It is likely to change significantly before reaching version 1.0.

You will need to have an active domains.co.za reseller account. You will need to provide your username and password to generate a new authentication token, or if you already have a token, you can provide that instead. Note that the library does not support 2 factor authentication.

Installation

There are no versions just yet, so you will need to make sure your composer.json file has "minimum-stability": "dev" set.

The Names library is not bound to any HTTP client library and you can install any PSR-7, PST-17 and PSR-18 compatible library. A good start could be:

composer require thepublicgood/names guzzlehttp/guzzle php-http/guzzle7-adapter

Usage

Create a new instance of the Names class and pass in your token if you have one. Otherwise, you can pass your username and password to the authenticate method:

$names = new \TPG\Names\Names(token: $token);

// or

$names = new \TPG\Names\Names();
$auth = $names->authenticate($username, $password);

$token = $auth->token;

Reseller Object

Many responses will included a Reseller object:

$reseller = $response->reseller;

$reseller->username;        // string
$reseller->balance;         // float
$reseller->accountType;     // string
$reseller->lowBalance;      // bool

Domains

Checking if a domain is available

$check = $names->domains()->check('is-this-available.com');

$check->requiresEpp;    // bool
$check->isAvailable;    // bool
$check->eppKey;         // string
$check->tld;            // string
$check->sld;            // string
$check->isPremium;      // bool
$check->reseller;       // Reseller object

Getting a list of registered domains

$list = $names->domains()->list();

// or

// Get a list of expired domains
$names->domains()->expired();

// Get a list of domains expiring next month
$names->domains()->expiringNextMonth();

// Get a list of suspended domains
$names->domains()->suspended();

// Get a list of domains currently in redemption
$names->domains()->redemption();

Each domain returned is a Domain object:

$domain = $names->domains()->list()->first();

$domain->name;              // string
$domain->contactName;       // string
$domain->contactId;         // string
$domain->status;            // string
$domain->eppStatus;         // string
$domain->premiumDns;        // bool
$domain->createdAt;         // Carbon
$domain->expiresAt;         // Carbon
$domain->redemptionDate;    // Carbon
$domain->deletionDate;      // Carbon
$domain->autoRenew;         // bool
$domain->externalReference; // string
$domain->nameservers;       // array

Credits

License

The MIT License (MIT). See the LICENSE.md file for more details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-12