Skip Menu |

This queue is for tickets about the Net-UPS CPAN distribution.

Report information
The Basics
Id: 19992
Status: rejected
Priority: 0/
Queue: Net-UPS

People
Owner: Nobody in particular
Requestors: tomt [...] webscope.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Cannot get address suggestions
UPS Tools now seems to support XML based access method ONLY since the tools were moved to new server(s) a while ago... so I'm trying to make use of Net::UPS for a e-commerce site. Problem: I can't get any suggestions for an invalid address via the validate_address() method. The array that is supposed contain the suggestions is empty while it should contain (in my case) 3 suggestions. $address is the UPS address object with the following information: city: valley state: ny zip: 11580 The invalid parameter is the name of the city. The actual city name is 'Valley Stream' not 'Valley'. Here is my code: $ups = Net::UPS->new($my_userid, $my_passwd, $my_access_key); my $addresses = $ups->validate_address($address); unless ( defined $addresses ) { die $ups->errstr; } unless ( @$addresses ) { die "The speciified address is not correct, and there are no suggestions.\n"; } if ( $addresses->[0]->is_match ) { print "Address Matches Exactly!\n"; } else { print "Your address didn't match exactly. Following are some valid suggestions\n"; for( @$addresses ) { printf("%s, %s %s\n", $_->city, $_->state, $_- Show quoted text
>postal_code);
} } It may be worth noting that if the supplied address is an exact match, the addresses array contains 3 elements where the 1st is the exact match and the other 2 are close matches.
Subject: RE: [rt.cpan.org #19992] Cannot get address suggestions
Date: Mon, 19 Jun 2006 20:57:43 -0400
To: <bug-Net-UPS [...] rt.cpan.org>, <"undisclosed-recipients:" [...] bestpractical.com>
From: "Sherzod Ruzmetov" <sherzodr [...] handalak.com>
If $addresses doesn't contain any matches, it means the quality of the matches does not meet the tolerance threshold. You have to loosen it up. Try setting the threshold to 0.75, may be. If that still doesn't return anything, set it to 1, although I don’t recommend that. Again, there is nothing wrong if no suggestions can be provided, as long as it detects that address is invalid, that's enough most of the time. If verrifying addresses and providing address suggestions is the major function of your application, look into Net::USPS instead in the future, which will do better job. Sherzod Show quoted text
> -----Original Message----- > From: Guest via RT [mailto:bug-Net-UPS@rt.cpan.org] > Sent: Monday, June 19, 2006 5:32 PM > To: undisclosed-recipients: > Subject: [rt.cpan.org #19992] Cannot get address suggestions > > > > Mon Jun 19 17:32:13 2006: Request 19992 was acted upon. > Transaction: Ticket created by guest > Queue: Net-UPS > Subject: Cannot get address suggestions > Broken in: (no value) > Severity: Important > Owner: Nobody > Requestors: tomt@webscope.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19992 > > > > UPS Tools now seems to support XML based access method ONLY since the > tools were moved to new server(s) a while ago... so I'm > trying to make > use of Net::UPS for a e-commerce site. > > Problem: I can't get any suggestions for an invalid address via the > validate_address() method. The array that is supposed contain the > suggestions is empty while it should contain (in my case) 3 > suggestions. > > $address is the UPS address object with the following information: > city: valley > state: ny > zip: 11580 > > The invalid parameter is the name of the city. The actual city name > is 'Valley Stream' not 'Valley'. > > Here is my code: > > $ups = Net::UPS->new($my_userid, $my_passwd, $my_access_key); > my $addresses = $ups->validate_address($address); > unless ( defined $addresses ) { > die $ups->errstr; > } > unless ( @$addresses ) { > die "The speciified address is not correct, and there are no > suggestions.\n"; > } > if ( $addresses->[0]->is_match ) { > print "Address Matches Exactly!\n"; > } > else { > print "Your address didn't match exactly. Following are some > valid suggestions\n"; > for( @$addresses ) { > printf("%s, %s %s\n", $_->city, $_->state, $_-
> >postal_code);
> } > } > > > It may be worth noting that if the supplied address is an > exact match, > the addresses array contains 3 elements where the 1st is the exact > match and the other 2 are close matches. > >
this does not look like a bug, and it's been here for ages, closing.