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

ship for international issue #113

Closed codercodercodercoder closed 2 years ago

codercodercodercoder commented 5 years ago

If both the recipient and sender are in the United States, they work well. But if the recipient is in Canada, there is a problem.

irst I change serviceType to INTERNATIONAL_PRIORITY,then I get a error,the code is 2033 and the message is Customs Value is required.

So I add this code: $money = new ComplexType\Money(); $money->setCurrency('USD'); $money->setAmount('120'); $cus = new ComplexType\CustomsClearanceDetail(); $cus->setCustomsValue($money); $requestedShipment->setCustomsClearanceDetail($cus); Then I get two errors.First error code is 6005,message is Commodities are required.Second error code is 2009, message is Duties payment type is not compatible with destination country.

I added some more code: ` $payor = new ComplexType\Payor();

$payor->setResponsibleParty($recipient);

$pay = new ComplexType\Payment();

$pay->setPaymentType(SimpleType\PaymentType::_SENDER);

$pay->setPayor($payor);

$arr = array('name'=>'test','NumberOfPieces'=>5,'Description'=>'tetetetetetetet','CountryOfManufacture'=>'CN','HarmonizedCode'=>'851711100000','weight'=>array('Value' => 10,'Units' => SimpleType\WeightUnits::_LB),'Quantity'=>1,'QuantityUnits'=>'PCS');

$cus->setCustomsValue($money);

$cus->setDutiesPayment($pay); `

But still not right,I get a new error that 'SOAP-ERROR: Encoding: object has no 'Weight' property'.

Can you help me out? Thank you very much!

mswaqas commented 4 years ago

I'm also facing the same issue. Capture

nikunjsilvercayde commented 4 years ago

I am also getting below error.. [HighestSeverity] => ERROR [Notifications] => Array ( [0] => FedEx\ShipService\ComplexType\Notification Object ( [name:protected] => Notification [values:protected] => Array ( [Severity] => ERROR [Source] => ship [Code] => 6065 [Message] => Commodities are required [LocalizedMessage] => Commodities are required )

                    )

            )
lizeshakya commented 3 years ago

Any solutions found? I am struck with the same problem

lizeshakya commented 3 years ago

Thank you for helping out @codercodercodercoder

But still not right,I get a new error that 'SOAP-ERROR: Encoding: object has no 'Weight' property'.

Can you help me out? Thank you very much!

You might need to provide the Weight Class in the requestedPackageLink. I did similar like:

$requestedPackageLineItem->Dimensions->Length = 0;
$requestedPackageLineItem->Dimensions->Units = SimpleType\LinearUnits::_IN;
$requestedPackageLineItem->Weight->Value = 151;
$requestedPackageLineItem->Weight->Units = SimpleType\WeightUnits::_LB;
$requestedPackageLineItem->setCustomerReferences([$refCust, $refDept, $refPO]);
$requestedPackageLineItems[] = $requestedPackageLineItem;

For Commodity Model

$commodity = new ComplexType\Commodity([
    'NumberOfPieces' => 1,
    'Description' =>'Testing Name',
    'CountryOfManufacture' => 'MX',
    'Weight' => new ComplexType\Weight([
        'Units' => SimpleType\WeightUnits::_LB,
        'Value' => 2000
    ]),
    'Quantity' => $item->getQuantity(),
    'QuantityUnits' => 'EA',
    'UnitPrice' => new Money([
        'Currency' => 'USD',
        'Amount' => $unitValue
    ]),
]);
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.