diff --git a/src/TPPWholesale/Data/Configuration.php b/src/TPPWholesale/Data/Configuration.php index 33b93b4..da92a83 100644 --- a/src/TPPWholesale/Data/Configuration.php +++ b/src/TPPWholesale/Data/Configuration.php @@ -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 @@ -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'], diff --git a/src/TPPWholesale/Helper/TPPWholesaleApi.php b/src/TPPWholesale/Helper/TPPWholesaleApi.php index be5460b..081df58 100644 --- a/src/TPPWholesale/Helper/TPPWholesaleApi.php +++ b/src/TPPWholesale/Helper/TPPWholesaleApi.php @@ -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], @@ -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],