|
1 | 1 | #!/usr/bin/env python |
2 | 2 | """ |
3 | | -This example shows how to use the FedEx RateRequest service. |
4 | | -The variables populated below represents the minimum required values. |
5 | | -You will need to fill all of these, or risk seeing a SchemaValidationError |
| 3 | +This example shows how to use the FedEx RateRequest service. |
| 4 | +The variables populated below represents the minimum required values. |
| 5 | +You will need to fill all of these, or risk seeing a SchemaValidationError |
6 | 6 | exception thrown by suds. |
7 | 7 |
|
8 | | -TIP: Near the bottom of the module, see how to check the if the destination |
| 8 | +TIP: Near the bottom of the module, see how to check the if the destination |
9 | 9 | is Out of Delivery Area (ODA). |
10 | 10 | """ |
11 | 11 | import logging |
|
19 | 19 | # We're using the FedexConfig object from example_config.py in this dir. |
20 | 20 | rate_request = FedexRateServiceRequest(CONFIG_OBJ) |
21 | 21 |
|
22 | | -rate_request.RequestedShipment.ServiceType = 'FEDEX_FREIGHT' |
| 22 | +rate_request.RequestedShipment.ServiceType = 'FEDEX_FREIGHT_ECONOMY' |
23 | 23 |
|
24 | 24 | rate_request.RequestedShipment.DropoffType = 'REGULAR_PICKUP' |
25 | 25 |
|
|
42 | 42 | #include estimated duties and taxes in rate quote, can be ALL or NONE |
43 | 43 | rate_request.RequestedShipment.EdtRequestType = 'NONE' |
44 | 44 |
|
45 | | -rate_request.RequestedShipment.PackageDetail = 'PACKAGE_SUMMARY' |
46 | | - |
47 | | -rate_request.RequestedShipment.FreightShipmentDetail.PaymentType = 'PREPAID' |
48 | | - |
49 | | -# note: in order for this to work in test, you may need to use the |
| 45 | +# note: in order for this to work in test, you may need to use the |
50 | 46 | # specially provided LTL addresses emailed to you when signing up. |
51 | 47 | rate_request.RequestedShipment.FreightShipmentDetail.FedExFreightBillingContactAndAddress.Contact.PersonName = 'Sender Name' |
52 | 48 | rate_request.RequestedShipment.FreightShipmentDetail.FedExFreightBillingContactAndAddress.Contact.CompanyName = 'Some Company' |
|
65 | 61 | rate_request.RequestedShipment.ShippingDocumentSpecification = spec |
66 | 62 |
|
67 | 63 | role = rate_request.create_wsdl_object_of_type('FreightShipmentRoleType') |
68 | | - |
69 | 64 | rate_request.RequestedShipment.FreightShipmentDetail.Role = role.SHIPPER |
70 | 65 |
|
| 66 | +# Designates the terms of the "collect" payment for a Freight |
| 67 | +#Shipment. Can be NON_RECOURSE_SHIPPER_SIGNED or STANDARD |
| 68 | +rate_request.RequestedShipment.FreightShipmentDetail.CollectTermsType = 'STANDARD' |
| 69 | + |
71 | 70 | package1_weight = rate_request.create_wsdl_object_of_type('Weight') |
72 | 71 | package1_weight.Value = 500.0 |
73 | 72 | package1_weight.Units = "LB" |
|
108 | 107 | for surcharge in detail.ShipmentRateDetail.Surcharges: |
109 | 108 | if surcharge.SurchargeType == 'OUT_OF_DELIVERY_AREA': |
110 | 109 | print "%s: ODA rate_request charge %s" % (service.ServiceType, surcharge.Amount.Amount) |
111 | | - |
| 110 | + |
112 | 111 | for rate_detail in service.RatedShipmentDetails: |
113 | 112 | print "%s: Net FedEx Charge %s %s" % (service.ServiceType, rate_detail.ShipmentRateDetail.TotalNetFedExCharge.Currency, |
114 | 113 | rate_detail.ShipmentRateDetail.TotalNetFedExCharge.Amount) |
|
0 commit comments