-
Notifications
You must be signed in to change notification settings - Fork 184
/
in-flight-shipment-service.php
82 lines (68 loc) · 5.32 KB
/
in-flight-shipment-service.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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\InFlightShipmentService\Request;
use FedEx\InFlightShipmentService\ComplexType;
use FedEx\InFlightShipmentService\SimpleType;
$processDeliveryRequest = new ComplexType\ProcessDeliveryRequest();
// Authentication & client details.
$processDeliveryRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY;
$processDeliveryRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD;
$processDeliveryRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER;
$processDeliveryRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER;
// Version.
$processDeliveryRequest->Version->ServiceId = 'ifss';
$processDeliveryRequest->Version->Major = 1;
$processDeliveryRequest->Version->Intermediate = 0;
$processDeliveryRequest->Version->Minor = 0;
// Action requested.
$processDeliveryRequest->ActionRequested = SimpleType\DeliveryActionType::_ADD;
// Unique tracking number.
$processDeliveryRequest->UniqueTrackingNumber->TrackingNumber = '794908703761';
$processDeliveryRequest->UniqueTrackingNumber->TrackingNumberUniqueIdentifier = '2458095000~794908703761~FX';
$processDeliveryRequest->UniqueTrackingNumber->ShipDate = '2017-12-07';
// Recipient contact.
$processDeliveryRequest->RecipientContact->PersonName = 'Recipient_Name';
$processDeliveryRequest->RecipientContact->CompanyName = 'CSCSWAPI-WBUS1100';
$processDeliveryRequest->RecipientContact->PhoneNumber = '9018549236';
$processDeliveryRequest->RecipientContact->EMailAddress = '[email protected]';
// Destination address.
$processDeliveryRequest->DestinationAddress->StreetLines = ['Recipient_Address_Line1', 'Recipient_Address_Line2'];
$processDeliveryRequest->DestinationAddress->City = 'CARROLTON';
$processDeliveryRequest->DestinationAddress->StateOrProvinceCode = 'TX';
$processDeliveryRequest->DestinationAddress->PostalCode = '750007';
$processDeliveryRequest->DestinationAddress->CountryCode = 'US';
$processDeliveryRequest->DestinationAddress->Residential = false;
// Delivery request detail.
$processDeliveryRequest->DeliveryRequestDetail->Type = SimpleType\DeliveryOptionType::_REDIRECT_TO_HOLD_AT_LOCATION;
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationId = 'ADSA';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationNumber = 0;
// Holding contact.
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->ContactId = 'DRB0705';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->PersonName = 'DEOYANEE BHADANE';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->Title = 'Ms.';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->CompanyName = 'DEOYAROHIT0705$';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->PhoneNumber = '9762308621';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->PhoneExtension = '02033469';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->PagerNumber = '9762308621';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->FaxNumber = '9762308621';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->EMailAddress = 'Deoyanee*[email protected]';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Contact->EMailAddress = 'Deoyanee*[email protected]';
// Holding address.
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->StreetLines = ['1919 E FRANKFORD RD - S G'];
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->City = 'CARROLLTON';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->StateOrProvinceCode = 'TX';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->PostalCode = '75007';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->CountryCode = 'US';
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->HoldingLocationContactAndAddress->Address->Residential = false;
// Comments.
$processDeliveryRequest->DeliveryRequestDetail->RedirectToHoldAtLocationDetail->Comments = 'Please redirect to new address.';
$request = new Request();
try {
$processDeliveryReply = $request->getProcessDeliveryReply($processDeliveryRequest);
var_dump($processDeliveryReply);
} catch (\Exception $e) {
echo $e->getMessage();
echo $request->getSoapClient()->__getLastResponse();
}