package FS::part_export::domreg_opensrs;
-use vars qw(@ISA %info %options $conf);
+use vars qw(@ISA %info %options $conf $me $DEBUG);
use Tie::IxHash;
use DateTime;
use FS::Record qw(qsearchs qsearch);
=cut
@ISA = qw(FS::part_export::null);
+$me = '[' . __PACKAGE__ . ']';
+$DEBUG = 0;
my @tldlist = qw/com net org biz info name mobi at be ca cc ch cn de dk es eu fr it mx nl tv uk us/;
sub _export_insert_on_payment {
my( $self, $svc_domain ) = ( shift, shift );
+ warn "$me:_export_insert_on_payment called\n" if $DEBUG;
return '' unless $self->option('wait_for_pay');
my $queue = new FS::queue {
'svcnum' => $svc_domain->svcnum,
'job' => 'FS::part_export::domreg_opensrs::renew_through',
};
- $queue->insert( $self, $svc_domain->svcnum ); #_export_insert with 'R' action?
+ $queue->insert( $self, $svc_domain ); #_export_insert with 'R' action?
return '';
}
my $srs = $self->get_srs;
- my $cookie = $srs->get_cookie( $self->option('masterdomain') );
- if (!$cookie) {
- return "Unable to get cookie at OpenSRS: " . $srs->last_response();
- }
+# cookie not required for registration
+# my $cookie = $srs->get_cookie( $self->option('masterdomain') );
+# if (!$cookie) {
+# return "Unable to get cookie at OpenSRS: " . $srs->last_response();
+# }
# return "Domain registration not enabled" if !$self->option('register');
return $srs->last_response() if !$srs->register_domain( $svc_domain->domain, $c);
sub renew_through {
my ( $self, $svc_domain, $date ) = @_;
+ warn "$me: renew_through called\n" if $DEBUG;
eval "use Net::OpenSRS;";
return $@ if $@;
my $err = $self->is_supported_domain( $svc_domain );
return $err if $err;
- my $srs = $self->get_srs;
-
- $rv = $srs->check_transfer($svc_domain->domain);
+ warn "$me: checking status\n" if $DEBUG;
+ my $rv = $self->get_status($svc_domain);
return "Domain ". $svc_domain->domain. " is not renewable"
unless $rv->{expdate};
if $years > 10; #no infinite loop
}
+ warn "$me: renewing ". $svc_domain->domain. "for $years years\n" if $DEBUG;
+ my $srs = $self->get_srs;
$rv = $srs->make_request(
{
action => 'renew',