From a96ad05050cbc14a1c8b82db6fde8f2a1c75885f Mon Sep 17 00:00:00 2001 From: jesfel Date: Tue, 22 Jun 2021 11:44:21 -0400 Subject: [PATCH] Optional parameter added in AddressValidate class The optional paremeter will allow getting the footnotes on the response. This is helpful to know if an address is residential or commercial. --- usps/usps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usps/usps.py b/usps/usps.py index 0de3eef..bbdec3f 100644 --- a/usps/usps.py +++ b/usps/usps.py @@ -51,8 +51,9 @@ def create_label(self, *args, **kwargs): class AddressValidate(object): - def __init__(self, usps, address): + def __init__(self, usps, address, revision=False): xml = etree.Element('AddressValidateRequest', {'USERID': usps.api_user_id}) + entree.SubElement(xml, "Revision").text = str(int(revision)) _address = etree.SubElement(xml, 'Address', {'ID': '0'}) address.add_to_xml(_address, prefix='', validate=True)