Skip to content

Commit b6de31e

Browse files
author
Brent Sanders
committed
adds freight acct # to config obj
1 parent 7e5b239 commit b6de31e

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

examples/create_freight_shipment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
shipment.RequestedShipment.ServiceType = 'FEDEX_FREIGHT_ECONOMY'
2323
shipment.RequestedShipment.PackagingType = 'YOUR_PACKAGING'
2424

25-
shipment.RequestedShipment.FreightShipmentDetail.FedExFreightAccountNumber = 'xxxxxxxxx' #freight account number
25+
shipment.RequestedShipment.FreightShipmentDetail.FedExFreightAccountNumber = CONFIG_OBJ.freight_account_number
2626

2727
# Shipper contact info.
2828
shipment.RequestedShipment.Shipper.Contact.PersonName = 'Sender Name'
@@ -48,9 +48,11 @@
4848
shipment.RequestedShipment.Recipient.Address.StateOrProvinceCode = 'AR'
4949
shipment.RequestedShipment.Recipient.Address.PostalCode = '72601'
5050
shipment.RequestedShipment.Recipient.Address.CountryCode = 'US'
51+
5152
# This is needed to ensure an accurate rate quote with the response.
5253
shipment.RequestedShipment.Recipient.Address.Residential = False
5354
shipment.RequestedShipment.FreightShipmentDetail.TotalHandlingUnits = 1
55+
shipment.RequestedShipment.ShippingChargesPayment.Payor.ResponsibleParty.AccountNumber = CONFIG_OBJ.freight_account_number
5456

5557
shipment.RequestedShipment.FreightShipmentDetail.FedExFreightBillingContactAndAddress.Contact.PersonName = 'Sender Name'
5658
shipment.RequestedShipment.FreightShipmentDetail.FedExFreightBillingContactAndAddress.Contact.CompanyName = 'Some Company'

examples/create_shipment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
shipment.RequestedShipment.Recipient.Address.Residential = True
6060
shipment.RequestedShipment.EdtRequestType = 'NONE'
6161

62+
shipment.RequestedShipment.ShippingChargesPayment.Payor.ResponsibleParty.AccountNumber = CONFIG_OBJ.account_number
6263
# Who pays for the shipment?
6364
# RECIPIENT, SENDER or THIRD_PARTY
6465
shipment.RequestedShipment.ShippingChargesPayment.PaymentType = 'SENDER'

examples/freight_rate_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
rate_request.RequestedShipment.FreightShipmentDetail.TotalHandlingUnits = 1
2929

30-
rate_request.RequestedShipment.FreightShipmentDetail.FedExFreightAccountNumber = 'xxxxxxxx' #freight account number
30+
rate_request.RequestedShipment.FreightShipmentDetail.FedExFreightAccountNumber = CONFIG_OBJ.freight_account_number
3131

3232
rate_request.RequestedShipment.Shipper.Address.PostalCode = '72601'
3333
rate_request.RequestedShipment.Shipper.Address.CountryCode = 'US'

examples/rate_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# Who pays for the rate_request?
5757
# RECIPIENT, SENDER or THIRD_PARTY
5858
rate_request.RequestedShipment.ShippingChargesPayment.PaymentType = 'SENDER'
59-
59+
rate_request.RequestedShipment.ShippingChargesPayment.Payor.AccountNumber = CONFIG_OBJ.account_number
6060
package1_weight = rate_request.create_wsdl_object_of_type('Weight')
6161
# Weight, in LB.
6262
package1_weight.Value = 1.0

fedex/config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FedexConfig(object):
1919
C{password} arguments and set the instance variables documented below
2020
at a later time if you must.
2121
"""
22-
def __init__(self, key, password, account_number=None, meter_number=None,
22+
def __init__(self, key, password, account_number=None, meter_number=None, freight_account_number=None,
2323
integrator_id=None, wsdl_path=None, express_region_code=None, use_test_server=False):
2424
"""
2525
@type key: L{str}
@@ -33,6 +33,9 @@ def __init__(self, key, password, account_number=None, meter_number=None,
3333
@type meter_number: L{str}
3434
@keyword meter_number: The meter number sent to you by Fedex after
3535
registering for Web Services.
36+
@type freight_account_number: L{str}
37+
@keyword freight_account_number: The freight account number sent to you
38+
by Fedex after registering for Web Services.
3639
@type integrator_id: L{str}
3740
@keyword integrator_id: The integrator string sent to you by Fedex after
3841
registering for Web Services.
@@ -53,6 +56,8 @@ def __init__(self, key, password, account_number=None, meter_number=None,
5356
"""@ivar: Web Services account number."""
5457
self.meter_number = meter_number
5558
"""@ivar: Web services meter number."""
59+
self.freight_account_number = freight_account_number
60+
"""@ivar: Web Services freight accountnumber."""
5661
self.integrator_id = integrator_id
5762
"""@ivar: Web services integrator ID."""
5863
self.express_region_code = express_region_code

fedex/services/ship_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def _prepare_wsdl_objects(self):
7272

7373
Payor = self.client.factory.create('Payor')
7474
# Grab the account number from the FedexConfig object by default.
75-
Payor.ResponsibleParty.AccountNumber = 'xxxxxxxx' #freight account number!
7675
# Assume US.
7776
Payor.ResponsibleParty.Address.CountryCode = 'US'
7877

0 commit comments

Comments
 (0)