-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from JeremyDunn/update-services
Update services
- Loading branch information
Showing
911 changed files
with
36,116 additions
and
17,776 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
Binary file not shown.
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 |
---|---|---|
@@ -1,71 +1,37 @@ | ||
<?php | ||
/** | ||
* This test will send the same test data as in FedEx's documentation: | ||
* /php/RateAvailableServices/RateAvailableServices.php5 | ||
*/ | ||
|
||
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER' | ||
require_once 'credentials.php'; | ||
require_once 'bootstrap.php'; | ||
|
||
use FedEx\AddressValidationService; | ||
use FedEx\AddressValidationService\Request; | ||
use FedEx\AddressValidationService\ComplexType; | ||
use FedEx\AddressValidationService\SimpleType; | ||
|
||
$userCredential = new ComplexType\WebAuthenticationCredential(); | ||
$userCredential | ||
->setKey(FEDEX_KEY) | ||
->setPassword(FEDEX_PASSWORD); | ||
|
||
$webAuthenticationDetail = new ComplexType\WebAuthenticationDetail(); | ||
$webAuthenticationDetail->setUserCredential($userCredential); | ||
|
||
$clientDetail = new ComplexType\ClientDetail(); | ||
$clientDetail | ||
->setAccountNumber(FEDEX_ACCOUNT_NUMBER) | ||
->setMeterNumber(FEDEX_METER_NUMBER); | ||
|
||
$version = new ComplexType\VersionId(); | ||
$version | ||
->setMajor(2) | ||
->setIntermediate(0) | ||
->setMinor(0) | ||
->setServiceId('aval'); | ||
|
||
$options = new ComplexType\AddressValidationOptions(); | ||
$options | ||
->setCheckResidentialStatus(true) | ||
->setVerifyAddresses(true) | ||
->setConvertToUpperCase(true) | ||
->setDirectionalAccuracy(SimpleType\AddressValidationAccuracyType::_MEDIUM); | ||
|
||
$addresses = array(); | ||
|
||
$address1 = new ComplexType\Address(); | ||
$address1 | ||
->setStreetLines(array('12345 Main Street')) | ||
->setCity('Anytown') | ||
->setStateOrProvinceCode('NY') | ||
->setPostalCode('47711') | ||
->setCountryCode('US'); | ||
$addressValidationRequest = new ComplexType\AddressValidationRequest(); | ||
|
||
$addressToValidate1 = new ComplexType\AddressToValidate(); | ||
$addressToValidate1 | ||
->setAddress($address1) | ||
->setAddressId(1); | ||
// User Credentials | ||
$addressValidationRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY; | ||
$addressValidationRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD; | ||
|
||
$addresses[] = $addressToValidate1; | ||
// Client Detail | ||
$addressValidationRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
$addressValidationRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER; | ||
|
||
$addressValidationRequest = new ComplexType\AddressValidationRequest(); | ||
$addressValidationRequest->setWebAuthenticationDetail($webAuthenticationDetail); | ||
$addressValidationRequest->setClientDetail($clientDetail); | ||
$addressValidationRequest->setVersion($version); | ||
$addressValidationRequest->setRequestTimestamp(date('c')); | ||
$addressValidationRequest->setOptions($options); | ||
$addressValidationRequest->setAddressesToValidate($addresses); | ||
// Version | ||
$addressValidationRequest->Version->ServiceId = 'aval'; | ||
$addressValidationRequest->Version->Major = 4; | ||
$addressValidationRequest->Version->Intermediate = 0; | ||
$addressValidationRequest->Version->Minor = 0; | ||
|
||
// Address(es) to validate. | ||
$addressValidationRequest->AddressesToValidate = [new ComplexType\AddressToValidate()]; // just validating 1 address in this example. | ||
$addressValidationRequest->AddressesToValidate[0]->Address->StreetLines = ['12345 Main Street']; | ||
$addressValidationRequest->AddressesToValidate[0]->Address->City = 'Anytown'; | ||
$addressValidationRequest->AddressesToValidate[0]->Address->StateOrProvinceCode = 'NY'; | ||
$addressValidationRequest->AddressesToValidate[0]->Address->PostalCode = 47711; | ||
$addressValidationRequest->AddressesToValidate[0]->Address->CountryCode = 'US'; | ||
|
||
$validateShipmentRequest = new AddressValidationService\Request(); | ||
$result = $validateShipmentRequest->getAddressValidationReply($addressValidationRequest); | ||
$request = new Request(); | ||
$addressValidationReply = $request->getAddressValidationReply($addressValidationRequest); | ||
|
||
var_dump($result); | ||
var_dump($addressValidationReply); |
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,35 @@ | ||
<?php | ||
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER' | ||
require_once 'credentials.php'; | ||
require_once 'bootstrap.php'; | ||
|
||
use FedEx\AsyncService\Request; | ||
use FedEx\AsyncService\ComplexType; | ||
use FedEx\AsyncService\SimpleType; | ||
|
||
$retrieveJobResultsRequest = new ComplexType\RetrieveJobResultsRequest(); | ||
|
||
// Authentication & client details. | ||
$retrieveJobResultsRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY; | ||
$retrieveJobResultsRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD; | ||
$retrieveJobResultsRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
$retrieveJobResultsRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER; | ||
|
||
$retrieveJobResultsRequest->TransactionDetail->CustomerTransactionId = 'testing async service'; | ||
|
||
// Version. | ||
$retrieveJobResultsRequest->Version->ServiceId = 'async'; | ||
$retrieveJobResultsRequest->Version->Major = 4; | ||
$retrieveJobResultsRequest->Version->Intermediate = 0; | ||
$retrieveJobResultsRequest->Version->Minor = 0; | ||
|
||
$retrieveJobResultsRequest->JobId = 'your job id'; | ||
|
||
|
||
$request = new Request(); | ||
try { | ||
$retrieveJobResultsReply = $request->getRetrieveJobResultsReply($retrieveJobResultsRequest); | ||
} catch (\Exception $e) { | ||
echo $request->getSoapClient()->__getLastResponse(); | ||
} | ||
|
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,50 @@ | ||
<?php | ||
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER' | ||
require_once 'credentials.php'; | ||
require_once 'bootstrap.php'; | ||
|
||
use FedEx\CloseService\Request; | ||
use FedEx\CloseService\ComplexType; | ||
use FedEx\CloseService\SimpleType; | ||
|
||
$closeWithDocumentsRequest = new ComplexType\CloseWithDocumentsRequest(); | ||
|
||
// Authentication & client details. | ||
$closeWithDocumentsRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY; | ||
$closeWithDocumentsRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD; | ||
$closeWithDocumentsRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
$closeWithDocumentsRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER; | ||
|
||
$closeWithDocumentsRequest->TransactionDetail->CustomerTransactionId = 'ground close with documents test'; | ||
|
||
// Version. | ||
$closeWithDocumentsRequest->Version->ServiceId = 'clos'; | ||
$closeWithDocumentsRequest->Version->Major = 5; | ||
$closeWithDocumentsRequest->Version->Intermediate = 0; | ||
$closeWithDocumentsRequest->Version->Minor = 0; | ||
|
||
// Action type. | ||
$closeWithDocumentsRequest->ActionType = SimpleType\CloseActionType::_CLOSE; | ||
|
||
// Processing options. | ||
$closeWithDocumentsRequest->ProcessingOptions->Options = [SimpleType\CloseWithDocumentsProcessingOptionType::_ERROR_IF_OPEN_SHIPMENTS_FOUND]; | ||
|
||
// Carrier code. | ||
$closeWithDocumentsRequest->CarrierCode = SimpleType\CarrierCodeType::_FDXE; | ||
|
||
// Reprint close date. | ||
$closeWithDocumentsRequest->ReprintCloseDate = date('c'); | ||
|
||
// Manifest reference detail. | ||
$closeWithDocumentsRequest->CloseDocumentSpecification->CloseDocumentTypes = [SimpleType\CloseDocumentType::_MANIFEST]; | ||
|
||
|
||
$closeSerivceRequest = new Request(); | ||
$closeWithDocumentsReply = $closeSerivceRequest->getCloseWithDocumentsReply($closeWithDocumentsRequest); | ||
|
||
var_dump($closeWithDocumentsReply); | ||
|
||
|
||
|
||
|
||
|
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,44 @@ | ||
<?php | ||
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER' | ||
require_once 'credentials.php'; | ||
require_once 'bootstrap.php'; | ||
|
||
use FedEx\CountryService\Request; | ||
use FedEx\CountryService\ComplexType; | ||
use FedEx\CountryService\SimpleType; | ||
|
||
$validatePostalRequest = new ComplexType\ValidatePostalRequest(); | ||
|
||
// Authentication and client details. | ||
$validatePostalRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY; | ||
$validatePostalRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD; | ||
$validatePostalRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
$validatePostalRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER; | ||
|
||
// Version. | ||
$validatePostalRequest->Version->ServiceId = 'cnty'; | ||
$validatePostalRequest->Version->Major = 8; | ||
$validatePostalRequest->Version->Intermediate = 0; | ||
$validatePostalRequest->Version->Minor = 0; | ||
|
||
// Address. | ||
$validatePostalRequest->Address->PostalCode = 96813; | ||
$validatePostalRequest->Address->CountryCode = 'US'; | ||
|
||
$validatePostalRequest->CarrierCode = SimpleType\CarrierCodeType::_FDXE; | ||
|
||
// Get Validate Postal reply. | ||
$countryServiceRequest = new Request(); | ||
$validatePostalReply = $countryServiceRequest->getValidatePostalReply($validatePostalRequest); | ||
|
||
echo '<h1>Postal Detail</h1>'; | ||
echo "<h2>Country Code: {$validatePostalReply->PostalDetail->CountryCode}</h2>"; | ||
echo "<h2>State or Province Code: {$validatePostalReply->PostalDetail->StateOrProvinceCode}</h2>"; | ||
echo "<h2>City First Initials: {$validatePostalReply->PostalDetail->CityFirstInitials}</h2>"; | ||
echo "<h2>Cleaned Postal Code: {$validatePostalReply->PostalDetail->CleanedPostalCode}</h2>"; | ||
echo '<h2> Location Descriptions: </h2>'; | ||
if (!empty($validatePostalReply->PostalDetail->LocationDescriptions)) { | ||
foreach ($validatePostalReply->PostalDetail->LocationDescriptions as $locationDescription) { | ||
var_dump($locationDescription->toArray()); | ||
} | ||
} |
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,75 @@ | ||
<?php | ||
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER' | ||
require_once 'credentials.php'; | ||
require_once 'bootstrap.php'; | ||
|
||
use FedEx\PickupService\Request; | ||
use FedEx\PickupService\ComplexType; | ||
use FedEx\PickupService\SimpleType; | ||
|
||
$createPickupRequest = new ComplexType\CreatePickupRequest(); | ||
|
||
// Authentication & client details. | ||
$createPickupRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY; | ||
$createPickupRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD; | ||
$createPickupRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
$createPickupRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER; | ||
|
||
// Version. | ||
$createPickupRequest->Version->ServiceId = 'disp'; | ||
$createPickupRequest->Version->Major = 17; | ||
$createPickupRequest->Version->Intermediate = 0; | ||
$createPickupRequest->Version->Minor = 0; | ||
|
||
$createPickupRequest->TransactionDetail->CustomerTransactionId = 'create pickup request example'; | ||
$createPickupRequest->TransactionDetail->Localization->LanguageCode = 'EN'; | ||
$createPickupRequest->TransactionDetail->Localization->LocaleCode = 'ES'; | ||
|
||
// Associated account number. | ||
$createPickupRequest->AssociatedAccountNumber->Type = SimpleType\AssociatedAccountNumberType::_FEDEX_EXPRESS; | ||
$createPickupRequest->AssociatedAccountNumber->AccountNumber = FEDEX_ACCOUNT_NUMBER; | ||
|
||
// Origin detail contact. | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->ContactId = 'KR1059'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->PersonName = 'INPUT YOUR INFORMATION'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->Title = 'Mr.'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->CompanyName = 'DEOYAROHIT0905$'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->PhoneNumber = 'INPUT YOUR INFORMATION'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->PhoneExtension = 'INPUT YOUR INFORMATION'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->PagerNumber = '9962308621'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->FaxNumber = '9962308621'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Contact->EMailAddress = '[email protected]'; | ||
|
||
// Origin detail address. | ||
$createPickupRequest->OriginDetail->PickupLocation->Address->StreetLines = ['INPUT YOUR INFORMATION']; | ||
$createPickupRequest->OriginDetail->PickupLocation->Address->City = 'Memphis'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Address->StateOrProvinceCode = 'TN'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Address->PostalCode = '38125'; | ||
$createPickupRequest->OriginDetail->PickupLocation->Address->CountryCode = 'US'; | ||
|
||
$createPickupRequest->OriginDetail->PackageLocation = SimpleType\PickupBuildingLocationType::_FRONT; | ||
$createPickupRequest->OriginDetail->BuildingPart = SimpleType\BuildingPartCode::_DEPARTMENT; | ||
$createPickupRequest->OriginDetail->BuildingPartDescription = 'Building part description'; | ||
$createPickupRequest->OriginDetail->ReadyTimestamp = date('c'); | ||
$createPickupRequest->OriginDetail->CompanyCloseTime = '19:00:00'; | ||
$createPickupRequest->OriginDetail->Location = 'NQAA'; | ||
$createPickupRequest->OriginDetail->SuppliesRequested = 'supplies requested'; | ||
|
||
$createPickupRequest->PackageCount = 1; | ||
$createPickupRequest->TotalWeight->Units = SimpleType\WeightUnits::_LB; | ||
$createPickupRequest->TotalWeight->Value = 50; | ||
|
||
$createPickupRequest->CarrierCode = SimpleType\CarrierCodeType::_FDXE; | ||
$createPickupRequest->OversizePackageCount = 0; | ||
$createPickupRequest->Remarks = 'remarks'; | ||
$createPickupRequest->CommodityDescription = 'test environment - please do not process pickup'; | ||
$createPickupRequest->CountryRelationship = SimpleType\CountryRelationshipType::_DOMESTIC; | ||
|
||
|
||
$request = new Request(); | ||
try { | ||
$createPickupReply = $request->getCreatePickupReply($createPickupRequest); | ||
var_dump($createPickupReply); | ||
} catch (\Exception $e) { | ||
echo $request->getSoapClient()->__getLastResponse(); | ||
} |
Oops, something went wrong.