| 1 | ## Domain Registry Interface, EPP Low Balance (EPP-LowBalance-Mapping.pdf) | ||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||
| 3 | ## Copyright (c) 2006-2008,2013,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||
| 5 | ## This file is part of Net::DRI | ||||||||||||||||||||
| 6 | ## | ||||||||||||||||||||
| 7 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||
| 8 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||
| 9 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||
| 10 | ## (at your option) any later version. | ||||||||||||||||||||
| 11 | ## | ||||||||||||||||||||
| 12 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||
| 13 | #################################################################################################### | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | package Net::DRI::Protocol::EPP::Extensions::VeriSign::PollLowBalance; | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | 1 | ▶ | use feature 'state'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | =pod | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | =head1 NAME | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | Net::DRI::Protocol::EPP::Extensions::VeriSign::PollLowBalance - EPP Low Balance Mapping (EPP-LowBalance-Mapping.pdf) for Net::DRI | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head1 DESCRIPTION | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | Please see the README file for details. | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | =head1 SUPPORT | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | For now, support questions should be sent to: | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | =head1 SEE ALSO | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =head1 AUTHOR | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =head1 COPYRIGHT | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | Copyright (c) 2006-2008,2013,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||
| 52 | All rights reserved. | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||
| 55 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||
| 56 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||
| 57 | (at your option) any later version. | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | =cut | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | #################################################################################################### | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | sub register_commands | ||||||||||||||||||||
| 66 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 67 | 0 | my ($class,$version)=@_; | |||||||||||||||||||
| 68 | 0 | my %tmp=( | |||||||||||||||||||
| 69 | lowbalance => [ undef, \&parse ], | ||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 0 | return { 'message' => \%tmp }; | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | sub setup | ||||||||||||||||||||
| 76 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 77 | 0 | my ($class,$po,$version)=@_; | |||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 0 | state $ns = { 'lowbalance' => 'http://www.verisign.com/epp/lowbalance-poll-1.0' }; | |||||||||||||||||||
| 80 | 0 | $po->ns($ns); | |||||||||||||||||||
| 81 | 0 | return; | |||||||||||||||||||
| 82 | } | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | #################################################################################################### | ||||||||||||||||||||
| 85 | |||||||||||||||||||||
| 86 | sub parse | ||||||||||||||||||||
| 87 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
parse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||
| 88 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||||||||
| 89 | 0 | my $mes=$po->message(); | |||||||||||||||||||
| 90 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 0 | my $infdata=$mes->get_response('lowbalance','pollData'); | |||||||||||||||||||
| 93 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 0 | my %w=(action => 'lowbalance_notification'); | |||||||||||||||||||
| 96 | 0 | my $c=$infdata->getFirstChild(); | |||||||||||||||||||
| 97 | 0 | ▶ | while ($c) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 98 | { | ||||||||||||||||||||
| 99 | 0 | ▶ | next unless ($c->nodeType() == 1); ## only for element nodes | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 100 | 0 | ▶ | my $name=$c->localname() || $c->nodeName(); | ||||||||||||||||||
|
Condition0%0/3
$c->localname || $c->nodeName
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname
$c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
| |||||||||||||||||||||
| 101 | 0 | ▶ | next unless $name; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | 0 | ▶ | if ($name=~m/^(registrarName|creditLimit|availableCredit)$/) | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 104 | { | ||||||||||||||||||||
| 105 | 0 | $w{Net::DRI::Util::remcam($name)}=$c->getFirstChild()->getData(); | |||||||||||||||||||
| 106 | } elsif ($name eq 'creditThreshold') | ||||||||||||||||||||
| 107 | { | ||||||||||||||||||||
| 108 | 0 | $w{Net::DRI::Util::remcam($name)}=$c->getFirstChild()->getData(); | |||||||||||||||||||
| 109 | 0 | $w{'credit_threshold_type'}=$c->getAttribute('type'); | |||||||||||||||||||
| 110 | } | ||||||||||||||||||||
| 111 | 0 | } continue { $c=$c->getNextSibling(); } | |||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 0 | $rinfo->{session}->{lowbalance}=\%w; | |||||||||||||||||||
| 114 | 0 | return; | |||||||||||||||||||
| 115 | } | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | #################################################################################################### | ||||||||||||||||||||
| 118 | 1 | 1; | |||||||||||||||||||