@@ -13,7 +13,7 @@ class can handle up to 100 addresses for validation.
1313# Set this to the INFO level to see the response from Fedex printed in stdout.
1414logging .basicConfig (level = logging .INFO )
1515
16- # This is the object that will be handling our tracking request.
16+ # This is the object that will be handling our avs request.
1717# We're using the FedexConfig object from example_config.py in this dir.
1818customer_transaction_id = "*** AddressValidation Request v4 using Python ***" # Optional transaction_id
1919# Optional locale & language client data
@@ -68,27 +68,35 @@ class can handle up to 100 addresses for validation.
6868# Overall end result of the query
6969for i in range (len (avs_request .response .AddressResults )):
7070
71- print ("Details for Address" , i + 1 )
72- print ("The validated street is:" , avs_request .response .AddressResults [i ].EffectiveAddress .StreetLines )
73- print ("The validated city is:" , avs_request .response .AddressResults [i ].EffectiveAddress .City )
74- print ("The validated state code is:" , avs_request .response .AddressResults [i ].EffectiveAddress .StateOrProvinceCode )
75- print ("The validated postal code is:" , avs_request .response .AddressResults [i ].EffectiveAddress .PostalCode )
76- print ("The validated country code is:" , avs_request .response .AddressResults [i ].EffectiveAddress .CountryCode )
71+ print ("Details for Address {}" .format (i + 1 ))
72+ print ("The validated street is: {}"
73+ "" .format (avs_request .response .AddressResults [i ].EffectiveAddress .StreetLines ))
74+ print ("The validated city is: {}"
75+ "" .format (avs_request .response .AddressResults [i ].EffectiveAddress .City ))
76+ print ("The validated state code is: {}"
77+ "" .format (avs_request .response .AddressResults [i ].EffectiveAddress .StateOrProvinceCode ))
78+ print ("The validated postal code is: {}"
79+ "" .format (avs_request .response .AddressResults [i ].EffectiveAddress .PostalCode ))
80+ print ("The validated country code is: {}"
81+ "" .format (avs_request .response .AddressResults [i ].EffectiveAddress .CountryCode ))
7782
7883 # Can be used to determine the address classification to figure out if Residential fee should apply.
7984 # MIXED, RESIDENTIAL, UNKNOWN, BUSINESS
80- print ("The validated address is residential:" , avs_request .response .AddressResults [i ].Classification != 'BUSINESS' )
85+ print ("The validated address is residential: {}"
86+ "" .format (avs_request .response .AddressResults [i ].Classification != 'BUSINESS' ))
8187
8288 # Getting the optional attributes if available
8389 for j in range (len (avs_request .response .AddressResults [i ].Attributes )):
8490 cur_attribute = avs_request .response .AddressResults [i ].Attributes [j ]
8591 if cur_attribute .Name == "CountrySupported" :
86- print ("Supported Country:" , cur_attribute .Value == 'true' )
92+ print ("Supported Country: {}" . format ( cur_attribute .Value == 'true' ) )
8793 if cur_attribute .Name == "SuiteRequiredButMissing" :
88- print ("Missing Suite:" , cur_attribute .Value == 'true' )
94+ print ("Missing Suite: {}" . format ( cur_attribute .Value == 'true' ) )
8995 if cur_attribute .Name == "CountrySupported" :
90- print ("Invalid Suite:" , cur_attribute .Value == 'true' )
96+ print ("Invalid Suite: {}" . format ( cur_attribute .Value == 'true' ) )
9197 if cur_attribute .Name == "MultipleMatches" :
92- print ("Multiple Matches:" , cur_attribute .Value == 'true' )
98+ print ("Multiple Matches: {}" . format ( cur_attribute .Value == 'true' ) )
9399 if cur_attribute .Name == "POBox" :
94- print ("Is POBox:" , cur_attribute .Value == 'true' )
100+ print ("Is POBox: {}" .format (cur_attribute .Value == 'true' ))
101+ print ("" )
102+
0 commit comments