WWW::eNom::Role::Command::Service - Addon Services That Can Be Purchased
use WWW::eNom; my $api = WWW::eNom->new( ... ); # Get wholesale price for Domain privacy my $domain_privacy_wholesale_price = $api->get_domain_privacy_wholesale_price(); # Purchase Domain Privacy my $order_id = $api->purchase_domain_privacy_for_domain( 'drzigman.com' ); # Get If Privacy Has Been Purchased my $is_privacy_purchased = $api->get_is_privacy_purchased_by_name( 'drzigman.com' ); # Enable Domain Privacy my $updated_domain = $api->enable_privacy_by_name( 'drzigman.com' ); # Disable Domain Privacy my $updated_domain = $api->disable_privacy_by_name( 'drzigman.com' ); # Get Privacy Expiration Date my $privacy_expiration_date = $api->get_privacy_expiration_date_by_name( 'drzigman.com' ); # Get is Privacy Auto Renew my $is_privacy_auto_renew = $api->get_is_privacy_auto_renew_by_name( 'drzigman.com' ); my $domain = WWW::eNom::Domain->new( ... ); # Enable Auto Renew for Domain Privacy my $updated_domain = $api->enable_privacy_auto_renew_for_domain( $domain ); # Disable Auto Renew for Domain Privacy my $updated_domain = $api->disable_privacy_auto_renew_for_domain( $domain ); # Renew Domain privacy my $order_id = $api->renew_privacy({ domain_name => 'drzigman.com', years => 1, });
Implements addon service related API calls (such as WPPS Service, what eNom calls Privacy Protection).
use Math::Currency; my $domain_privacy_wholesale_price = $api->get_domain_privacy_wholesale_price();
Returns the wholesale price per year (the price you as the reseller pay, not what you want to charge your customers) for domain privacy as a Math::Currency object.
# Be sure to wrap this in a try/catch block, presented here for clarity my $order_id = $api->purchase_domain_privacy_for_domain( 'drzigman.com' );
Abstraction of the PurchaseServices for ID Protect eNom API Call. Given a FQDN, attempts to purchase Domain Privacy for the specified domain. On success, the OrderID of this purchase is returned.
There are several reason this method could fail and croak.
This is almost always caused by attempting to add privacy protection to a public suffix that does not support it.
Noting this, consumers should take care to ensure safe handling of these potential errors.
my $is_privacy_purchased = $api->get_is_privacy_purchased_by_name( 'drzigman.com' );
Abstraction of the GetWPPSInfo eNom API Call. Given a FQDN, returns a truthy value if privacy has been purchased regardless of if it is active or not and a falsey value if privacy has not been purchased regardless of it is active or not.
If the domain is not registered or is registered to someone else this method will croak.
my $updated_domain = $api->enable_privacy_by_name( 'drzigman.com' );
Abstraction of the EnableServices eNom API Call. Given a FQDN, enables Domain Privacy for it. If privacy is already active this method is effectively a NO OP. If domain privacy has not been purchased for this domain, this method will buy and activate it automatically. In this case the auto renew will match that of the domain and enough Domain Privacy will be purchased to cover the registration length remaining. Domain privacy is not free, so you may wish to check get_is_privacy_purchased_by_name before making this call if you do not wish to purchase privacy.
my $updated_domain = $api->disable_privacy_by_name( 'drzigman.com' );
Abstraction of the DisableServices eNom API Call. Given a FQDN, disables Domain Privacy for it. If privacy is not currently active (or if it has never been purchased for this domain) this method is effective a NO OP.
my $is_privacy_auto_renew = $api->get_is_privacy_auto_renew_by_name( 'drzigman.com' );
Abstraction of the GetWPPSInfo eNom API Call. Given a FQDN, returns a truthy value if auto renew is enabled for domain privacy and a falsey value if auto renew is disabled for domain privacy.
NOTE If the specified domain does not have domain privacy this method will croak with the message 'Domain does not have privacy'.
my $privacy_expiration_date = $api->get_privacy_expiration_date_by_name( 'drzigman.com' );
Abstraction of the GetWPPSInfo eNom API Call. Given a FQDN, returns a DateTime object representing when domain privacy will expire.
my $domain = WWW::eNom::Domain->new( ... ); my $updated_domain = $api->enable_privacy_auto_renew_for_domain( $domain );
Abstraction of the SetRenew eNom API Call. Given an instance of WWW::eNom::Domain enables auto renew of domain privacy. If the domain privacy is already set to auto renew this method is effectively a NO OP.
my $domain = WWW::eNom::Domain->new( ... ); my $updated_domain = $api->disable_privacy_auto_renew_for_domain( $domain );
Abstraction of the SetRenew eNom API Call. Given an instance of WWW::eNom::Domain disables auto renew of domain privacy. If the domain privacy is already set not to auto renew this method is effectively a NO OP.
my $order_id = $api->renew_privacy({ domain_name => 'drzigman.com', years => 1, });
Abstraction of the RenewServices eNom API Call. Given a FQDN and a number of years, renews domain privacy. Returned is the order id.
There are several reasons this method could croak:
If you request a renewal longer than 10 years.
If the domain does not have privacy
To install WWW::eNom, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::eNom
CPAN shell
perl -MCPAN -e shell install WWW::eNom
For more information on module installation, please visit the detailed CPAN module installation guide.