tda/laravel-netcup

v0.2.1 2023-06-13 09:35 UTC

This package is auto-updated.

Last update: 2024-09-30 01:46:46 UTC


README

基于 Laravel 的 Netcup API: https://ccp.netcup.net/run/webservice/servers/endpoint.php

要求 • PHP >= 8.1

• Composer

• Laravel >= 8.0

安装

composer require tda/laravel-netcup

使用方法

在 Laravel 中

use Tda\LaravelNetcup\Netcup;
$clientRequestId = 'your_id'; //optional
$client = new Netcup($clientRequestId);

原本的密钥是从 'services.netcup' 配置中读取的

('services.netcup.api_key'),
('services.netcup.api_password'),
('services.netcup.customer_number')

可以设置不同的位置,例如

$netcup->setConfig('apis.netcup'); 

默认使用 REST,但可以更改为使用 SOAP

$netcup->useSoap();

功能

域名

列出所有域名

$domains = $netcup->listAllDomains(); //it return as Collection

从 Netcup 获取域名信息

$domain = $netcup->infoDomain('mydomain.com');

搜索域名

$domain = $netcup->searchDomain('somedomain.com');

获取顶级域名价格

$price = $netcup->priceTopLevelDomain('de');

从域名获取授权代码

$authcode = $netcup->getAuthCodeDomain('somedomain.com');
//or from a domain object
$domain = $netcup->infoDomain('mydomain.com');
$authcode = $netcup->getAuthCodeDomain($domain);

创建域名

(建设中)

$contact = new Tda\LaravelNetcup\Contactentries;
$contact->ownerc = {Id of contact handle}; // obligatory
$contact->adminc = {Id of contact handle}; 
$contact->techc = {Id of contact handle};
$contact->zonec = {Id of contact handle};
$contact->billingc = {Id of contact handle};
$contact->onsitec = {Id of contact handle};
$contact->generalrequest = {Id of contact handle};
$contact->abusecontact = {Id of contact handle};

$domain = $netcup->createDomain('mydomain.com', $contact);

更新域名

(建设中)

取消域名

(建设中)

转移域名

(建设中)

更改域名的所有者

(建设中)

处理

列出 Netcup 上的所有处理

$handles = $netcup->listAllHandle(); //it return as Collection

获取处理信息

$handle = $netcup->infoHandle($handle_id);

创建处理

$newHandle = new \Tda\LaravelNetcup\NetcupHandle();
$newHandle->type = 'organisation';
$newHandle->name = 'Your Lame';
$newHandle->organisation = 'Your organisation name';
$newHandle->street = 'Street';
$newHandle->type = 'organisation'; //(person|organisation|role|request)
$newHandle->postalcode = "0000";
$newHandle->city = "City";
$newHandle->countrycode = "DE";
$newHandle->telephone = "telefone number";
$newHandle->email = "your@email.com";
$newHandle->assignedtodomain = true;

$response = $netcup->createHandle($newHandle);

更新处理

$handle = $netcup->infoHandle($handle_id);
$hande->email = "new@email.com";
$response = $netcup->updateHandle($handle);

删除处理

$handle = $netcup->infoHandle($handle_id);
$response = $netcup->deleteHandle($handle);

DNS

区域

仅接受在 Netcup 上注册的域名

从域名获取区域 DNS

$response = $netcup->infoDnsZone('somedomain.com');
//or from the Domain object
$domain = $netcup->infoDomain('mydomain.com');
$response = $netcup->infoDnsZone($domain);

updateDnsZone

(建设中)

记录

仅接受在 Netcup 上注册的域名

从域名获取 DNS 记录

$response = $netcup->infoDnsRecords('yourdomain.com');
//or from the Domain object
$domain = $netcup->infoDomain('mydomain.com'); 
$response = $netcup->infoDnsRecords($domain);  

updateDnsRecords

(建设中)

轮询

列出所有轮询

$messageCount = 10; // optional; standard = 50
$response = $netcup->poll($messageCount); 

确认消息

$response = $netcup->ackPoll($poll_id); 

许可证 此项目采用 MIT 许可证 - 有关详细信息,请参阅 LICENSE 文件。