Skip to content

Commit

Permalink
Add account_option and account_id to TppWholesale configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
uphlewis committed Oct 8, 2024
1 parent c63fdf2 commit a55f728
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/TPPWholesale/Data/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* TPPWholesale configuration.
*
* @property-read string $account_no Account NO field found in API Login Credentials
* @property-read string|null $account_id Account ID field for new registrations
* @property-read string|null $account_option Account Option field for new registrations
* @property-read string $api_login Login field found in API Login Credentials
* @property-read string $api_password Password Password field found in API Login Credentials
* @property-read string|null $api_hostname Optionally override API hostname
Expand All @@ -21,6 +23,8 @@ public static function rules(): Rules
{
return new Rules([
'account_no' => ['required', 'string'],
'account_id' => ['nullable', 'string'],
'account_option' => ['nullable', 'string'],
'api_login' => ['required', 'string'],
'api_password' => ['required', 'string', 'min:3'],
'api_hostname' => ['domain_name'],
Expand Down
5 changes: 4 additions & 1 deletion src/TPPWholesale/Helper/TPPWholesaleApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ public function register(
'Action' => 'Create',
'Domain' => $domainName,
'Period' => $period,
'AccountOption' => 'EXTERNAL',
'AccountOption' => $this->configuration->account_option ?: 'DEFAULT',
'AccountID' => $this->configuration->account_id ?: str_replace('-API', '', $this->configuration->api_login),
'OwnerContactID' => $contacts[self::CONTACT_TYPE_REGISTRANT],
'AdministrationContactID' => $contacts[self::CONTACT_TYPE_ADMIN],
'TechnicalContactID' => $contacts[self::CONTACT_TYPE_TECH],
Expand Down Expand Up @@ -506,6 +507,8 @@ public function initiateTransfer(string $domainName, string $eppCode, array $con
'Action' => 'TransferRequest',
'Domain' => $domainName,
'DomainPassword' => $eppCode,
'AccountOption' => $this->configuration->account_option ?: 'DEFAULT',
'AccountID' => $this->configuration->account_id ?: str_replace('-API', '', $this->configuration->api_login),
'OwnerContactID' => $contacts[self::CONTACT_TYPE_REGISTRANT],
'AdministrationContactID' => $contacts[self::CONTACT_TYPE_ADMIN],
'TechnicalContactID' => $contacts[self::CONTACT_TYPE_TECH],
Expand Down

0 comments on commit a55f728

Please sign in to comment.