@@ -623,7 +623,7 @@ protected function _getXmlQuotes()
623
623
$ serviceCode = null ;
624
624
} else {
625
625
$ params ['10_action ' ] = 'Rate ' ;
626
- $ serviceCode = $ rowRequest ->getProduct () ? $ rowRequest ->getProduct () : '' ;
626
+ $ serviceCode = $ rowRequest ->getProduct () ? $ rowRequest ->getProduct () : null ;
627
627
}
628
628
$ serviceDescription = $ serviceCode ? $ this ->getShipmentByCode ($ serviceCode ) : '' ;
629
629
@@ -657,8 +657,8 @@ protected function _getXmlQuotes()
657
657
<Shipper>
658
658
XMLRequest ;
659
659
660
- if ($ this ->getConfigFlag ('negotiated_active ' ) && ($ shipper = $ this ->getConfigData ('shipper_number ' ))) {
661
- $ xmlParams .= "<ShipperNumber> {$ shipper }</ShipperNumber> " ;
660
+ if ($ this ->getConfigFlag ('negotiated_active ' ) && ($ shipperNumber = $ this ->getConfigData ('shipper_number ' ))) {
661
+ $ xmlParams .= "<ShipperNumber> {$ shipperNumber }</ShipperNumber> " ;
662
662
}
663
663
664
664
if ($ rowRequest ->getIsReturn ()) {
@@ -681,6 +681,7 @@ protected function _getXmlQuotes()
681
681
<StateProvinceCode> {$ shipperStateProvince }</StateProvinceCode>
682
682
</Address>
683
683
</Shipper>
684
+
684
685
<ShipTo>
685
686
<Address>
686
687
<PostalCode> {$ params ['19_destPostal ' ]}</PostalCode>
@@ -696,8 +697,7 @@ protected function _getXmlQuotes()
696
697
$ xmlParams .= <<<XMLRequest
697
698
</Address>
698
699
</ShipTo>
699
-
700
-
700
+
701
701
<ShipFrom>
702
702
<Address>
703
703
<PostalCode> {$ params ['15_origPostal ' ]}</PostalCode>
@@ -707,9 +707,13 @@ protected function _getXmlQuotes()
707
707
</ShipFrom>
708
708
709
709
<Package>
710
- <PackagingType><Code> {$ params ['48_container ' ]}</Code></PackagingType>
710
+ <PackagingType>
711
+ <Code> {$ params ['48_container ' ]}</Code>
712
+ </PackagingType>
711
713
<PackageWeight>
712
- <UnitOfMeasurement><Code> {$ rowRequest ->getUnitMeasure ()}</Code></UnitOfMeasurement>
714
+ <UnitOfMeasurement>
715
+ <Code> {$ rowRequest ->getUnitMeasure ()}</Code>
716
+ </UnitOfMeasurement>
713
717
<Weight> {$ params ['23_weight ' ]}</Weight>
714
718
</PackageWeight>
715
719
</Package>
@@ -720,8 +724,8 @@ protected function _getXmlQuotes()
720
724
}
721
725
722
726
$ xmlParams .= <<<XMLRequest
723
- </Shipment>
724
- </RatingServiceSelectionRequest>
727
+ </Shipment>
728
+ </RatingServiceSelectionRequest>
725
729
XMLRequest ;
726
730
727
731
$ xmlRequest .= $ xmlParams ;
@@ -873,10 +877,13 @@ protected function _parseXmlResponse($xmlResponse)
873
877
$ error = $ this ->_rateErrorFactory ->create ();
874
878
$ error ->setCarrier ('ups ' );
875
879
$ error ->setCarrierTitle ($ this ->getConfigData ('title ' ));
880
+ if ($ this ->getConfigData ('specificerrmsg ' ) !== '' ) {
881
+ $ errorTitle = $ this ->getConfigData ('specificerrmsg ' );
882
+ }
876
883
if (!isset ($ errorTitle )) {
877
884
$ errorTitle = __ ('Cannot retrieve shipping rates ' );
878
885
}
879
- $ error ->setErrorMessage ($ this -> getConfigData ( ' specificerrmsg ' ) );
886
+ $ error ->setErrorMessage ($ errorTitle );
880
887
$ result ->append ($ error );
881
888
} else {
882
889
foreach ($ priceArr as $ method => $ price ) {
@@ -982,14 +989,14 @@ protected function _getXmlTracking($trackings)
982
989
$ xmlRequest = $ this ->_xmlAccessRequest ;
983
990
984
991
/**
985
- * RequestOption==>'activity' or ' 1' to request all activities
992
+ * RequestOption==>'1' to request all activities
986
993
*/
987
994
$ xmlRequest .= <<<XMLAuth
988
995
<?xml version="1.0" ?>
989
996
<TrackRequest xml:lang="en-US">
990
997
<Request>
991
998
<RequestAction>Track</RequestAction>
992
- <RequestOption>activity </RequestOption>
999
+ <RequestOption>1 </RequestOption>
993
1000
</Request>
994
1001
<TrackingNumber> $ tracking</TrackingNumber>
995
1002
<IncludeFreight>01</IncludeFreight>
@@ -1064,15 +1071,15 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1064
1071
if ($ activityTags ) {
1065
1072
$ index = 1 ;
1066
1073
foreach ($ activityTags as $ activityTag ) {
1067
- $ addArr = [];
1074
+ $ addressArr = [];
1068
1075
if (isset ($ activityTag ->ActivityLocation ->Address ->City )) {
1069
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->City ;
1076
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->City ;
1070
1077
}
1071
1078
if (isset ($ activityTag ->ActivityLocation ->Address ->StateProvinceCode )) {
1072
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->StateProvinceCode ;
1079
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->StateProvinceCode ;
1073
1080
}
1074
1081
if (isset ($ activityTag ->ActivityLocation ->Address ->CountryCode )) {
1075
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->CountryCode ;
1082
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->CountryCode ;
1076
1083
}
1077
1084
$ dateArr = [];
1078
1085
$ date = (string )$ activityTag ->Date ;
@@ -1096,8 +1103,8 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1096
1103
//HH:MM:SS
1097
1104
$ resultArr ['deliverylocation ' ] = (string )$ activityTag ->ActivityLocation ->Description ;
1098
1105
$ resultArr ['signedby ' ] = (string )$ activityTag ->ActivityLocation ->SignedForByName ;
1099
- if ($ addArr ) {
1100
- $ resultArr ['deliveryto ' ] = implode (', ' , $ addArr );
1106
+ if ($ addressArr ) {
1107
+ $ resultArr ['deliveryto ' ] = implode (', ' , $ addressArr );
1101
1108
}
1102
1109
} else {
1103
1110
$ tempArr = [];
@@ -1106,8 +1113,8 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1106
1113
//YYYY-MM-DD
1107
1114
$ tempArr ['deliverytime ' ] = implode (': ' , $ timeArr );
1108
1115
//HH:MM:SS
1109
- if ($ addArr ) {
1110
- $ tempArr ['deliverylocation ' ] = implode (', ' , $ addArr );
1116
+ if ($ addressArr ) {
1117
+ $ tempArr ['deliverylocation ' ] = implode (', ' , $ addressArr );
1111
1118
}
1112
1119
$ packageProgress [] = $ tempArr ;
1113
1120
}
0 commit comments