-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python | ||
""" | ||
This example shows how to create a pickup request | ||
""" | ||
import datetime | ||
|
||
from example_config import CONFIG_OBJ | ||
from fedex.services.pickup_service import FedexCreatePickupRequest | ||
|
||
customer_transaction_id = "*** PickupService Request v11 using Python ***" # Optional transaction_id | ||
pickup_service = FedexCreatePickupRequest(CONFIG_OBJ, customer_transaction_id) | ||
|
||
pickup_service.OriginDetail.PickupLocation.Contact.PersonName = 'Sender Name' | ||
pickup_service.OriginDetail.PickupLocation.Contact.EMailAddress = '[email protected]' | ||
pickup_service.OriginDetail.PickupLocation.Contact.CompanyName = 'Acme Inc.' | ||
pickup_service.OriginDetail.PickupLocation.Contact.PhoneNumber = '9012638716' | ||
pickup_service.OriginDetail.PickupLocation.Address.StateOrProvinceCode = 'SC' | ||
pickup_service.OriginDetail.PickupLocation.Address.PostalCode = '29631' | ||
pickup_service.OriginDetail.PickupLocation.Address.CountryCode = 'US' | ||
pickup_service.OriginDetail.PickupLocation.Address.StreetLines = ['155 Old Greenville Hwy', 'Suite 103'] | ||
pickup_service.OriginDetail.PickupLocation.Address.City = 'Clemson' | ||
# pickup_service.OriginDetail.PickupLocation.Address.UrbanizationCode = '' # For Puerto Rico only | ||
pickup_service.OriginDetail.PickupLocation.Address.Residential = False | ||
|
||
# FRONT, NONE, REAR, SIDE | ||
# pickup_service.OriginDetail.PackageLocation = 'NONE' | ||
|
||
# APARTMENT, BUILDING, DEPARTMENT, FLOOR, ROOM, SUITE | ||
# pickup_service.OriginDetail.BuildingPart = 'SUITE' | ||
|
||
# Identifies the date and time the package will be ready for pickup by FedEx. | ||
pickup_service.OriginDetail.ReadyTimestamp = datetime.datetime.now().replace(microsecond=0).isoformat() | ||
|
||
# Identifies the latest time at which the driver can gain access to pick up the package(s) | ||
pickup_service.OriginDetail.CompanyCloseTime = '23:00:00' | ||
|
||
pickup_service.CarrierCode = 'FDXE' | ||
|
||
pickup_service.TotalWeight.Units = 'LB' | ||
pickup_service.TotalWeight.Value = '1' | ||
pickup_service.PackageCount = '1' | ||
# pickup_service.OversizePackageCount = '1' | ||
|
||
# pickup_service.CommodityDescription = '' | ||
|
||
# DOMESTIC or INTERNATIONAL | ||
# pickup_service.CountryRelationship = 'DOMESTIC' | ||
|
||
# See PickupServiceCategoryType | ||
# pickup_service.PickupServiceCategory = 'FEDEX_DISTANCE_DEFERRED' | ||
|
||
pickup_service.send_request() | ||
|
||
print pickup_service.response.HighestSeverity == 'SUCCESS' | ||
print pickup_service.response.Notifications[0].Message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,17 @@ | |
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.") | ||
class FedexCreatePickupRequestTests(unittest.TestCase): | ||
""" | ||
These tests verify that the rate service WSDL is in good shape. | ||
These tests verify that the pikckup service WSDL is in good shape. | ||
""" | ||
|
||
def test_rate(self): | ||
pickup_service = FedexCreatePickupRequest(CONFIG_OBJ) | ||
def setUp(self): | ||
self.config_obj = get_fedex_config() | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
def test_pickup_request(self): | ||
pickup_service = FedexCreatePickupRequest(self.config_obj) | ||
|
||
pickup_service.OriginDetail.PickupLocation.Contact.PersonName = 'Sender Name' | ||
pickup_service.OriginDetail.PickupLocation.Contact.EMailAddress = '[email protected]' | ||
|