Skip to content

Commit 417b325

Browse files
authored
Merge pull request #187 from mixisLv/master
Update services, tests, examples and composer packages
2 parents cc77867 + bce84fb commit 417b325

File tree

792 files changed

+67537
-20832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

792 files changed

+67537
-20832
lines changed

.travis.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
6-
- 7.2
74
- 7.3
5+
- 7.4
6+
- 8.0
87

98
install:
10-
- composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
9+
- composer update --no-interaction --no-ansi --no-progress --optimize-autoloader --prefer-stable
1110

1211
script: vendor/bin/phpunit
1312

1413
notifications:
15-
email: false
14+
email: false

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
}
1414
],
1515
"require": {
16+
"php": "^7.3|^8.0",
1617
"ext-soap": "*"
1718
},
1819
"require-dev": {
19-
"fzaninotto/faker": "^1.5",
2020
"symfony/console": "^5.2",
2121
"phpunit/phpunit": "^9.5",
22-
"squizlabs/php_codesniffer": "^3.5"
22+
"squizlabs/php_codesniffer": "^3.5",
23+
"fakerphp/faker": "^1.16"
2324
},
2425
"autoload": {
2526
"psr-4": {

composer.lock

+264-184
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/address-validation.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER'
33
require_once 'credentials.php';
44
require_once 'bootstrap.php';
55

@@ -19,7 +19,7 @@
1919

2020
// Version
2121
$addressValidationRequest->Version->ServiceId = 'aval';
22-
$addressValidationRequest->Version->Major = 4;
22+
$addressValidationRequest->Version->Major = 8;
2323
$addressValidationRequest->Version->Intermediate = 0;
2424
$addressValidationRequest->Version->Minor = 0;
2525

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

3434
$request = new Request();
35-
//$request->getSoapClient()->__setLocation(Request::PRODUCTION_URL);
36-
$request->getSoapClient()->__setLocation(Request::TESTING_URL);
37-
$addressValidationReply = $request->getAddressValidationReply($addressValidationRequest);
38-
39-
var_dump($addressValidationReply);
35+
try {
36+
$addressValidationReply = $request->getAddressValidationReply($addressValidationRequest);
37+
var_dump($addressValidationReply);
38+
} catch (\Exception $e) {
39+
echo $e->getMessage();
40+
echo $request->getSoapClient()->__getLastResponse();
41+
}

examples/async-retrieve-job-results.php

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
$request = new Request();
3030
try {
3131
$retrieveJobResultsReply = $request->getRetrieveJobResultsReply($retrieveJobResultsRequest);
32+
var_dump($retrieveJobResultsReply);
3233
} catch (\Exception $e) {
34+
echo $e->getMessage();
3335
echo $request->getSoapClient()->__getLastResponse();
3436
}
3537

examples/cancel-pending-shipment.php

-27
This file was deleted.

examples/close-service.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@
3838
// Manifest reference detail.
3939
$closeWithDocumentsRequest->CloseDocumentSpecification->CloseDocumentTypes = [SimpleType\CloseDocumentType::_MANIFEST];
4040

41-
42-
$closeSerivceRequest = new Request();
43-
$closeWithDocumentsReply = $closeSerivceRequest->getCloseWithDocumentsReply($closeWithDocumentsRequest);
44-
45-
var_dump($closeWithDocumentsReply);
46-
47-
48-
49-
50-
41+
$request = new Request();
42+
try {
43+
$closeWithDocumentsReply = $request->getCloseWithDocumentsReply($closeWithDocumentsRequest);
44+
var_dump($closeWithDocumentsReply);
45+
} catch (\Exception $e) {
46+
echo $e->getMessage();
47+
echo $request->getSoapClient()->__getLastResponse();
48+
}

examples/country-service.php

+17-12
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,22 @@
2828
$validatePostalRequest->CarrierCode = SimpleType\CarrierCodeType::_FDXE;
2929

3030
// Get Validate Postal reply.
31-
$countryServiceRequest = new Request();
32-
$validatePostalReply = $countryServiceRequest->getValidatePostalReply($validatePostalRequest);
33-
34-
echo '<h1>Postal Detail</h1>';
35-
echo "<h2>Country Code: {$validatePostalReply->PostalDetail->CountryCode}</h2>";
36-
echo "<h2>State or Province Code: {$validatePostalReply->PostalDetail->StateOrProvinceCode}</h2>";
37-
echo "<h2>City First Initials: {$validatePostalReply->PostalDetail->CityFirstInitials}</h2>";
38-
echo "<h2>Cleaned Postal Code: {$validatePostalReply->PostalDetail->CleanedPostalCode}</h2>";
39-
echo '<h2> Location Descriptions: </h2>';
40-
if (!empty($validatePostalReply->PostalDetail->LocationDescriptions)) {
41-
foreach ($validatePostalReply->PostalDetail->LocationDescriptions as $locationDescription) {
42-
var_dump($locationDescription->toArray());
31+
$request = new Request();
32+
try {
33+
$validatePostalReply = $request->getValidatePostalReply($validatePostalRequest);
34+
35+
echo '<h1>Postal Detail</h1>';
36+
echo "<h2>Country Code: {$validatePostalReply->PostalDetail->CountryCode}</h2>";
37+
echo "<h2>State or Province Code: {$validatePostalReply->PostalDetail->StateOrProvinceCode}</h2>";
38+
echo "<h2>City First Initials: {$validatePostalReply->PostalDetail->CityFirstInitials}</h2>";
39+
echo "<h2>Cleaned Postal Code: {$validatePostalReply->PostalDetail->CleanedPostalCode}</h2>";
40+
echo '<h2> Location Descriptions: </h2>';
41+
if (!empty($validatePostalReply->PostalDetail->LocationDescriptions)) {
42+
foreach ($validatePostalReply->PostalDetail->LocationDescriptions as $locationDescription) {
43+
var_dump($locationDescription->toArray());
44+
}
4345
}
46+
} catch (\Exception $e) {
47+
echo $e->getMessage();
48+
echo $request->getSoapClient()->__getLastResponse();
4449
}

examples/create-open-shipment.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$createOpenShipmentRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER;
2222
// version
2323
$createOpenShipmentRequest->Version->ServiceId = 'ship';
24-
$createOpenShipmentRequest->Version->Major = 15;
24+
$createOpenShipmentRequest->Version->Major = 20;
2525
$createOpenShipmentRequest->Version->Intermediate = 0;
2626
$createOpenShipmentRequest->Version->Minor = 0;
2727

examples/create-pending-shipment.php

-99
This file was deleted.

examples/create-pickup.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// Version.
1919
$createPickupRequest->Version->ServiceId = 'disp';
20-
$createPickupRequest->Version->Major = 22;
20+
$createPickupRequest->Version->Major = 23;
2121
$createPickupRequest->Version->Intermediate = 0;
2222
$createPickupRequest->Version->Minor = 0;
2323

@@ -71,5 +71,6 @@
7171
$createPickupReply = $request->getCreatePickupReply($createPickupRequest);
7272
var_dump($createPickupReply);
7373
} catch (\Exception $e) {
74+
echo $e->getMessage();
7475
echo $request->getSoapClient()->__getLastResponse();
7576
}

examples/dangerous-goods-data-service.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,12 @@
8585
$validateDangerousGoodsRequest->HandlingUnitGroups[0]->HandlingUnit->ContainerGroups[0]->Container->Commodities[0]->Quantity->Amount = 5;
8686
$validateDangerousGoodsRequest->HandlingUnitGroups[0]->HandlingUnit->ContainerGroups[0]->Container->Commodities[0]->Quantity->Units = 'KG';
8787

88-
8988
$request = new Request();
90-
9189
try {
9290
$validateDangerousGoodsReply = $request->getValidateDangerousGoodsReply($validateDangerousGoodsRequest);
93-
9491
var_dump($validateDangerousGoodsReply);
9592
} catch (\Exception $e) {
93+
echo $e->getMessage();
9694
echo $request->getSoapClient()->__getLastResponse();
9795
}
9896

examples/delete-pending-shipment.php renamed to examples/delete-shipment.php

+10-8
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
$version = new ComplexType\VersionId();
2424
$version
2525
->setServiceId('ship')
26-
->setMajor(12)
27-
->setIntermediate(1)
26+
->setMajor(28)
27+
->setIntermediate(0)
2828
->setMinor(0);
2929

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

43-
44-
$validateShipmentRequest = new ShipService\Request();
45-
$validateShipmentRequest->getSoapClient()->__setLocation('https://ws.fedex.com:443/web-services/ship');
46-
$response = $validateShipmentRequest->getDeleteShipmentReply($deleteShipmentRequest);
47-
48-
var_dump($response);
43+
$request = new ShipService\Request();
44+
try {
45+
$deleteShipmentReply = $request->getDeleteShipmentReply($deleteShipmentRequest);
46+
var_dump($deleteShipmentReply);
47+
} catch (\Exception $e) {
48+
echo $e->getMessage();
49+
echo $request->getSoapClient()->__getLastResponse();
50+
}

examples/in-flight-shipment-service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373

7474

7575
$request = new Request();
76-
7776
try {
7877
$processDeliveryReply = $request->getProcessDeliveryReply($processDeliveryRequest);
7978
var_dump($processDeliveryReply);
8079
} catch (\Exception $e) {
80+
echo $e->getMessage();
8181
echo $request->getSoapClient()->__getLastResponse();
8282
}

examples/rate-request.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
//version
2626
$rateRequest->Version->ServiceId = 'crs';
27-
$rateRequest->Version->Major = 28;
27+
$rateRequest->Version->Major = 31;
2828
$rateRequest->Version->Minor = 0;
2929
$rateRequest->Version->Intermediate = 0;
3030

examples/ship.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
$version = new ComplexType\VersionId();
2929
$version
30-
->setMajor(26)
30+
->setMajor(28)
3131
->setIntermediate(0)
3232
->setMinor(0)
3333
->setServiceId('ship');

examples/track-by-id.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
//remember to copy example.credentials.php as credentials.php replace 'FEDEX_KEY', 'FEDEX_PASSWORD', 'FEDEX_ACCOUNT_NUMBER', and 'FEDEX_METER_NUMBER'
33
require_once 'credentials.php';
44
require_once 'bootstrap.php';
55

@@ -22,7 +22,7 @@
2222

2323
// Version
2424
$trackRequest->Version->ServiceId = 'trck';
25-
$trackRequest->Version->Major = 19;
25+
$trackRequest->Version->Major = 20;
2626
$trackRequest->Version->Intermediate = 0;
2727
$trackRequest->Version->Minor = 0;
2828

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

4343
$request = new Request();
44-
$trackReply = $request->getTrackReply($trackRequest);
45-
46-
var_dump($trackReply);
44+
try {
45+
$trackReply = $request->getTrackReply($trackRequest);
46+
var_dump($trackReply);
47+
} catch (\Exception $e) {
48+
echo $e->getMessage();
49+
echo $request->getSoapClient()->__getLastResponse();
50+
}

0 commit comments

Comments
 (0)