Skip to content

Commit

Permalink
Merge pull request #187 from mixisLv/master
Browse files Browse the repository at this point in the history
Update services, tests, examples and composer packages
  • Loading branch information
JeremyDunn authored Nov 16, 2021
2 parents cc77867 + bce84fb commit 417b325
Show file tree
Hide file tree
Showing 792 changed files with 67,537 additions and 20,832 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

install:
- composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
- composer update --no-interaction --no-ansi --no-progress --optimize-autoloader --prefer-stable

script: vendor/bin/phpunit

notifications:
email: false
email: false
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
}
],
"require": {
"php": "^7.3|^8.0",
"ext-soap": "*"
},
"require-dev": {
"fzaninotto/faker": "^1.5",
"symfony/console": "^5.2",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.5",
"fakerphp/faker": "^1.16"
},
"autoload": {
"psr-4": {
Expand Down
448 changes: 264 additions & 184 deletions composer.lock

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions examples/address-validation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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';

Expand All @@ -19,7 +19,7 @@

// Version
$addressValidationRequest->Version->ServiceId = 'aval';
$addressValidationRequest->Version->Major = 4;
$addressValidationRequest->Version->Major = 8;
$addressValidationRequest->Version->Intermediate = 0;
$addressValidationRequest->Version->Minor = 0;

Expand All @@ -32,8 +32,10 @@
$addressValidationRequest->AddressesToValidate[0]->Address->CountryCode = 'US';

$request = new Request();
//$request->getSoapClient()->__setLocation(Request::PRODUCTION_URL);
$request->getSoapClient()->__setLocation(Request::TESTING_URL);
$addressValidationReply = $request->getAddressValidationReply($addressValidationRequest);

var_dump($addressValidationReply);
try {
$addressValidationReply = $request->getAddressValidationReply($addressValidationRequest);
var_dump($addressValidationReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
2 changes: 2 additions & 0 deletions examples/async-retrieve-job-results.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
$request = new Request();
try {
$retrieveJobResultsReply = $request->getRetrieveJobResultsReply($retrieveJobResultsRequest);
var_dump($retrieveJobResultsReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}

27 changes: 0 additions & 27 deletions examples/cancel-pending-shipment.php

This file was deleted.

18 changes: 8 additions & 10 deletions examples/close-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@
// Manifest reference detail.
$closeWithDocumentsRequest->CloseDocumentSpecification->CloseDocumentTypes = [SimpleType\CloseDocumentType::_MANIFEST];


$closeSerivceRequest = new Request();
$closeWithDocumentsReply = $closeSerivceRequest->getCloseWithDocumentsReply($closeWithDocumentsRequest);

var_dump($closeWithDocumentsReply);





$request = new Request();
try {
$closeWithDocumentsReply = $request->getCloseWithDocumentsReply($closeWithDocumentsRequest);
var_dump($closeWithDocumentsReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
29 changes: 17 additions & 12 deletions examples/country-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,22 @@
$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());
$request = new Request();
try {
$validatePostalReply = $request->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());
}
}
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
2 changes: 1 addition & 1 deletion examples/create-open-shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$createOpenShipmentRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER;
// version
$createOpenShipmentRequest->Version->ServiceId = 'ship';
$createOpenShipmentRequest->Version->Major = 15;
$createOpenShipmentRequest->Version->Major = 20;
$createOpenShipmentRequest->Version->Intermediate = 0;
$createOpenShipmentRequest->Version->Minor = 0;

Expand Down
99 changes: 0 additions & 99 deletions examples/create-pending-shipment.php

This file was deleted.

3 changes: 2 additions & 1 deletion examples/create-pickup.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// Version.
$createPickupRequest->Version->ServiceId = 'disp';
$createPickupRequest->Version->Major = 22;
$createPickupRequest->Version->Major = 23;
$createPickupRequest->Version->Intermediate = 0;
$createPickupRequest->Version->Minor = 0;

Expand Down Expand Up @@ -71,5 +71,6 @@
$createPickupReply = $request->getCreatePickupReply($createPickupRequest);
var_dump($createPickupReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
4 changes: 1 addition & 3 deletions examples/dangerous-goods-data-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@
$validateDangerousGoodsRequest->HandlingUnitGroups[0]->HandlingUnit->ContainerGroups[0]->Container->Commodities[0]->Quantity->Amount = 5;
$validateDangerousGoodsRequest->HandlingUnitGroups[0]->HandlingUnit->ContainerGroups[0]->Container->Commodities[0]->Quantity->Units = 'KG';


$request = new Request();

try {
$validateDangerousGoodsReply = $request->getValidateDangerousGoodsReply($validateDangerousGoodsRequest);

var_dump($validateDangerousGoodsReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
$version = new ComplexType\VersionId();
$version
->setServiceId('ship')
->setMajor(12)
->setIntermediate(1)
->setMajor(28)
->setIntermediate(0)
->setMinor(0);

$trackingId = new ComplexType\TrackingId();
Expand All @@ -40,9 +40,11 @@
$deleteShipmentRequest->setTrackingId($trackingId);
$deleteShipmentRequest->setDeletionControl(SimpleType\DeletionControlType::_DELETE_ALL_PACKAGES);


$validateShipmentRequest = new ShipService\Request();
$validateShipmentRequest->getSoapClient()->__setLocation('https://ws.fedex.com:443/web-services/ship');
$response = $validateShipmentRequest->getDeleteShipmentReply($deleteShipmentRequest);

var_dump($response);
$request = new ShipService\Request();
try {
$deleteShipmentReply = $request->getDeleteShipmentReply($deleteShipmentRequest);
var_dump($deleteShipmentReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
2 changes: 1 addition & 1 deletion examples/in-flight-shipment-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@


$request = new Request();

try {
$processDeliveryReply = $request->getProcessDeliveryReply($processDeliveryRequest);
var_dump($processDeliveryReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
2 changes: 1 addition & 1 deletion examples/rate-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

//version
$rateRequest->Version->ServiceId = 'crs';
$rateRequest->Version->Major = 28;
$rateRequest->Version->Major = 31;
$rateRequest->Version->Minor = 0;
$rateRequest->Version->Intermediate = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/ship.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$version = new ComplexType\VersionId();
$version
->setMajor(26)
->setMajor(28)
->setIntermediate(0)
->setMinor(0)
->setServiceId('ship');
Expand Down
14 changes: 9 additions & 5 deletions examples/track-by-id.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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';

Expand All @@ -22,7 +22,7 @@

// Version
$trackRequest->Version->ServiceId = 'trck';
$trackRequest->Version->Major = 19;
$trackRequest->Version->Major = 20;
$trackRequest->Version->Intermediate = 0;
$trackRequest->Version->Minor = 0;

Expand All @@ -41,6 +41,10 @@
$trackRequest->SelectionDetails[1]->PackageIdentifier->Type = SimpleType\TrackIdentifierType::_TRACKING_NUMBER_OR_DOORTAG;

$request = new Request();
$trackReply = $request->getTrackReply($trackRequest);

var_dump($trackReply);
try {
$trackReply = $request->getTrackReply($trackRequest);
var_dump($trackReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}
Loading

0 comments on commit 417b325

Please sign in to comment.