From 5e76f73c7da0ff52406711900ae36584038c8500 Mon Sep 17 00:00:00 2001 From: "DELL-5501\\Jovana Stamenkovic" Date: Fri, 6 Oct 2023 11:49:30 +0200 Subject: [PATCH] Fix contact update for some TLDs Fixed contact update for .de tld that doesn't require sending all contacts. Implemented trade command and added the option to enable trade for TLD that requires it for the owner update Resolves PROD-2627 (2/2). ChangeLog: * [FIX] Fixed contact update for some TLDs. --- lib/Net/DRI/DRD/OpenSRS.pm | 7 +++++++ lib/Net/DRI/Protocol/OpenSRS/XCP/Domain.pm | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/Net/DRI/DRD/OpenSRS.pm b/lib/Net/DRI/DRD/OpenSRS.pm index 6e4f101..78aaf71 100644 --- a/lib/Net/DRI/DRD/OpenSRS.pm +++ b/lib/Net/DRI/DRD/OpenSRS.pm @@ -273,5 +273,12 @@ sub domain_get_trade_lock return $rc; } +sub domain_trade +{ + my ($self,$ndr,$domain,$rd)=@_; + my $rc=$ndr->process('domain','trade',[$domain, $rd]); + return $rc; +} + #################################################################################################### 1; diff --git a/lib/Net/DRI/Protocol/OpenSRS/XCP/Domain.pm b/lib/Net/DRI/Protocol/OpenSRS/XCP/Domain.pm index 2ba58a3..1ca1c7e 100644 --- a/lib/Net/DRI/Protocol/OpenSRS/XCP/Domain.pm +++ b/lib/Net/DRI/Protocol/OpenSRS/XCP/Domain.pm @@ -86,6 +86,7 @@ sub register_commands get_dnssec_info => [ \&get_dnssec_info ], modify_trade_lock => [\&modify_trade_lock ], get_trade_lock => [\&get_trade_lock], + trade => [\&trade], ); return { 'domain' => \%tmp }; @@ -744,6 +745,27 @@ sub get_trade_lock $msg->command(\%r); $msg->command_attributes({domain => $domain}); } + +sub trade +{ + my ($xcp,$domain,$rd)=@_; + my $msg=$xcp->message(); + my $attr = {domain => $domain}; + + my %r=(action=>'TRADE_DOMAIN',object=>'domain'); + $msg->command(\%r); + + my $registry_type = "registrant"; + my $contactset=$rd->set('contact'); + my $co=$contactset->get($registry_type); + $co->validate(); + my $owner = add_contact_info($msg,$co); + + $attr ={%$attr, %$owner}; + + $msg->command_attributes($attr); +} + } ####################################################################################################