def make_body(self, address): root = ET.Element('AddressValidationRequest') info = {'Request': { 'TransactionReference': { 'CustomerContext':'foo', 'XpciVersion':'1.0',}, 'RequestAction':'AV',}, 'Address': address } dicttoxml(info, root) return root
def make_body(self, shipment): root = ET.Element('ShipmentConfirmRequest') info = {'Request': { 'TransactionReference': { 'CustomerContext':'foo', 'XpciVersion':'1.0',}, 'RequestAction':'ShipConfirm', 'RequestOption':'nonvalidate'}, 'Shipment': shipment, 'LabelSpecification': { 'LabelPrintMethod': {'Code':'GIF'}, 'HTTPUserAgent':'', 'LabelImageFormat': {'Code':'GIF'}, } } dicttoxml(info, root) return root
def make_body(self, address): """ address keys: AddressLine PoliticalDivision2 #city PoliticalDiction #state PostcodePrimaryLow #zip CountryCode """ root = ET.Element('AddressValidationRequest') info = {'Request': { 'TransactionReference': { 'CustomerContext':'foo', 'XpciVersion':'1.0',}, 'RequestAction':'XAV', 'RequestOption':'3'}, 'AddressKeyFormat': address } dicttoxml(info, root) return root