Skip to content

Commit

Permalink
Merge branch 'CodeLineFi-feature/namecheap'
Browse files Browse the repository at this point in the history
  • Loading branch information
uphlewis committed Apr 5, 2023
2 parents 8e61400 + 1137631 commit 9d3aafe
Show file tree
Hide file tree
Showing 7 changed files with 1,100 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The following providers are currently implemented:
- [NIRA](https://nira.ng/become-a-registrar)
- [Ricta](https://www.ricta.org.rw/become-a-registrar/)
- [UGRegistry](https://registry.co.ug/docs/v2/)
- [Namecheap](https://www.namecheap.com/support/api/methods/)

## Functions

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"require": {
"upmind/provision-provider-base": "^3.0",
"upmind/provision-provider-base": "^3.7",
"metaregistrar/php-epp-client": "^1.0",
"hexonet/php-sdk": "^5.0",
"propaganistas/laravel-phone": "^4.2",
Expand Down
2 changes: 1 addition & 1 deletion src/Data/RenewParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function rules(): Rules
return new Rules([
'sld' => ['required', 'alpha-dash'],
'tld' => ['required', 'alpha-dash-dot'],
'renew_years' => ['required', 'integer', 'max:10'],
'renew_years' => ['required', 'integer', 'min:1', 'max:10'],
]);
}
}
2 changes: 2 additions & 0 deletions src/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Upmind\ProvisionProviders\DomainNames\Category as DomainNames;
use Upmind\ProvisionProviders\DomainNames\Example\Provider as ExampleProvider;
use Upmind\ProvisionProviders\DomainNames\Demo\Provider as DemoProvider;
use Upmind\ProvisionProviders\DomainNames\Namecheap\Provider as Namecheap;
use Upmind\ProvisionProviders\DomainNames\Nominet\Provider as Nominet;
use Upmind\ProvisionProviders\DomainNames\Hexonet\Provider as Hexonet;
use Upmind\ProvisionProviders\DomainNames\Enom\Provider as Enom;
Expand Down Expand Up @@ -50,5 +51,6 @@ public function boot()
$this->bindProvider('domain-names', 'ricta', Ricta::class);
$this->bindProvider('domain-names', 'ug-registry', UGRegistry::class);
$this->bindProvider('domain-names', 'domain-name-api', DomainNameApi::class);
$this->bindProvider('domain-names', 'namecheap', Namecheap::class);
}
}
29 changes: 29 additions & 0 deletions src/Namecheap/Data/NamecheapConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Upmind\ProvisionProviders\DomainNames\Namecheap\Data;

use Upmind\ProvisionBase\Provider\DataSet\DataSet;
use Upmind\ProvisionBase\Provider\DataSet\Rules;

/**
* Example configuration.
*
* @property-read string $username Login id
* @property-read string $api_token API token
* @property-read bool|null $sandbox Make API requests against the sandbox environment
* @property-read bool|null $debug Whether or not to log API requests and responses
*/
class NamecheapConfiguration extends DataSet
{
public static function rules(): Rules
{
return new Rules([
'username' => ['required', 'string', 'min:3', 'max:20'],
'api_token' => ['required', 'string', 'min:6', 'max:50'],
'sandbox' => ['nullable', 'boolean'],
'debug' => ['nullable', 'boolean'],
]);
}
}
Loading

0 comments on commit 9d3aafe

Please sign in to comment.