Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eNom Domain Registrar Adapter #2339

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gmcsnetwork
Copy link

This pull request introduces the eNom.php file for integrating eNom's API into FOSSBilling. The file includes the following functionalities:

API Configuration and Initialization:

The file sets up the necessary credentials and endpoints to connect with eNom's API.
It can be configured to use the production or test eNom API environments

Domain Management Functions:

Implements functions to check domain availability, register domains, renew domains, and transfer domains.
Provides error handling and response parsing to ensure smooth interactions with the API.

Utility Functions:

Contains helper functions to format requests, handle authentication, and log interactions with the API for debugging and auditing purposes.

Testing and Validation

The file has been tested in both production and test environments to verify the correctness of API interactions.
Unit tests have been added to cover the main functionalities, ensuring that domain management operations are performed accurately.

Documentation

Inline comments have been added to explain the purpose of functions and significant code blocks.

Upon reviewing the AdapterAbstract class, noticed that all functions in eNom.php are currently set to return false in case of an error. To adhere to proper error handling practices and maintain consistency with the AdapterAbstract class, refactored the code to throw a Registrar_Exception instead of returning false. This change ensures that errors are handled more robustly and provides clearer feedback when something goes wrong.
This variable is supposed to contain the error message from the exception but it has not been defined. Instead, the exception's message should be used directly.
Copy link
Member

@BelleNottelling BelleNottelling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a quick look, this looks like a pretty good start.

A few critiques though:

  • I would be hesitant to included errors messages in exceptions as those may be displayed in the client area. Depending on the error message, that might be problematic.
  • There's a fair bit of CS oddities in the file. You could run rector and PHP-CS-Fixer which both have FOSSBilling specific configs for styling and code quality. This isn't strictly a blocker though as our repo is setup to periodically run these anyways.
  • There's no copyright info / license in the file.
  • These days we aren't super excited about merging 3rd party support into the main application just because we don't know if we can guarantee support for them. I don't think we have support for installing Registrars via the extension directory though. Ideally, we would have support for that and keep this in your own separate repo, but add it to the directory for easy installation.

Fixed file formatting and added copy right information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants