From 6ed4581909d49069376fe6ab034fe4fbb1e56e7a Mon Sep 17 00:00:00 2001 From: Paulo Jorge Date: Mon, 17 Jan 2022 17:08:25 +0000 Subject: [PATCH 1/5] fix fee and brown fee decimal bug + change afnic to use Fee-1.0 + update tests --- lib/Net/DRI/DRD/AFNIC/GTLD.pm | 2 +- lib/Net/DRI/DRD/NGTLD.pm | 2 +- .../Protocol/EPP/Extensions/CentralNic/Fee.pm | 8 +-- lib/Net/DRI/Protocol/EPP/Extensions/Fee.pm | 10 +-- .../DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t | 35 ++++----- .../EPP/Extensions/CentralNic/Fee-0.11.t | 35 +++++---- .../EPP/Extensions/CentralNic/Fee-0.4.t | 16 ++--- .../EPP/Extensions/CentralNic/Fee-0.5.t | 52 +++++++------- .../EPP/Extensions/CentralNic/Fee-0.6.t | 22 +++--- .../EPP/Extensions/CentralNic/Fee-0.7.t | 34 ++++----- .../EPP/Extensions/CentralNic/Fee-0.8.t | 60 ++++++++-------- .../EPP/Extensions/CentralNic/Fee-0.9.t | 56 +++++++-------- .../Protocol/EPP/Extensions/Fee/Fee-0.11.t | 36 +++++----- .../Protocol/EPP/Extensions/Fee/Fee-0.21.t | 72 +++++++++---------- .../Protocol/EPP/Extensions/Fee/Fee-0.23.t | 4 +- .../DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t | 72 +++++++++---------- t/Net/DRI/Protocol/EPP/Extensions/IN.t | 4 +- t/Net/DRI/Protocol/EPP/Extensions/KNET.t | 4 +- 18 files changed, 258 insertions(+), 266 deletions(-) diff --git a/lib/Net/DRI/DRD/AFNIC/GTLD.pm b/lib/Net/DRI/DRD/AFNIC/GTLD.pm index 108fb7876..81fd23d1e 100644 --- a/lib/Net/DRI/DRD/AFNIC/GTLD.pm +++ b/lib/Net/DRI/DRD/AFNIC/GTLD.pm @@ -101,7 +101,7 @@ sub profile_types { return qw/epp/; } sub transport_protocol_default { my ($self,$type)=@_; - return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::NEWGTLD',{'disable_idn'=>1,custom=>['AFNIC::RegistryMessage', 'CentralNic::Fee'], 'brown_fee_version' => '0.11'}) if $type eq 'epp'; + return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::NEWGTLD',{'disable_idn'=>1,custom=>['AFNIC::RegistryMessage', 'Fee'], 'fee_version' => '1.0'}) if $type eq 'epp'; return; } diff --git a/lib/Net/DRI/DRD/NGTLD.pm b/lib/Net/DRI/DRD/NGTLD.pm index fb01f776d..06867fcae 100644 --- a/lib/Net/DRI/DRD/NGTLD.pm +++ b/lib/Net/DRI/DRD/NGTLD.pm @@ -237,7 +237,7 @@ alsace aquarelle aquitaine banque bzh corsica frogans lancaster leclerc mma ovh return { bep_type => 1, # dedicated regsitry tlds => ['alsace', 'paris'], - transport_protocol_default => ['Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::NEWGTLD',{disable_idn=>1,custom=>['AFNIC::RegistryMessage', 'CentralNic::Fee'], 'brown_fee_version' => '0.11'}], + transport_protocol_default => ['Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::NEWGTLD',{disable_idn=>1,custom=>['AFNIC::RegistryMessage', 'Fee'], 'fee_version' => '1.0'}], contact_i18n => 1, # can only use the "loc" type whois_server => (defined $tld && $tld =~ m/\w+/ ? 'whois.nic.' . $tld : undef), } if $bep eq 'afnic' && $tld =~ m/(?:alsace|paris)/; diff --git a/lib/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee.pm b/lib/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee.pm index 1f4bb71ce..c4fe93f06 100644 --- a/lib/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee.pm +++ b/lib/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee.pm @@ -224,8 +224,8 @@ sub fee_set_parse } elsif ($name eq 'fee') # Fees are kind of loosely defined based on free text description field with refundable also possible. This will total it up and concat the description and refundable fields but its only human readable { - $set->{fee} = 0 unless exists $set->{fee}; - $set->{fee} += $content->textContent(); + $set->{fee} = '0.00' unless exists $set->{fee}; + $set->{fee} = sprintf("%.2f", ($set->{'fee'} + $content->textContent())); # wasn't appending x.00 for some reason. Using this way to avoid such problem :p $set->{description} = '' unless exists $set->{description}; if ($content->hasAttribute('description')) { @@ -233,7 +233,7 @@ sub fee_set_parse my $d = lc $content->getAttribute('description'); $d =~ s/ /_/g; $d = 'early_access_fee' if $d =~ m/early_access/; - $set->{"fee_$d"} = 0 + $content->textContent(); + $set->{"fee_$d"} = $content->textContent(); } if ($content->hasAttribute('refundable') && $content->getAttribute('refundable') eq '1') { $set->{description} .= "Refundable"; #TODO remove in regext-fee (0.12?), the description shold not contain these @@ -536,7 +536,7 @@ sub transform_parse } elsif ($name =~ m/^(fee|balance|creditLimit)/) { my $k= ($1 eq 'creditLimit') ? 'credit_limit' : $1; - $p{$k}=0+$content->textContent(); + $p{$k}=$content->textContent(); } } $rinfo->{domain}->{$oname}->{fee}=\%p; diff --git a/lib/Net/DRI/Protocol/EPP/Extensions/Fee.pm b/lib/Net/DRI/Protocol/EPP/Extensions/Fee.pm index 40e56212f..f0c2f9827 100644 --- a/lib/Net/DRI/Protocol/EPP/Extensions/Fee.pm +++ b/lib/Net/DRI/Protocol/EPP/Extensions/Fee.pm @@ -255,8 +255,8 @@ sub fee_element_parse return unless $content; # Fees are kind of loosely defined based on free text description field with refundable, applied, grace-period also possible. # The main fee is the total of them all, its not necessarily correct, but there you have it. - $set->{fee} = 0 unless exists $set->{fee}; - $set->{fee} += $content->textContent(); + $set->{fee} = '0.00' unless exists $set->{fee}; + $set->{fee} = sprintf("%.2f", ($set->{'fee'} + $content->textContent())); # wasn't appending x.00 for some reason. Using this way to avoid such problem :p my $d = 'default'; if ($content->hasAttribute('description')) { @@ -264,7 +264,7 @@ sub fee_element_parse $d = lc $content->getAttribute('description'); $d =~ s/ /_/g; $d = 'early_access_fee' if $d =~ m/early_access/; - $set->{"fee_$d"} = 0 + $content->textContent(); + $set->{"fee_$d"} = $content->textContent(); $set->{$d}->{description} = $content->getAttribute('description'); push @{$set->{fee_types}}, $d; } @@ -283,7 +283,7 @@ sub fee_element_parse $set->{applied} = $content->getAttribute('applied'); $set->{$d}->{applied} = $content->getAttribute('applied'); } - $set->{$d}->{fee} = 0+$content->textContent(); + $set->{$d}->{fee} = $content->textContent(); return; } @@ -486,7 +486,7 @@ sub transform_parse } elsif ($name =~ m/^(fee|balance|creditLimit|credit)/) { my $k= ($1 eq 'creditLimit') ? 'credit_limit' : $1; - $p{$k}=0+$content->textContent(); + $p{$k}=$content->textContent(); $p{'description'} = $content->getAttribute('description') if $content->hasAttribute('description'); } } diff --git a/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t b/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t index 2cde78a8d..be8cebc24 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t @@ -47,7 +47,7 @@ is($dri->get_info('object_id','message',124),'foobar.sncf','message_retrieve get ##################### ## PremiumDomain -## Note, I think they don't ise this any more? Instead they use fee-0.11 (at least for paris and alsace) +## Note, I think they don't ise this any more? Instead they use fee-1.0 (at least for paris and alsace) ## Old format (?) my $price = { duration=>DateTime::Duration->new(years=>5) }; @@ -79,26 +79,19 @@ is($dri->get_info('restore_price'),undef,'domain_check get_info (restore_price) #################################################################################################### -## Fee-0.11 +## Fee-1.0 $dri->add_registry('NGTLD',{provider => 'afnic',name=>'paris'} ); $dri->target('paris')->add_current_profile('p1','epp',{f_send=>\&mysend,f_recv=>\&myrecv}); -$R2=$E1.'EPPPRODServeronepp.prive.nic.TLD(V2.0.0)2016-09-15T13:03:32.0Z1.0enurn:ietf:params:xml:ns:domain-1.0urn:ietf:params:xml:ns:contact-1.0urn:ietf:params:xml:ns:host-1.0urn:ietf:params:xml:ns:rgp-1.0urn:ietf:params:xml:ns:secDNS-1.1urn:ietf:params:xml:ns:launch-1.0urn:ietf:params:xml:ns:fee-0.11'.$E2; +$R2=$E1.'EPPPRODServeronepp.prive.nic.TLD(V2.0.0)2016-09-15T13:03:32.0Z1.0enurn:ietf:params:xml:ns:domain-1.0urn:ietf:params:xml:ns:contact-1.0urn:ietf:params:xml:ns:host-1.0urn:ietf:params:xml:ns:rgp-1.0urn:ietf:params:xml:ns:secDNS-1.1urn:ietf:params:xml:ns:launch-1.0urn:ietf:params:xml:ns:epp:fee-1.0'.$E2; $rc=$dri->process('session','noop',[]); -is($dri->protocol()->ns()->{fee}->[0],'urn:ietf:params:xml:ns:fee-0.11','Fee 0.11 loaded correctly'); - -$R2=$E1.''.r().'foobarfeev011.parisfoobarfeev011.parisfoobarfeev011.pariscreateEUR129.00standard'.$TRID.''.$E2; -$rc=$dri->domain_check('foobarfeev011.paris',{fee=>{action=>'create', duration=>DateTime::Duration->new(years=>1), 'currency' => 'EUR'}}); -is_string($R1,$E1.'foobarfeev011.pariscreateEUR1ABC-12345'.$E2,'Fee extension: domain_check build'); -is($dri->get_info('action'),'check','domain_check get_info(action)'); -is($dri->get_info('exist'),0,'domain_check get_info(exist)'); - -$d = shift @{$dri->get_info('fee')}; -is($d->{domain},'foobarfeev011.paris','Fee extension: domain_check single parse domain'); -is($d->{class},'standard','Fee extension: domain_check single parse class'); -is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); -is($d->{action},'create','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),1,'Fee extension: domain_check single parse duration'); -is($d->{grace_period},'P5D','Fee extension: domain_check single parse grace_period '); -is($d->{fee},29.00,'Fee extension: domain_check single parse fee'); - -exit 0; +is($dri->protocol()->ns()->{fee}->[0],'urn:ietf:params:xml:ns:epp:fee-1.0','Fee 1.0 loaded correctly'); + +$R2=$E1.''.r().'foobarfee1-0.parisUSDfoobarfee1-0.paris110.00500.00'.$TRID.''.$E2; +$rc=$dri->domain_check('foobarfee1-0.paris',{fee=>{currency => 'USD',command=>'create'}}); +is_string($R1,$E1.'foobarfee1-0.parisUSDABC-12345'.$E2,'Fee extension: domain_...'); + +is($rc->is_success(),1,'domain_check is_success'); +is($dri->get_info('action'),'check','domain_check get_info (action)'); +is($dri->get_info('exist','domain','foobarfee1-0.paris'),0,'domain_check get_info(exist)'); +use Data::Dumper; print Dumper($rc); +exit 0; \ No newline at end of file diff --git a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.11.t b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.11.t index d8ed6fb65..3ca98ed91 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.11.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.11.t @@ -71,9 +71,8 @@ is($d->{action},'create','domain_check multi get_info(action) 1/4'); is($d->{phase},'sunrise','domain_check multi get_info(phase) 1/4'); is($d->{sub_phase},undef,'domain_check multi get_info(sub_phase) 1/4'); #is($d->{duration}->years(),'1','domain_check multi get_info(duration) 1/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 1/4'); -#is($d->{fee_application_fee},5.00,'domain_check multi parse fee (fee_application_fee) 1/4'); -is($d->{fee_registration_fee},5.00,'domain_check multi parse fee (fee_registration_fee) 1/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 1/4'); +is($d->{fee_registration_fee},'5.00','domain_check multi parse fee (fee_registration_fee) 1/4'); is($d->{grace_period},'P5D','domain_check multi parse fee (grace_period) 1/4'); is($d->{refundable},'1','domain_check multi parse fee (refundable) 1/4'); $d = shift @{$dri->get_info('fee','domain','holidays.space')}; @@ -84,7 +83,7 @@ is($d->{action},'create','domain_check multi get_info(action) 2/4'); is($d->{phase},'claims','domain_check multi get_info(phase) 2/4'); is($d->{sub_phase},'landrush','domain_check multi get_info(sub_phase) 2/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 2/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 2/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 2/4'); $d = shift @{$dri->get_info('fee','domain','hotels.space')}; is($d->{domain},'hotels.space','domain_check multi get_info(domain) 3/4'); is($d->{premium},0,'domain_check multi parse premium 3/4'); @@ -99,9 +98,9 @@ is($d->{reason},'minimum period is 2 years.','domain_check multi parse fee (reas # Note: we can no longer check different types in one command - so create only here is($dri->get_info('is_premium','domain','hotels.space'),0,'domain_check_multi get_info (is_premium) undef'); is($dri->get_info('price_duration','domain','tourism.space')->years(),1,'domain_check get_info (price_duration)'); -is($dri->get_info('create_price','domain','holidays.space'),5.00,'domain_check_multi get_info (create_price)'); -#is($dri->get_info('transfer_price','domain','hotels.space'),12.50,'domain_check_multi get_info (transfer_price)'); -#is($dri->get_info('restore_price','domain','restaurants.space'),25,'domain_check_multi get_info (restore_price)'); +is($dri->get_info('create_price','domain','holidays.space'),'5.00','domain_check_multi get_info (create_price)'); +#is($dri->get_info('transfer_price','domain','hotels.space'),'12.50','domain_check_multi get_info (transfer_price)'); +#is($dri->get_info('restore_price','domain','restaurants.space'),'25.00','domain_check_multi get_info (restore_price)'); #################################################################################################### ### Copied From fee-0.9 tests an manually adjusted @@ -119,9 +118,9 @@ is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{class},'premium','Fee extension: domain_check single parse class'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'renew','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); is($d->{grace_period},'P5D','domain_check multi single fee (grace_period) 1/4'); -is($d->{fee},650.00,'Fee extension: domain_check single parse fee'); +is($d->{fee},'650.00','Fee extension: domain_check single parse fee'); $dri->cache_clear(); @@ -137,8 +136,8 @@ is($d->{premium},1,'Fee extension: domain_check_price single parse premium'); is($d->{currency},'USD','Fee extension: domain_check_price single parse currency'); is($d->{action},'create','Fee extension: domain_check_price single parse action'); is($d->{duration}->years(),2,'Fee extension: domain_check_price single parse duration'); -is($d->{fee_registration_fee},5000.00,'Fee extension: domain_check_price single parse fee (fee_registration_fee)'); -is($d->{fee},5000.00,'Fee extension: domain_check_price single parse fee'); +is($d->{fee_registration_fee},'5000.00','Fee extension: domain_check_price single parse fee (fee_registration_fee)'); +is($d->{fee},'5000.00','Fee extension: domain_check_price single parse fee'); is($d->{phase},'sunrise','Fee extension: domain_check_price single parse phase'); # using the standardised methods @@ -148,10 +147,10 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),2,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),5000,'domain_check get_info (create_price)'); -#is($dri->get_info('renew_price'),9.95,'domain_check get_info (renew_price) undef'); -#is($dri->get_info('transfer_price'),9.95,'domain_check get_info (transfer_price) undef'); -#is($dri->get_info('restore_price'),9.95,'domain_check get_info (restore_price) undef'); +is($dri->get_info('create_price'),'5000.00','domain_check get_info (create_price)'); +#is($dri->get_info('renew_price'),'9.95','domain_check get_info (renew_price) undef'); +#is($dri->get_info('transfer_price'),'9.95','domain_check get_info (transfer_price) undef'); +#is($dri->get_info('restore_price'),'9.95','domain_check get_info (restore_price) undef'); ## domain create $R2=$E1.''.r().'exdomain.space1999-04-03T22:00:00.0Z2001-04-03T22:00:00.0ZUSD15.00-5.001000.00'.$TRID.''.$E2; @@ -167,9 +166,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.4.t b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.4.t index 2a4ad1a80..e08a67288 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.4.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.4.t @@ -50,8 +50,8 @@ $d = shift @{$dri->get_info('fee')}; is($d->{domain},'example.wiki','Fee extension: domain_check single parse domain'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'transfer','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); -is($d->{fee},'2.50','Fee extension: domain_check singe parse fee'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); +is($d->{fee},'2.50','Fee extension: domain_check single parse fee'); $R2=$E1.''.r().'example.barIn useexample.barEURcreate25.00'.$TRID.''.$E2; $rc=$dri->domain_check('example.bar',{fee=>{currency=>'EUR',action=>'create',phase=>'claims',sub_phase=>'landrush',duration=>$dri->local_object('duration','years',2)}}); is_string($R1,$E1.'example.barexample.barEURcreate2ABC-12345'.$E2,'Fee extension: domain_check build'); @@ -63,8 +63,8 @@ is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'create','Fee extension: domain_check single parse action'); is($d->{phase},'claims','Fee extension: domain_check single parse phase'); is($d->{sub_phase},'landrush','Fee extension: domain_check single parse sub_phase'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); -is($d->{fee},'5.00','Fee extension: domain_check singe parse fee'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); +is($d->{fee},'5.00','Fee extension: domain_check single parse fee'); # using the standardised methods is($dri->get_info('is_premium'),undef,'domain_check get_info (is_premium) undef'); # NOT SUPPORTED isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_info (price_duration) is DateTime::Duration'); @@ -215,7 +215,7 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); ## Renew $R2=$E1.''.r().'example.space2005-04-03T22:00:00.0ZUSD5.00'.$TRID.''.$E2; @@ -224,7 +224,7 @@ is_string($R1,$E1.'example.spacependingClientX2000-06-08T22:00:00.0ZClientY2000-06-13T22:00:00.0Z2002-09-08T22:00:00.0ZUSD5.00'.$TRID.''.$E2; @@ -233,7 +233,7 @@ is_string($R1,$E1.'is_success(),1,'domain_transfer is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_transfer parse currency'); -is($d->{fee},5.00,'Fee extension: domain_transfer parse fee'); +is($d->{fee},'5.00','Fee extension: domain_transfer parse fee'); ## Update $R2=$E1.''.r().'USD5.00'.$TRID.''.$E2; @@ -245,7 +245,7 @@ is_string($R1,$E1.'exdom2.broadwayexdom2.broadwayexdom2.broadwayUSDcreate10.0010.00exdom2.broadwayUSDcreate10.001000.00'.$TRID.''.$E2; @@ -90,14 +90,14 @@ is($d1->{domain},'exdom2.broadway','Fee extension: domain_check single parse dom is($d1->{premium},0,'Fee extension: domain_check single parse premium'); is($d1->{currency},'USD','Fee extension: domain_check single parse currency'); is($d1->{action},'create','Fee extension: domain_check single parse action'); -is($d1->{duration}->years(),1,'Fee extension: domain_check singe parse duration'); -is($d1->{fee},10.00,'Fee extension: domain_check singe parse fee'); +is($d1->{duration}->years(),1,'Fee extension: domain_check single parse duration'); +is($d1->{fee},'10.00','Fee extension: domain_check single parse fee'); is($d2->{domain},'exdom2.broadway','Fee extension: domain_check single parse domain'); is($d2->{premium},1,'Fee extension: domain_check single parse premium'); is($d2->{currency},'USD','Fee extension: domain_check single parse currency'); is($d2->{action},'create','Fee extension: domain_check single parse action'); -is($d2->{duration}->years(),1,'Fee extension: domain_check singe parse duration'); -is($d2->{fee},1000.00,'Fee extension: domain_check singe parse fee'); +is($d2->{duration}->years(),1,'Fee extension: domain_check single parse duration'); +is($d2->{fee},'1000.00','Fee extension: domain_check single parse fee'); ## TODO @@ -125,10 +125,10 @@ is($dri->get_info('is_premium'),0,'domain_check_price get_info (is_premium) no') isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check_price get_info (price_duration) is DateTime::Duration'); is($dri->get_info('price_duration')->years(),1,'domain_check_price get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check_price get_info (price_currency)'); -is($dri->get_info('create_price'),10.00,'domain_check_price get_info (create_price)'); -is($dri->get_info('renew_price'),10.00,'domain_check_price get_info (renew_price)'); -is($dri->get_info('transfer_price'),5,'domain_check_price get_info (transfer_price)'); -is($dri->get_info('restore_price'),20,'domain_check_price get_info (restore_price)'); +is($dri->get_info('create_price'),'10.00','domain_check_price get_info (create_price)'); +is($dri->get_info('renew_price'),'10.00','domain_check_price get_info (renew_price)'); +is($dri->get_info('transfer_price'),'5.00','domain_check_price get_info (transfer_price)'); +is($dri->get_info('restore_price'),'20.00','domain_check_price get_info (restore_price)'); #################################################################################################### ### EPP Info Command ### @@ -145,7 +145,7 @@ is($d->{currency},'USD','Fee extension: domain_info parse currency'); is($d->{action},'create','Fee extension: domain_info parse action'); is($d->{phase},'sunrise','Fee extension: domain_info parse phase'); is($d->{duration}->years(),1,'Fee extension: domain_info parse duration'); -is($d->{fee},10.00,'Fee extension: domain_check parse fee'); +is($d->{fee},'10.00','Fee extension: domain_check parse fee'); ## Transfer query # No examples to test using the RFC as reference (only the command response). @@ -171,9 +171,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); ## Renew $R2=$E1.''.r().'exdomain.broadway2005-04-03T22:00:00.0ZUSD5.00'.$TRID.''.$E2; @@ -182,7 +182,7 @@ is_string($R1,$E1.'exdomain.broadwaypendingClientX2000-06-08T22:00:00.0ZClientY2000-06-13T22:00:00.0Z2002-09-08T22:00:00.0ZUSD5.00'.$TRID.''.$E2; @@ -191,7 +191,7 @@ is_string($R1,$E1.'is_success(),1,'domain_transfer is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_transfer parse currency'); -is($d->{fee},5.00,'Fee extension: domain_transfer parse fee'); +is($d->{fee},'5.00','Fee extension: domain_transfer parse fee'); ## Update $R2=$E1.''.r().'USD5.00'.$TRID.''.$E2; @@ -203,7 +203,7 @@ is_string($R1,$E1.'expensiveshoes.coIn useexpensiveshoes.coUSDcreate112000.00CO Tier5expensiveshoes.coUSDrenew120.00CO Default Tierexpensiveshoes.coUSDtransfer120.00CO Default Tierexpensiveshoes.coUSDrestore1'.$TRID.''.$E2; @@ -70,16 +70,16 @@ $rc=$dri->domain_check_price('expensiveshoes.co'); is($rc->is_success(),1,'domain_check_price is is_success'); is($dri->get_info('is_premium'),1,'domain_check get_info (is_premium) 1'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),12000,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price'),20,'domain_check get_info (renew_price) 20'); +is($dri->get_info('create_price'),'12000.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price'),'20.00','domain_check get_info (renew_price) 20'); $R2=$E1.''.r().'ruggedshoes.coIn useruggedshoes.coUSDcreate17000.00CO Tier4ruggedshoes.coUSDrenew120.00CO Default Tierruggedshoes.coUSDtransfer120.00CO Default Tierruggedshoes.coUSDrestore1'.$TRID.''.$E2; $rc=$dri->domain_check_price('ruggedshoes.co'); is($rc->is_success(),1,'domain_check_price is is_success'); is($dri->get_info('is_premium'),1,'domain_check get_info (is_premium) undef'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),7000,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price'),20,'domain_check get_info (renew_price) undef'); +is($dri->get_info('create_price'),'7000.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price'),'20.00','domain_check get_info (renew_price) undef'); $R2=$E1.''.r().'exdomain.co1999-04-03T22:00:00.0Z2001-04-03T22:00:00.0ZUSD5.00-5.001000.00'.$TRID.''.$E2; $cs=$dri->local_object('contactset'); @@ -95,9 +95,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); # create with multiple fees and 'description', 'refundable', 'grace-period', 'applied'attributes # couldn't find a example on rfc but should be something like this! diff --git a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.7.t b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.7.t index 309aba3f2..43df255a4 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.7.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.7.t @@ -53,12 +53,12 @@ is($d->{domain},'check-claims-landrush.space','Fee extension: domain_check singl is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'create','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); -is($d->{fee_application_fee},150.00,'Fee extension: domain_check singe parse fee (fee_application_fee)'); -is($d->{fee_registration_fee},500.00,'Fee extension: domain_check singe parse fee (fee_registration_fee)'); -is($d->{fee},650.00,'Fee extension: domain_check singe parse fee'); -is($d->{phase},'claims','Fee extension: domain_check singe parse phase'); -is($d->{sub_phase},'landrush','Fee extension: domain_check singe parse sub_phase'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); +is($d->{fee_application_fee},'150.00','Fee extension: domain_check single parse fee (fee_application_fee)'); +is($d->{fee_registration_fee},'500.00','Fee extension: domain_check single parse fee (fee_registration_fee)'); +is($d->{fee},'650.00','Fee extension: domain_check single parse fee'); +is($d->{phase},'claims','Fee extension: domain_check single parse phase'); +is($d->{sub_phase},'landrush','Fee extension: domain_check single parse sub_phase'); # domain_check_price $R2=$E1.''.r().'check-sunrise.spacecheck-sunrise.spacecheck-sunrise.spaceUSDcreate15000.00premiumcheck-sunrise.spaceUSDrenew19.95premiumcheck-sunrise.spaceUSDtransfer19.95premiumcheck-sunrise.spaceUSDrestore19.95premium'.$TRID.''.$E2; @@ -72,8 +72,8 @@ is($d->{premium},1,'Fee extension: domain_check_price single parse premium'); is($d->{currency},'USD','Fee extension: domain_check_price single parse currency'); is($d->{action},'create','Fee extension: domain_check_price single parse action'); is($d->{duration}->years(),1,'Fee extension: domain_check_price single parse duration'); -is($d->{fee_registration_fee},5000.00,'Fee extension: domain_check_price single parse fee (fee_registration_fee)'); -is($d->{fee},5000.00,'Fee extension: domain_check_price single parse fee'); +is($d->{fee_registration_fee},'5000.00','Fee extension: domain_check_price single parse fee (fee_registration_fee)'); +is($d->{fee},'5000.00','Fee extension: domain_check_price single parse fee'); is($d->{phase},'sunrise','Fee extension: domain_check_price single parse phase'); # using the standardised methods is($dri->get_info('is_premium'),1,'domain_check get_info (is_premium) undef'); # NOT SUPPORTED @@ -81,10 +81,10 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),1,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),5000,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price'),9.95,'domain_check get_info (renew_price) undef'); -is($dri->get_info('transfer_price'),9.95,'domain_check get_info (transfer_price) undef'); -is($dri->get_info('restore_price'),9.95,'domain_check get_info (restore_price) undef'); +is($dri->get_info('create_price'),'5000.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price'),'9.95','domain_check get_info (renew_price) undef'); +is($dri->get_info('transfer_price'),'9.95','domain_check get_info (transfer_price) undef'); +is($dri->get_info('restore_price'),'9.95','domain_check get_info (restore_price) undef'); # domain info $R2=$E1.''.r().'foo.spaceEXAMPLE1-REPjd1234sh8013sh8013ns1.example.comns1.example.netns1.foo.spacens2.foo.spaceClientXClientY1999-04-03T22:00:00.0ZClientX1999-12-03T09:00:00.0Z2005-04-03T22:00:00.0Z2000-04-08T09:00:00.0Z2fooBARUSDcreate110.00premium-tier1'.$TRID.''.$E2; @@ -100,7 +100,7 @@ is($d->{currency},'USD','Fee extension: domain_info parse currency'); is($d->{action},'create','Fee extension: domain_info parse action'); is($d->{phase},'sunrise','Fee extension: domain_info parse phase'); is($d->{duration}->years(),1,'Fee extension: domain_info parse duration'); -is($d->{fee},10.00,'Fee extension: domain_info parse fee'); +is($d->{fee},'10.00','Fee extension: domain_info parse fee'); is($d->{description},'Refundable(Grace=>P5D)(Applied=>immediate)','Fee extension: domain_info parse human-readable description'); is($d->{class},'premium-tier1','Fee extension: domain_info parse classe'); # using the standardised methods @@ -109,7 +109,7 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),1,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium-tier1','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),'10','domain_check get_info (create_price)'); +is($dri->get_info('create_price'),'10.00','domain_check get_info (create_price)'); is($dri->get_info('renew_price'),undef,'domain_check get_info (renew_price) undef'); is($dri->get_info('transfer_price'),undef,'domain_check get_info (transfer_price) undef'); is($dri->get_info('restore_price'),undef,'domain_check get_info (restore_price) undef'); @@ -128,9 +128,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.8.t b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.8.t index 342311ae7..07d7634a3 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.8.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.8.t @@ -43,7 +43,7 @@ is($dri->protocol()->ns()->{fee}->[0],'urn:ietf:params:xml:ns:fee-0.8','Fee 0.8 #################################################################################################### ### check command and response copied draft-brown-epp-fees-05, this is an exactly simulation -$R2=$E1.''.r().'tourism.spaceholidays.spaceIn usehotels.spaceIn usetourism.spaceUSDcreate15.005.00holidays.spaceEURcreate25.00hotels.spaceEURtransfer22.5010.00restaurants.spaceGBPrestore25premium-tier1'.$TRID.''.$E2; +$R2=$E1.''.r().'tourism.spaceholidays.spaceIn usehotels.spaceIn usetourism.spaceUSDcreate15.005.00holidays.spaceEURcreate25.00hotels.spaceEURtransfer22.5010.00restaurants.spaceGBPrestore25.00premium-tier1'.$TRID.''.$E2; @fees = ( { domain=>'tourism.space',currency=>'USD',action=>'create',phase=>'sunrise',duration=>$dri->local_object('duration','years',1) }, { domain=>'holidays.space',currency=>'EUR',action=>'create',phase=>'claims',sub_phase=>'landrush',duration=>$dri->local_object('duration','years',2) }, @@ -65,9 +65,9 @@ is($d->{action},'create','domain_check multi get_info(action) 1/4'); is($d->{phase},'sunrise','domain_check multi get_info(phase) 1/4'); is($d->{sub_phase},undef,'domain_check multi get_info(sub_phase) 1/4'); is($d->{duration}->years(),'1','domain_check multi get_info(duration) 1/4'); -is($d->{fee},10.00,'domain_check multi get_info(fee) 1/4'); -is($d->{fee_application_fee},5.00,'domain_check multi parse fee (fee_application_fee) 1/4'); -is($d->{fee_registration_fee},5.00,'domain_check multi parse fee (fee_registration_fee) 1/4'); +is($d->{fee},'10.00','domain_check multi get_info(fee) 1/4'); +is($d->{fee_application_fee},'5.00','domain_check multi parse fee (fee_application_fee) 1/4'); +is($d->{fee_registration_fee},'5.00','domain_check multi parse fee (fee_registration_fee) 1/4'); $d = shift @{$dri->get_info('fee','domain','holidays.space')}; is($d->{domain},'holidays.space','domain_check multi get_info(domain) 2/4'); is($d->{premium},0,'domain_check multi parse premium 2/4'); @@ -76,30 +76,30 @@ is($d->{action},'create','domain_check multi get_info(action) 2/4'); is($d->{phase},'claims','domain_check multi get_info(phase) 2/4'); is($d->{sub_phase},'landrush','domain_check multi get_info(sub_phase) 2/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 2/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 2/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 2/4'); $d = shift @{$dri->get_info('fee','domain','hotels.space')}; is($d->{domain},'hotels.space','domain_check multi get_info(domain) 3/4'); is($d->{premium},0,'domain_check multi parse premium 3/4'); is($d->{currency},'EUR','domain_check multi get_info(currency) 3/4'); is($d->{action},'transfer','domain_check multi get_info(action) 3/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 3/4'); -is($d->{fee},12.50,'domain_check multi get_info(fee) 3/4'); -is($d->{fee_transfer_fee},2.50,'domain_check multi parse fee (fee_transfer_fee) 1/4'); -is($d->{fee_renewal_fee},10.00,'domain_check multi parse fee (fee_renewal_fee) 1/4'); +is($d->{fee},'12.50','domain_check multi get_info(fee) 3/4'); +is($d->{fee_transfer_fee},'2.50','domain_check multi parse fee (fee_transfer_fee) 1/4'); +is($d->{fee_renewal_fee},'10.00','domain_check multi parse fee (fee_renewal_fee) 1/4'); $d = shift @{$dri->get_info('fee','domain','restaurants.space')}; is($d->{domain},'restaurants.space','domain_check multi get_info(domain) 4/4'); is($d->{premium},1,'domain_check multi parse premium 4/4'); is($d->{currency},'GBP','domain_check multi get_info(currency) 4/4'); is($d->{action},'restore','domain_check multi get_info(action) 4/4'); -is($d->{fee},25,'domain_check multi get_info(fee) 3/4'); -is($d->{fee_restore_fee},25.00,'domain_check multi parse fee (fee_redstore_fee) 4/4'); +is($d->{fee},'25.00','domain_check multi get_info(fee) 3/4'); +is($d->{fee_restore_fee},'25.00','domain_check multi parse fee (fee_redstore_fee) 4/4'); # using the standardised methods is($dri->get_info('is_premium','domain','hotels.space'),0,'domain_check_multi get_info (is_premium) undef'); is($dri->get_info('price_duration','domain','tourism.space')->years(),1,'domain_check get_info (price_duration)'); -is($dri->get_info('create_price','domain','holidays.space'),5.00,'domain_check_multi get_info (create_price)'); -is($dri->get_info('transfer_price','domain','hotels.space'),12.50,'domain_check_multi get_info (transfer_price)'); -is($dri->get_info('restore_price','domain','restaurants.space'),25,'domain_check_multi get_info (restore_price)'); +is($dri->get_info('create_price','domain','holidays.space'),'5.00','domain_check_multi get_info (create_price)'); +is($dri->get_info('transfer_price','domain','hotels.space'),'12.50','domain_check_multi get_info (transfer_price)'); +is($dri->get_info('restore_price','domain','restaurants.space'),'25.00','domain_check_multi get_info (restore_price)'); #################################################################################################### @@ -116,12 +116,12 @@ is($d->{domain},'check-claims-landrush.space','Fee extension: domain_check singl is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'create','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); -is($d->{fee_application_fee},150.00,'Fee extension: domain_check singe parse fee (fee_application_fee)'); -is($d->{fee_registration_fee},500.00,'Fee extension: domain_check singe parse fee (fee_registration_fee)'); -is($d->{fee},650.00,'Fee extension: domain_check singe parse fee'); -is($d->{phase},'claims','Fee extension: domain_check singe parse phase'); -is($d->{sub_phase},'landrush','Fee extension: domain_check singe parse sub_phase'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); +is($d->{fee_application_fee},'150.00','Fee extension: domain_check single parse fee (fee_application_fee)'); +is($d->{fee_registration_fee},'500.00','Fee extension: domain_check single parse fee (fee_registration_fee)'); +is($d->{fee},'650.00','Fee extension: domain_check single parse fee'); +is($d->{phase},'claims','Fee extension: domain_check single parse phase'); +is($d->{sub_phase},'landrush','Fee extension: domain_check single parse sub_phase'); # domain_check_price $R2=$E1.''.r().'check-sunrise.spacecheck-sunrise.spacecheck-sunrise.spaceUSDcreate15000.00premiumcheck-sunrise.spaceUSDrenew19.95premiumcheck-sunrise.spaceUSDtransfer19.95premiumcheck-sunrise.spaceUSDrestore19.95premium'.$TRID.''.$E2; @@ -135,8 +135,8 @@ is($d->{premium},1,'Fee extension: domain_check_price single parse premium'); is($d->{currency},'USD','Fee extension: domain_check_price single parse currency'); is($d->{action},'create','Fee extension: domain_check_price single parse action'); is($d->{duration}->years(),1,'Fee extension: domain_check_price single parse duration'); -is($d->{fee_registration_fee},5000.00,'Fee extension: domain_check_price single parse fee (fee_registration_fee)'); -is($d->{fee},5000.00,'Fee extension: domain_check_price single parse fee'); +is($d->{fee_registration_fee},'5000.00','Fee extension: domain_check_price single parse fee (fee_registration_fee)'); +is($d->{fee},'5000.00','Fee extension: domain_check_price single parse fee'); is($d->{phase},'sunrise','Fee extension: domain_check_price single parse phase'); # using the standardised methods is($dri->get_info('is_premium'),1,'domain_check get_info (is_premium) undef'); # NOT SUPPORTED @@ -144,10 +144,10 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),1,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),5000,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price'),9.95,'domain_check get_info (renew_price) undef'); -is($dri->get_info('transfer_price'),9.95,'domain_check get_info (transfer_price) undef'); -is($dri->get_info('restore_price'),9.95,'domain_check get_info (restore_price) undef'); +is($dri->get_info('create_price'),'5000.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price'),'9.95','domain_check get_info (renew_price) undef'); +is($dri->get_info('transfer_price'),'9.95','domain_check get_info (transfer_price) undef'); +is($dri->get_info('restore_price'),'9.95','domain_check get_info (restore_price) undef'); # domain info $R2=$E1.''.r().'foo.spaceEXAMPLE1-REPjd1234sh8013sh8013ns1.tourism.spacens1.holidays.spacens1.foo.spacens2.foo.spaceClientXClientY1999-04-03T22:00:00.0ZClientX1999-12-03T09:00:00.0Z2005-04-03T22:00:00.0Z2000-04-08T09:00:00.0Z2fooBARUSDcreate110.00premium-tier1'.$TRID.''.$E2; @@ -163,7 +163,7 @@ is($d->{currency},'USD','Fee extension: domain_info parse currency'); is($d->{action},'create','Fee extension: domain_info parse action'); is($d->{phase},'sunrise','Fee extension: domain_info parse phase'); is($d->{duration}->years(),1,'Fee extension: domain_info parse duration'); -is($d->{fee},10.00,'Fee extension: domain_info parse fee'); +is($d->{fee},'10.00','Fee extension: domain_info parse fee'); is($d->{description},'Refundable(Grace=>P5D)(Applied=>immediate)','Fee extension: domain_info parse human-readable description'); is($d->{class},'premium-tier1','Fee extension: domain_info parse classe'); # using the standardised methods @@ -172,7 +172,7 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),1,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium-tier1','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),'10','domain_check get_info (create_price)'); +is($dri->get_info('create_price'),'10.00','domain_check get_info (create_price)'); is($dri->get_info('renew_price'),undef,'domain_check get_info (renew_price) undef'); is($dri->get_info('transfer_price'),undef,'domain_check get_info (transfer_price) undef'); is($dri->get_info('restore_price'),undef,'domain_check get_info (restore_price) undef'); @@ -191,9 +191,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.9.t b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.9.t index fbda4ee2f..6fad1f534 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.9.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/CentralNic/Fee-0.9.t @@ -43,7 +43,7 @@ is($dri->protocol()->ns()->{fee}->[0],'urn:ietf:params:xml:ns:fee-0.9','Fee 0.9 #################################################################################################### ### check command and response copied draft-brown-epp-fees-06 5.1.1 but names changes -$R2=$E1.''.r().'tourism.spaceholidays.spaceIn usehotels.spaceIn usetourism.spaceUSDcreate15.005.00holidays.spaceEURcreate25.00hotels.spaceEURtransfer22.5010.00restaurants.spaceGBPrestore25premium-tier1'.$TRID.''.$E2; +$R2=$E1.''.r().'tourism.spaceholidays.spaceIn usehotels.spaceIn usetourism.spaceUSDcreate15.005.00holidays.spaceEURcreate25.00hotels.spaceEURtransfer22.5010.00restaurants.spaceGBPrestore25.00premium-tier1'.$TRID.''.$E2; @fees = ( { domain=>'tourism.space','element'=>'name',currency=>'USD',action=>'create',phase=>'sunrise',duration=>$dri->local_object('duration','years',1) }, { domain=>'holidays.space',currency=>'EUR',action=>'create',phase=>'claims',sub_phase=>'landrush',duration=>$dri->local_object('duration','years',2) }, @@ -65,9 +65,9 @@ is($d->{action},'create','domain_check multi get_info(action) 1/4'); is($d->{phase},'sunrise','domain_check multi get_info(phase) 1/4'); is($d->{sub_phase},undef,'domain_check multi get_info(sub_phase) 1/4'); is($d->{duration}->years(),'1','domain_check multi get_info(duration) 1/4'); -is($d->{fee},10.00,'domain_check multi get_info(fee) 1/4'); -is($d->{fee_application_fee},5.00,'domain_check multi parse fee (fee_application_fee) 1/4'); -is($d->{fee_registration_fee},5.00,'domain_check multi parse fee (fee_registration_fee) 1/4'); +is($d->{fee},'10.00','domain_check multi get_info(fee) 1/4'); +is($d->{fee_application_fee},'5.00','domain_check multi parse fee (fee_application_fee) 1/4'); +is($d->{fee_registration_fee},'5.00','domain_check multi parse fee (fee_registration_fee) 1/4'); $d = shift @{$dri->get_info('fee','domain','holidays.space')}; is($d->{domain},'holidays.space','domain_check multi get_info(domain) 2/4'); is($d->{premium},0,'domain_check multi parse premium 2/4'); @@ -76,30 +76,30 @@ is($d->{action},'create','domain_check multi get_info(action) 2/4'); is($d->{phase},'claims','domain_check multi get_info(phase) 2/4'); is($d->{sub_phase},'landrush','domain_check multi get_info(sub_phase) 2/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 2/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 2/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 2/4'); $d = shift @{$dri->get_info('fee','domain','hotels.space')}; is($d->{domain},'hotels.space','domain_check multi get_info(domain) 3/4'); is($d->{premium},0,'domain_check multi parse premium 3/4'); is($d->{currency},'EUR','domain_check multi get_info(currency) 3/4'); is($d->{action},'transfer','domain_check multi get_info(action) 3/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 3/4'); -is($d->{fee},12.50,'domain_check multi get_info(fee) 3/4'); -is($d->{fee_transfer_fee},2.50,'domain_check multi parse fee (fee_transfer_fee) 1/4'); -is($d->{fee_renewal_fee},10.00,'domain_check multi parse fee (fee_renewal_fee) 1/4'); +is($d->{fee},'12.50','domain_check multi get_info(fee) 3/4'); +is($d->{fee_transfer_fee},'2.50','domain_check multi parse fee (fee_transfer_fee) 1/4'); +is($d->{fee_renewal_fee},'10.00','domain_check multi parse fee (fee_renewal_fee) 1/4'); $d = shift @{$dri->get_info('fee','domain','restaurants.space')}; is($d->{domain},'restaurants.space','domain_check multi get_info(domain) 4/4'); is($d->{premium},1,'domain_check multi parse premium 4/4'); is($d->{currency},'GBP','domain_check multi get_info(currency) 4/4'); is($d->{action},'restore','domain_check multi get_info(action) 4/4'); -is($d->{fee},25,'domain_check multi get_info(fee) 3/4'); -is($d->{fee_restore_fee},25.00,'domain_check multi parse fee (fee_redstore_fee) 4/4'); +is($d->{fee},'25.00','domain_check multi get_info(fee) 3/4'); +is($d->{fee_restore_fee},'25.00','domain_check multi parse fee (fee_restore_fee) 4/4'); # using the standardised methods is($dri->get_info('is_premium','domain','hotels.space'),0,'domain_check_multi get_info (is_premium) undef'); is($dri->get_info('price_duration','domain','tourism.space')->years(),1,'domain_check get_info (price_duration)'); -is($dri->get_info('create_price','domain','holidays.space'),5.00,'domain_check_multi get_info (create_price)'); -is($dri->get_info('transfer_price','domain','hotels.space'),12.50,'domain_check_multi get_info (transfer_price)'); -is($dri->get_info('restore_price','domain','restaurants.space'),25,'domain_check_multi get_info (restore_price)'); +is($dri->get_info('create_price','domain','holidays.space'),'5.00','domain_check_multi get_info (create_price)'); +is($dri->get_info('transfer_price','domain','hotels.space'),'12.50','domain_check_multi get_info (transfer_price)'); +is($dri->get_info('restore_price','domain','restaurants.space'),'25.00','domain_check_multi get_info (restore_price)'); #################################################################################################### ### Copied From fee-0.7 tests with only namespace changed @@ -115,12 +115,12 @@ is($d->{domain},'check-claims-landrush.space','Fee extension: domain_check singl is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'create','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); -is($d->{fee_application_fee},150.00,'Fee extension: domain_check singe parse fee (fee_application_fee)'); -is($d->{fee_registration_fee},500.00,'Fee extension: domain_check singe parse fee (fee_registration_fee)'); -is($d->{fee},650.00,'Fee extension: domain_check singe parse fee'); -is($d->{phase},'claims','Fee extension: domain_check singe parse phase'); -is($d->{sub_phase},'landrush','Fee extension: domain_check singe parse sub_phase'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); +is($d->{fee_application_fee},'150.00','Fee extension: domain_check single parse fee (fee_application_fee)'); +is($d->{fee_registration_fee},'500.00','Fee extension: domain_check single parse fee (fee_registration_fee)'); +is($d->{fee},'650.00','Fee extension: domain_check single parse fee'); +is($d->{phase},'claims','Fee extension: domain_check single parse phase'); +is($d->{sub_phase},'landrush','Fee extension: domain_check single parse sub_phase'); # domain_check_price $R2=$E1.''.r().'check-sunrise.spacecheck-sunrise.spacecheck-sunrise.spaceUSDcreate15000.00premiumcheck-sunrise.spaceUSDrenew19.95premiumcheck-sunrise.spaceUSDtransfer19.95premiumcheck-sunrise.spaceUSDrestore19.95premium'.$TRID.''.$E2; @@ -134,8 +134,8 @@ is($d->{premium},1,'Fee extension: domain_check_price single parse premium'); is($d->{currency},'USD','Fee extension: domain_check_price single parse currency'); is($d->{action},'create','Fee extension: domain_check_price single parse action'); is($d->{duration}->years(),1,'Fee extension: domain_check_price single parse duration'); -is($d->{fee_registration_fee},5000.00,'Fee extension: domain_check_price single parse fee (fee_registration_fee)'); -is($d->{fee},5000.00,'Fee extension: domain_check_price single parse fee'); +is($d->{fee_registration_fee},'5000.00','Fee extension: domain_check_price single parse fee (fee_registration_fee)'); +is($d->{fee},'5000.00','Fee extension: domain_check_price single parse fee'); is($d->{phase},'sunrise','Fee extension: domain_check_price single parse phase'); # using the standardised methods is($dri->get_info('is_premium'),1,'domain_check get_info (is_premium) undef'); # NOT SUPPORTED @@ -143,10 +143,10 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),1,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),5000,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price'),9.95,'domain_check get_info (renew_price) undef'); -is($dri->get_info('transfer_price'),9.95,'domain_check get_info (transfer_price) undef'); -is($dri->get_info('restore_price'),9.95,'domain_check get_info (restore_price) undef'); +is($dri->get_info('create_price'),'5000.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price'),'9.95','domain_check get_info (renew_price) undef'); +is($dri->get_info('transfer_price'),'9.95','domain_check get_info (transfer_price) undef'); +is($dri->get_info('restore_price'),'9.95','domain_check get_info (restore_price) undef'); ## domain create $R2=$E1.''.r().'exdomain.space1999-04-03T22:00:00.0Z2001-04-03T22:00:00.0ZUSD15.00-5.001000.00'.$TRID.''.$E2; @@ -162,9 +162,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.11.t b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.11.t index c9a165ed2..a7e7314ea 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.11.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.11.t @@ -69,9 +69,9 @@ is($d->{action},'create','domain_check multi get_info(action) 1/4'); is($d->{phase},'sunrise','domain_check multi get_info(phase) 1/4'); is($d->{sub_phase},undef,'domain_check multi get_info(sub_phase) 1/4'); is($d->{duration}->years(),'1','domain_check multi get_info(duration) 1/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 1/4'); -#is($d->{fee_application_fee},5.00,'domain_check multi parse fee (fee_application_fee) 1/4'); -is($d->{fee_registration_fee},5.00,'domain_check multi parse fee (fee_registration_fee) 1/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 1/4'); +#is($d->{fee_application_fee},'5.00','domain_check multi parse fee (fee_application_fee) 1/4'); +is($d->{fee_registration_fee},'5.00','domain_check multi parse fee (fee_registration_fee) 1/4'); is($d->{grace_period},'P5D','domain_check multi parse fee (grace_period) 1/4'); is($d->{refundable},'1','domain_check multi parse fee (refundable) 1/4'); $d = shift @{$dri->get_info('fee','domain','holidays.space')}; @@ -82,7 +82,7 @@ is($d->{action},'create','domain_check multi get_info(action) 2/4'); is($d->{phase},'claims','domain_check multi get_info(phase) 2/4'); is($d->{sub_phase},'landrush','domain_check multi get_info(sub_phase) 2/4'); is($d->{duration}->years(),'2','domain_check multi get_info(duration) 2/4'); -is($d->{fee},5.00,'domain_check multi get_info(fee) 2/4'); +is($d->{fee},'5.00','domain_check multi get_info(fee) 2/4'); $d = shift @{$dri->get_info('fee','domain','hotels.space')}; is($d->{domain},'hotels.space','domain_check multi get_info(domain) 3/4'); is($d->{premium},0,'domain_check multi parse premium 3/4'); @@ -97,9 +97,9 @@ is($d->{reason},'minimum period is 2 years.','domain_check multi parse fee (reas # Note: we can no longer check different types in one command - so create only here is($dri->get_info('is_premium','domain','hotels.space'),0,'domain_check_multi get_info (is_premium) undef'); is($dri->get_info('price_duration','domain','tourism.space')->years(),1,'domain_check get_info (price_duration)'); -is($dri->get_info('create_price','domain','holidays.space'),5.00,'domain_check_multi get_info (create_price)'); -#is($dri->get_info('transfer_price','domain','hotels.space'),12.50,'domain_check_multi get_info (transfer_price)'); -#is($dri->get_info('restore_price','domain','restaurants.space'),25,'domain_check_multi get_info (restore_price)'); +is($dri->get_info('create_price','domain','holidays.space'),'5.00','domain_check_multi get_info (create_price)'); +#is($dri->get_info('transfer_price','domain','hotels.space'),'12.50','domain_check_multi get_info (transfer_price)'); +#is($dri->get_info('restore_price','domain','restaurants.space'),'25.00','domain_check_multi get_info (restore_price)'); #################################################################################################### ### Copied From fee-0.9 tests an manually adjusted @@ -117,9 +117,9 @@ is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{class},'premium','Fee extension: domain_check single parse class'); is($d->{currency},'EUR','Fee extension: domain_check single parse currency'); is($d->{action},'renew','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),2,'Fee extension: domain_check singe parse duration'); +is($d->{duration}->years(),2,'Fee extension: domain_check single parse duration'); is($d->{grace_period},'P5D','domain_check multi single fee (grace_period) 1/4'); -is($d->{fee},650.00,'Fee extension: domain_check single parse fee'); +is($d->{fee},'650.00','Fee extension: domain_check single parse fee'); $dri->cache_clear(); @@ -135,8 +135,8 @@ is($d->{premium},1,'Fee extension: domain_check_price single parse premium'); is($d->{currency},'USD','Fee extension: domain_check_price single parse currency'); is($d->{action},'create','Fee extension: domain_check_price single parse action'); is($d->{duration}->years(),2,'Fee extension: domain_check_price single parse duration'); -is($d->{fee_registration_fee},5000.00,'Fee extension: domain_check_price single parse fee (fee_registration_fee)'); -is($d->{fee},5000.00,'Fee extension: domain_check_price single parse fee'); +is($d->{fee_registration_fee},'5000.00','Fee extension: domain_check_price single parse fee (fee_registration_fee)'); +is($d->{fee},'5000.00','Fee extension: domain_check_price single parse fee'); is($d->{phase},'sunrise','Fee extension: domain_check_price single parse phase'); # using the standardised methods @@ -146,10 +146,10 @@ isa_ok($dri->get_info('price_duration'),'DateTime::Duration','domain_check get_i is($dri->get_info('price_duration')->years(),2,'domain_check get_info (price_duration)'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_category'),'premium','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),5000,'domain_check get_info (create_price)'); -#is($dri->get_info('renew_price'),9.95,'domain_check get_info (renew_price) undef'); -#is($dri->get_info('transfer_price'),9.95,'domain_check get_info (transfer_price) undef'); -#is($dri->get_info('restore_price'),9.95,'domain_check get_info (restore_price) undef'); +is($dri->get_info('create_price'),'5000.00','domain_check get_info (create_price)'); +#is($dri->get_info('renew_price'),'9.95','domain_check get_info (renew_price) undef'); +#is($dri->get_info('transfer_price'),'9.95','domain_check get_info (transfer_price) undef'); +#is($dri->get_info('restore_price'),'9.95','domain_check get_info (restore_price) undef'); ## domain create $R2=$E1.''.r().'exdomain.space1999-04-03T22:00:00.0Z2001-04-03T22:00:00.0ZUSD15.00-5.001000.00'.$TRID.''.$E2; @@ -165,9 +165,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.21.t b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.21.t index abc5cf924..e95cc8755 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.21.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-0.21.t @@ -79,7 +79,7 @@ is($d->{domain},'explore-0.space','domain_check get_info(domain)'); is($d->{price_avail},1,'domain_check parse fee (price_avail)'); is($d->{premium},0,'domain_check parse premium'); is($d->{currency},'USD','domain_check get_info(currency)'); -is($d->{command}->{create}->{fee},10.00,'domain_check get_info(fee)'); +is($d->{command}->{create}->{fee},'10.00','domain_check get_info(fee)'); is($d->{command}->{create}->{phase},undef,'domain_check get_info(phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check get_info(sub_phase)'); is($d->{command}->{create}->{duration}->years(),'2','domain_check get_info(duration)'); @@ -87,7 +87,7 @@ is($d->{command}->{create}->{duration}->years(),'2','domain_check get_info(durat # using the standardised methods is($dri->get_info('is_premium'),0,'domain_checkget_info (is_premium) 0'); is($dri->get_info('price_currency'),'USD','domain_check get_info (price_currency)'); -is($dri->get_info('create_price'),10.00,'domain_check get_info (create_price)'); +is($dri->get_info('create_price'),'10.00','domain_check get_info (create_price)'); ################### ###### domain_check_multi @@ -125,30 +125,30 @@ is($d->{domain},'explore.space','domain_check get_info(domain)'); is($d->{price_avail},1,'domain_check parse fee (price_avail)'); is($d->{premium},0,'domain_check parse premium'); is($d->{currency},'USD','domain_check get_info(currency)'); -is($d->{command}->{create}->{fee},10.00,'domain_check multi get_info(create fee)'); +is($d->{command}->{create}->{fee},'10.00','domain_check multi get_info(create fee)'); is($d->{command}->{create}->{phase},undef,'domain_check multi get_info(create phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check multi get_info(create sub_phase)'); is($d->{command}->{create}->{duration}->years(),'2','domain_check multi get_info(create duration)'); -is($d->{command}->{renew}->{fee},5,'domain_check multi get_info(renew fee)'); -is($d->{command}->{transfer}->{fee},5,'domain_check multi get_info(renew fee)'); -is($d->{command}->{restore}->{fee},5,'domain_check multi get_info(restore fee)'); +is($d->{command}->{renew}->{fee},'5.00','domain_check multi get_info(renew fee)'); +is($d->{command}->{transfer}->{fee},'5.00','domain_check multi get_info(renew fee)'); +is($d->{command}->{restore}->{fee},'5.00','domain_check multi get_info(restore fee)'); # using the standardised methods is($dri->get_info('is_premium','domain','explore.space'),0,'domain_check get_info (is_premium) undef'); is($dri->get_info('price_currency','domain','explore.space'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_duration','domain','explore.space')->years(),2,'domain_check get_info (price_currency)'); -is($dri->get_info('create_price','domain','explore.space'),10.00,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price','domain','explore.space'),5.00,'domain_check get_info (renew_price)'); -is($dri->get_info('transfer_price','domain','explore.space'),5.00,'domain_check get_info (transfer_price)'); -is($dri->get_info('restore_price','domain','explore.space'),5.00,'domain_check get_info (restpre_price)'); +is($dri->get_info('create_price','domain','explore.space'),'10.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price','domain','explore.space'),'5.00','domain_check get_info (renew_price)'); +is($dri->get_info('transfer_price','domain','explore.space'),'5.00','domain_check get_info (transfer_price)'); +is($dri->get_info('restore_price','domain','explore.space'),'5.00','domain_check get_info (restpre_price)'); is($dri->get_info('is_premium','domain','discover.space'),0,'domain_check get_info (is_premium) undef'); is($dri->get_info('price_currency','domain','discover.space'),'USD','domain_check get_info (price_currency)'); is($dri->get_info('price_duration','domain','discover.space')->years(),5,'domain_check get_info (price_currency)'); -is($dri->get_info('create_price','domain','discover.space'),25.00,'domain_check get_info (create_price)'); -is($dri->get_info('renew_price','domain','discover.space'),5.00,'domain_check get_info (renew_price)'); -is($dri->get_info('transfer_price','domain','discover.space'),5.00,'domain_check get_info (transfer_price)'); -is($dri->get_info('restore_price','domain','discover.space'),5.00,'domain_check get_info (restpre_price)'); +is($dri->get_info('create_price','domain','discover.space'),'25.00','domain_check get_info (create_price)'); +is($dri->get_info('renew_price','domain','discover.space'),'5.00','domain_check get_info (renew_price)'); +is($dri->get_info('transfer_price','domain','discover.space'),'5.00','domain_check get_info (transfer_price)'); +is($dri->get_info('restore_price','domain','discover.space'),'5.00','domain_check get_info (restpre_price)'); $d = shift @{$dri->get_info('fee','domain','colonize.space')}; @@ -177,13 +177,13 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); # using the standardised methods is($dri->get_info('price_currency'),'USD','domain_create get_info (price_currency)'); -is($dri->get_info('create_price'),5,'domain_create get_info (create_price)'); +is($dri->get_info('create_price'),'5.00','domain_create get_info (create_price)'); ################### ###### domain_create with multiple fee elements @@ -203,9 +203,9 @@ $rc=$dri->domain_delete('explore.space'); is($rc->is_success(),1,'domain_delete is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_delete parse currency'); -is($d->{credit},-5.00,'Fee extension: domain_delete parse credit'); +is($d->{credit},'-5.00','Fee extension: domain_delete parse credit'); is($d->{description},'AGP Credit','Fee extension: domain_delete parse credit description'); -is($d->{balance},1005.00,'Fee extension: domain_delete parse balance'); +is($d->{balance},'1005.00','Fee extension: domain_delete parse balance'); ################### @@ -217,11 +217,11 @@ is_string($R1,$E1.'is_success(),1,'domain_transfer is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_transfer parse currency'); -is($d->{fee},5.00,'Fee extension: domain_transfer parse fee'); +is($d->{fee},'5.00','Fee extension: domain_transfer parse fee'); # using the standardised methods is($dri->get_info('price_currency'),'USD','domain_transfer get_info (price_currency)'); -is($dri->get_info('transfer_price'),5,'domain_transfer get_info (transfer_price)'); +is($dri->get_info('transfer_price'),'5.00','domain_transfer get_info (transfer_price)'); ################### @@ -252,11 +252,11 @@ is_string($R1,$E1.'is_success(),1,'domain_renew is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_renew parse currency'); -is($d->{fee},5.00,'Fee extension: domain_renew parse fee'); +is($d->{fee},'5.00','Fee extension: domain_renew parse fee'); # using the standardised methods is($dri->get_info('price_currency'),'USD','domain_renew get_info (price_currency)'); -is($dri->get_info('renew_price'),5,'domain_renew get_info (renew_price)'); +is($dri->get_info('renew_price'),'5.00','domain_renew get_info (renew_price)'); @@ -261,11 +261,11 @@ is_string($R1,$E1.'is_success(),1,'domain_transfer is is_success'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_transfer parse currency'); -is($d->{fee},5.00,'Fee extension: domain_transfer parse fee'); +is($d->{fee},'5.00','Fee extension: domain_transfer parse fee'); # using the standardised methods is($dri->get_info('price_currency'),'USD','domain_transfer get_info (price_currency)'); -is($dri->get_info('transfer_price'),5,'domain_transfer get_info (transfer_price)'); +is($dri->get_info('transfer_price'),'5.00','domain_transfer get_info (transfer_price)'); ################### @@ -280,11 +280,11 @@ is_string($R1,$E1.'crrc.in2016-04-11T07:31:58.0Z2017-04-11T07:31:58.0ZINR100.009664204.00'.$TRID.''.$E2; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t index 9ce8fefe9..0b5f98cd6 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t @@ -48,8 +48,8 @@ is($d->{domain},'crrc.top','Fee extension: domain_check single parse domain'); is($d->{premium},1,'Fee extension: domain_check single parse premium'); is($d->{currency},'CNY','Fee extension: domain_check single parse currency'); is($d->{action},'create','Fee extension: domain_check single parse action'); -is($d->{duration}->years(),1,'Fee extension: domain_check singe parse duration'); -is($d->{fee},100.00,'Fee extension: domain_check singe parse fee'); +is($d->{duration}->years(),1,'Fee extension: domain_check single parse duration'); +is($d->{fee},'100.00','Fee extension: domain_check single parse fee'); ## fee-create $R2=$E1.''.r().'crrc.top2016-04-11T07:31:58.0Z2017-04-11T07:31:58.0ZCNY100.009664204.00'.$TRID.''.$E2; From d0be8b971087d451a0ad5ba63c23e038b55d3e7f Mon Sep 17 00:00:00 2001 From: Paulo Jorge Date: Wed, 26 Jan 2022 15:54:24 +0000 Subject: [PATCH 2/5] update some more tests + display some examples --- t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t | 6 +++--- t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t | 5 +++++ t/Net/DRI/Protocol/EPP/Extensions/IN.t | 4 ++-- t/Net/DRI/Protocol/EPP/Extensions/KNET.t | 11 +++++++++-- t/Net/DRI/Protocol/EPP/Extensions/Nominet/Amazon.t | 6 +++--- t/Net/DRI/Protocol/EPP/Extensions/UniRegistry/DM.t | 6 +++--- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t b/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t index c88a25a85..9c1786be3 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/AFNIC_gTLD.t @@ -103,9 +103,9 @@ is($d->{domain},'foobar.paris','domain_check get_info(domain)'); is($d->{price_avail},1,'domain_check parse fee (price_avail)'); is($d->{premium},0,'domain_check parse premium'); is($d->{currency},'USD','domain_check get_info(currency)'); -is($d->{command}->{create}->{fee_registration_fee},10.00,'domain_check get_info(fee_registration_fee)'); -is($d->{command}->{create}->{fee_application_fee},500.00,'domain_check get_info(fee_application_fee)'); -is($d->{command}->{create}->{fee},510.00,'domain_check get_info(fee)'); # fees are added together for the total. this is debateable! +is($d->{command}->{create}->{fee_registration_fee},'10.00','domain_check get_info(fee_registration_fee)'); +is($d->{command}->{create}->{fee_application_fee},'500.00','domain_check get_info(fee_application_fee)'); +is($d->{command}->{create}->{fee},'510.00','domain_check get_info(fee)'); # fees are added together for the total. this is debateable! is($d->{command}->{create}->{description},'Registration Fee (Refundable) (Grace=>P5D),Application Fee (Applied=>immediate)','domain_check get_info(description)'); # descriptions melded into a string is($d->{command}->{create}->{phase},'sunrise','domain_check get_info(phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check get_info(sub_phase)'); diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t index c793d0320..a916ca8dc 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t @@ -7,6 +7,7 @@ use Net::DRI; use Net::DRI::Data::Raw; use DateTime::Duration; use Data::Dumper; +use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util use Test::More tests => 146; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -337,6 +338,10 @@ is($d->{currency},'USD','domain_check get_info(currency)'); is($d->{command}->{create}->{fee_registration_fee},'10.00','domain_check get_info(fee_registration_fee)'); is($d->{command}->{create}->{fee_application_fee},'500.00','domain_check get_info(fee_application_fee)'); is($d->{command}->{create}->{fee},'510.00','domain_check get_info(fee)'); # fees are added together for the total. this is debateable! +# double check if its a number for each case: registration, application and both reg+appl +is( looks_like_number($d->{command}->{create}->{fee_registration_fee}), 1, 'fee_registration_fee is a number' ); +is( looks_like_number($d->{command}->{create}->{fee_application_fee}), 1, 'fee_application_fee is a number' ); +is( looks_like_number($d->{command}->{create}->{fee}), 1, 'fee_application_fee is a number' ); is($d->{command}->{create}->{description},'Registration Fee (Refundable) (Grace=>P5D),Application Fee (Applied=>immediate)','domain_check get_info(description)'); # descriptions melded into a string is($d->{command}->{create}->{phase},'sunrise','domain_check get_info(phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check get_info(sub_phase)'); diff --git a/t/Net/DRI/Protocol/EPP/Extensions/IN.t b/t/Net/DRI/Protocol/EPP/Extensions/IN.t index bb692d1f3..924b20c43 100755 --- a/t/Net/DRI/Protocol/EPP/Extensions/IN.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/IN.t @@ -173,8 +173,8 @@ is($rc->is_success(),1,'fee 0.6 extension: domain_create is is_success'); is($dri->get_info('action'),'create','fee 0.6 extension: domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'INR','fee 0.6 extension: domain_create parse currency'); -is($d->{fee},100.00,'fee 0.6 extension: domain_create parse fee'); -is($d->{balance},9664204.00,'fee 0.6 extension: domain_create parse balance'); +is($d->{fee},'100.00','fee 0.6 extension: domain_create parse fee'); +is($d->{balance},'9664204.00','fee 0.6 extension: domain_create parse balance'); ##################################################################################################### ######### Closing Commands ######## diff --git a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t index 0b5f98cd6..7bb4c9680 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t @@ -6,6 +6,7 @@ use warnings; use Net::DRI; use Net::DRI::Data::Raw; use DateTime::Duration; +use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util use Test::More tests => 16; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -65,8 +66,14 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'CNY','Fee extension: domain_create parse currency'); -is($d->{fee},100.00,'Fee extension: domain_create parse fee'); -is($d->{balance},9664204.00,'Fee extension: domain_create parse balance'); +is($d->{fee},100.00,'Fee extension: domain_create parse fee'); # README: THIS TEST IS NOT CORRECT! Truncating 100.00 => should be represent under single quotes +is($d->{balance},9664204.00,'Fee extension: domain_create parse balance'); # ... SAME HERE +# README lets assure its a number :p +is( looks_like_number($d->{fee}), 1, 'fee is a number' ); +is( looks_like_number($d->{balance}), 1, 'balance is a number' ); +# END README lets assure its a number :p +is($d->{fee},'100.00','Fee extension: domain_create parse fee'); +is($d->{balance},'9664204.00','Fee extension: domain_create parse balance'); #################################################################################################### exit 0; diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Nominet/Amazon.t b/t/Net/DRI/Protocol/EPP/Extensions/Nominet/Amazon.t index 997feb5cc..eb6f8295d 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Nominet/Amazon.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Nominet/Amazon.t @@ -97,9 +97,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); ### # domain check multi - transition from Neustar to Nominet phase 2 diff --git a/t/Net/DRI/Protocol/EPP/Extensions/UniRegistry/DM.t b/t/Net/DRI/Protocol/EPP/Extensions/UniRegistry/DM.t index d7b1cb159..fb0dcac1b 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/UniRegistry/DM.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/UniRegistry/DM.t @@ -156,9 +156,9 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'USD','Fee extension: domain_create parse currency'); -is($d->{fee},5.00,'Fee extension: domain_create parse fee'); -is($d->{balance},-5.00,'Fee extension: domain_create parse balance'); -is($d->{credit_limit},1000.00,'Fee extension: domain_create parse credit limit'); +is($d->{fee},'5.00','Fee extension: domain_create parse fee'); +is($d->{balance},'-5.00','Fee extension: domain_create parse balance'); +is($d->{credit_limit},'1000.00','Fee extension: domain_create parse credit limit'); #Create Second LVL domain $R2=$E1.''.r().'example3.com.dm2010-08-10T15:38:26.623854Z2012-08-10T15:38:26.623854Z'.$TRID.''.$E2; From b2443e15e57e1304981b363591e65363c30e8262 Mon Sep 17 00:00:00 2001 From: Paulo Jorge Date: Wed, 26 Jan 2022 16:20:03 +0000 Subject: [PATCH 3/5] extra tests from new module --- t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t | 4 ++++ t/Net/DRI/Protocol/EPP/Extensions/KNET.t | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t index a916ca8dc..76176f2c8 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t @@ -8,6 +8,7 @@ use Net::DRI::Data::Raw; use DateTime::Duration; use Data::Dumper; use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util +use String::Numeric qw(is_decimal); # lets add extra set of tests: Fee (standard) and BrownFee (only under KNET) use Test::More tests => 146; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -342,6 +343,9 @@ is($d->{command}->{create}->{fee},'510.00','domain_check get_info(fee)'); # fees is( looks_like_number($d->{command}->{create}->{fee_registration_fee}), 1, 'fee_registration_fee is a number' ); is( looks_like_number($d->{command}->{create}->{fee_application_fee}), 1, 'fee_application_fee is a number' ); is( looks_like_number($d->{command}->{create}->{fee}), 1, 'fee_application_fee is a number' ); +is( is_decimal($d->{command}->{create}->{fee_registration_fee}), 1, 'fee_registration_fee is a decimal number' ); +is( is_decimal($d->{command}->{create}->{fee_application_fee}), 1, 'fee_application_fee is a decimal number' ); +is( is_decimal($d->{command}->{create}->{fee}), 1, 'fee_application_fee is a decimal number' ); is($d->{command}->{create}->{description},'Registration Fee (Refundable) (Grace=>P5D),Application Fee (Applied=>immediate)','domain_check get_info(description)'); # descriptions melded into a string is($d->{command}->{create}->{phase},'sunrise','domain_check get_info(phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check get_info(sub_phase)'); diff --git a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t index 7bb4c9680..8d7dd9398 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t @@ -7,6 +7,7 @@ use Net::DRI; use Net::DRI::Data::Raw; use DateTime::Duration; use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util +use String::Numeric qw(is_decimal); # lets add extra set of tests: Fee (standard) and BrownFee (only under KNET) use Test::More tests => 16; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -71,6 +72,10 @@ is($d->{balance},9664204.00,'Fee extension: domain_create parse balance'); # ... # README lets assure its a number :p is( looks_like_number($d->{fee}), 1, 'fee is a number' ); is( looks_like_number($d->{balance}), 1, 'balance is a number' ); +is( is_decimal($d->{fee}), 1, 'fee is a decimal' ); +is( is_decimal($d->{balance}), 1, 'balance is a decimal' ); +# extra module/test to checks if it's a decimal!!! + # END README lets assure its a number :p is($d->{fee},'100.00','Fee extension: domain_create parse fee'); is($d->{balance},'9664204.00','Fee extension: domain_create parse balance'); From 25b52686e86c1d73aa9d39d4d94fef4579477cf0 Mon Sep 17 00:00:00 2001 From: Paulo Jorge Date: Wed, 26 Jan 2022 16:58:50 +0000 Subject: [PATCH 4/5] extra temp debug lines --- t/Net/DRI/Protocol/EPP/Extensions/KNET.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t index 8d7dd9398..526107653 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t @@ -69,11 +69,16 @@ $d=$rc->get_data('fee'); is($d->{currency},'CNY','Fee extension: domain_create parse currency'); is($d->{fee},100.00,'Fee extension: domain_create parse fee'); # README: THIS TEST IS NOT CORRECT! Truncating 100.00 => should be represent under single quotes is($d->{balance},9664204.00,'Fee extension: domain_create parse balance'); # ... SAME HERE +my $float=100.00; +use Data::Dumper; print Dumper($float); print ("\n$float\n"); +is($float,100.00,'This test passing BUT Perl displays 100 and not 100.00'); # Perl is truncating the number +is($float,'100.00','Test failing because '); # because return 100 - why so many tests with fees set as INT positive number are passing when they shouldn't :( + # README lets assure its a number :p is( looks_like_number($d->{fee}), 1, 'fee is a number' ); is( looks_like_number($d->{balance}), 1, 'balance is a number' ); -is( is_decimal($d->{fee}), 1, 'fee is a decimal' ); -is( is_decimal($d->{balance}), 1, 'balance is a decimal' ); +is( is_decimal($d->{fee}), 0, 'fee is a decimal' ); +is( is_decimal($d->{balance}), 0, 'balance is a decimal' ); # extra module/test to checks if it's a decimal!!! # END README lets assure its a number :p From e1b48310a890e4271c9704d881d47c9c0a856fab Mon Sep 17 00:00:00 2001 From: Paulo Jorge Date: Fri, 28 Jan 2022 10:16:06 +0000 Subject: [PATCH 5/5] remove debug tests: look_like_number and is_decimal --- t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t | 9 --------- t/Net/DRI/Protocol/EPP/Extensions/KNET.t | 17 ----------------- 2 files changed, 26 deletions(-) diff --git a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t index 76176f2c8..c793d0320 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/Fee/Fee-1.0.t @@ -7,8 +7,6 @@ use Net::DRI; use Net::DRI::Data::Raw; use DateTime::Duration; use Data::Dumper; -use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util -use String::Numeric qw(is_decimal); # lets add extra set of tests: Fee (standard) and BrownFee (only under KNET) use Test::More tests => 146; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -339,13 +337,6 @@ is($d->{currency},'USD','domain_check get_info(currency)'); is($d->{command}->{create}->{fee_registration_fee},'10.00','domain_check get_info(fee_registration_fee)'); is($d->{command}->{create}->{fee_application_fee},'500.00','domain_check get_info(fee_application_fee)'); is($d->{command}->{create}->{fee},'510.00','domain_check get_info(fee)'); # fees are added together for the total. this is debateable! -# double check if its a number for each case: registration, application and both reg+appl -is( looks_like_number($d->{command}->{create}->{fee_registration_fee}), 1, 'fee_registration_fee is a number' ); -is( looks_like_number($d->{command}->{create}->{fee_application_fee}), 1, 'fee_application_fee is a number' ); -is( looks_like_number($d->{command}->{create}->{fee}), 1, 'fee_application_fee is a number' ); -is( is_decimal($d->{command}->{create}->{fee_registration_fee}), 1, 'fee_registration_fee is a decimal number' ); -is( is_decimal($d->{command}->{create}->{fee_application_fee}), 1, 'fee_application_fee is a decimal number' ); -is( is_decimal($d->{command}->{create}->{fee}), 1, 'fee_application_fee is a decimal number' ); is($d->{command}->{create}->{description},'Registration Fee (Refundable) (Grace=>P5D),Application Fee (Applied=>immediate)','domain_check get_info(description)'); # descriptions melded into a string is($d->{command}->{create}->{phase},'sunrise','domain_check get_info(phase)'); is($d->{command}->{create}->{sub_phase},undef,'domain_check get_info(sub_phase)'); diff --git a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t index 526107653..f0886bfca 100644 --- a/t/Net/DRI/Protocol/EPP/Extensions/KNET.t +++ b/t/Net/DRI/Protocol/EPP/Extensions/KNET.t @@ -6,8 +6,6 @@ use warnings; use Net::DRI; use Net::DRI::Data::Raw; use DateTime::Duration; -use Scalar::Util qw(looks_like_number); # README: lets do a temp debug to run all tests AND trigger if a fee is not a number! https://perldoc.perl.org/Scalar::Util -use String::Numeric qw(is_decimal); # lets add extra set of tests: Fee (standard) and BrownFee (only under KNET) use Test::More tests => 16; eval { no warnings; require Test::LongString; Test::LongString->import(max => 100); $Test::LongString::Context=50; }; @@ -67,21 +65,6 @@ is($rc->is_success(),1,'domain_create is is_success'); is($dri->get_info('action'),'create','domain_create get_info (action)'); $d=$rc->get_data('fee'); is($d->{currency},'CNY','Fee extension: domain_create parse currency'); -is($d->{fee},100.00,'Fee extension: domain_create parse fee'); # README: THIS TEST IS NOT CORRECT! Truncating 100.00 => should be represent under single quotes -is($d->{balance},9664204.00,'Fee extension: domain_create parse balance'); # ... SAME HERE -my $float=100.00; -use Data::Dumper; print Dumper($float); print ("\n$float\n"); -is($float,100.00,'This test passing BUT Perl displays 100 and not 100.00'); # Perl is truncating the number -is($float,'100.00','Test failing because '); # because return 100 - why so many tests with fees set as INT positive number are passing when they shouldn't :( - -# README lets assure its a number :p -is( looks_like_number($d->{fee}), 1, 'fee is a number' ); -is( looks_like_number($d->{balance}), 1, 'balance is a number' ); -is( is_decimal($d->{fee}), 0, 'fee is a decimal' ); -is( is_decimal($d->{balance}), 0, 'balance is a decimal' ); -# extra module/test to checks if it's a decimal!!! - -# END README lets assure its a number :p is($d->{fee},'100.00','Fee extension: domain_create parse fee'); is($d->{balance},'9664204.00','Fee extension: domain_create parse balance');