alfallouji / DHL-API

This library provides a PHP client for the DHL XML Services. DHL XML Services is an online web services integration capability that provides DHL’s service availability, transit times, rates, shipment and courier pickup booking along with shipment tracking from over 140 countries around the world. Using DHL’s XML Services, customers can incorporate DHL shipping functionality into their websites, customer service applications or order processing systems.
191 stars 148 forks source link

Multiple SpecialServiceType for the shipment validation request is not working as expected #10

Closed suriyabaskaran closed 9 years ago

suriyabaskaran commented 9 years ago

The following sample code from the file ShipmentRequest.php is accepting only one type, in this case just "I".

$sample->SpecialService->SpecialServiceType = 'A';
$sample->SpecialService->SpecialServiceType = 'I';

I need the output to be like this

<specialservice>
    <specialservicetype>A</specialservicetype>
</specialservice>

<specialservice>
    <specialservicetype>I</specialservicetype>
</specialservice>
alfallouji commented 9 years ago

You can use it like this now :

use DHL\Datatype\GB\SpecialService;

$specialService = new SpecialService();
$specialService->SpecialServiceType = 'A';
$sample->addSpecialService($specialService);

$specialService = new SpecialService();
$specialService->SpecialServiceType = 'I';
$sample->addSpecialService($specialService);