77"""
88
99from datetime import datetime
10- from .. base_service import FedexBaseService
10+ from ..base_service import FedexBaseService
1111
1212
1313class FedexRateServiceRequest (FedexBaseService ):
@@ -27,19 +27,19 @@ def __init__(self, config_obj, *args, **kwargs):
2727 """
2828
2929 self ._config_obj = config_obj
30-
30+
3131 # Holds version info for the VersionId SOAP object.
32- self ._version_info = {'service_id' : 'crs' , 'major' : '16' ,
33- 'intermediate' : '0' , 'minor' : '0' }
34-
32+ self ._version_info = {'service_id' : 'crs' , 'major' : '18' ,
33+ 'intermediate' : '0' , 'minor' : '0' }
34+
3535 self .RequestedShipment = None
3636 """@ivar: Holds the RequestedShipment WSDL object."""
3737 # Call the parent FedexBaseService class for basic setup work.
38- super (FedexRateServiceRequest , self ).__init__ (self ._config_obj ,
39- 'RateService_v16 .wsdl' ,
40- * args , ** kwargs )
38+ super (FedexRateServiceRequest , self ).__init__ (self ._config_obj ,
39+ 'RateService_v18 .wsdl' ,
40+ * args , ** kwargs )
4141 self .ClientDetail .Region = config_obj .express_region_code
42-
42+
4343 def _prepare_wsdl_objects (self ):
4444 """
4545 This is the data that will be used to create your shipment. Create
@@ -52,7 +52,7 @@ def _prepare_wsdl_objects(self):
5252 # This is the primary data structure for processShipment requests.
5353 self .RequestedShipment = self .client .factory .create ('RequestedShipment' )
5454 self .RequestedShipment .ShipTimestamp = datetime .now ()
55-
55+
5656 TotalWeight = self .client .factory .create ('Weight' )
5757 # Start at nothing.
5858 TotalWeight .Value = 0.0
@@ -61,33 +61,33 @@ def _prepare_wsdl_objects(self):
6161 # This is the total weight of the entire shipment. Shipments may
6262 # contain more than one package.
6363 self .RequestedShipment .TotalWeight = TotalWeight
64-
64+
6565 # This is the top level data structure for Shipper information.
6666 ShipperParty = self .client .factory .create ('Party' )
6767 ShipperParty .Address = self .client .factory .create ('Address' )
6868 ShipperParty .Contact = self .client .factory .create ('Contact' )
69-
69+
7070 # Link the ShipperParty to our master data structure.
7171 self .RequestedShipment .Shipper = ShipperParty
7272
7373 # This is the top level data structure for Recipient information.
7474 RecipientParty = self .client .factory .create ('Party' )
7575 RecipientParty .Contact = self .client .factory .create ('Contact' )
7676 RecipientParty .Address = self .client .factory .create ('Address' )
77-
77+
7878 # Link the RecipientParty object to our master data structure.
7979 self .RequestedShipment .Recipient = RecipientParty
80-
80+
8181 Payor = self .client .factory .create ('Payor' )
8282 # Grab the account number from the FedexConfig object by default.
8383 Payor .AccountNumber = self ._config_obj .account_number
8484 # Assume US.
8585 Payor .CountryCode = 'US'
86-
86+
8787 # Start with no packages, user must add them.
8888 self .RequestedShipment .PackageCount = 0
8989 self .RequestedShipment .RequestedPackageLineItems = []
90-
90+
9191 # This is good to review if you'd like to see what the data structure
9292 # looks like.
9393 self .logger .debug (self .RequestedShipment )
@@ -108,7 +108,7 @@ def _assemble_and_send_request(self):
108108 Version = self .VersionId ,
109109 RequestedShipment = self .RequestedShipment ,
110110 ReturnTransitAndCommit = self .ReturnTransitAndCommit )
111-
111+
112112 def add_package (self , package_item ):
113113 """
114114 Adds a package to the ship request.
0 commit comments