JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

Fedex SmartPost Shipping #104

Closed lawkunchi closed 5 years ago

lawkunchi commented 5 years ago

I want to create Fedex Smart Post Shipping Service, I used the ship.php example. I got this error. Any help?

ProcessShipmentReply {#236 ▼
  #name: "ProcessShipmentReply"
  #values: array:3 [▼
    "HighestSeverity" => "ERROR"
    "Notifications" => array:1 [▼
      0 => Notification {#250 ▼
        #name: "Notification"
        #values: array:5 [▼
          "Severity" => "ERROR"
          "Source" => "ship"
          "Code" => "8668"
          "Message" => "Invalid Smart Post Detail"
          "LocalizedMessage" => "Invalid Smart Post Detail"
        ]
      }
    ]
    "Version" => VersionId {#258 ▼
      #name: "VersionId"
      #values: array:4 [▼
        "ServiceId" => "ship"
        "Major" => 23
        "Intermediate" => 0
        "Minor" => 0
      ]
    }
  ]
}
lawkunchi commented 5 years ago

Got it needed to add these values

$requestedShipment->SmartPostDetail->ProcessingOptionsRequested->Options = [SimpleType\SmartPostShipmentProcessingOptionType::_GROUND_TRACKING_NUMBER_REQUESTED];
$requestedShipment->SmartPostDetail->Indicia = SimpleType\SmartPostIndiciaType::_PRESORTED_STANDARD;
$requestedShipment->SmartPostDetail->AncillaryEndorsement = SimpleType\SmartPostAncillaryEndorsementType::_RETURN_SERVICE;
$requestedShipment->SmartPostDetail->HubId = ;