gabrielbull / php-ups-api

PHP Wrapper for all UPS API
MIT License
456 stars 255 forks source link

Add support for Language character set expected on label. #234

Closed Radeq closed 5 years ago

Radeq commented 6 years ago

Implemented support for ShipmentRequest/LabelSpecification/CharacterSet .

characterset

Example code usage when create Shipment

use Ups\Entity\ShipmentRequestLabelSpecification;

        $lspec = new ShipmentRequestLabelSpecification(ShipmentRequestLabelSpecification::PRINT_METHOD_CODE_GIF);
        $lspec->setImageFormatCode(ShipmentRequestLabelSpecification::PRINT_METHOD_CODE_GIF);
        $lspec->setCharacterSet(ShipmentRequestLabelSpecification::CHARACTER_SET_POLISH);
        $api->confirm(\Ups\Shipping::REQ_VALIDATE, $shipment, $lspec);

This is usefull for local diactric marks. If you don't set CharacterSet, printed label will be without local characters (?WINOUJ?CIE instead ŚWINOUJŚCIE)

Edit: I fixed styleCi by ammend commit, sorry for the trouble.