PHP code example of padam87 / gls-bundle

1. Go to this page and download the library: Download padam87/gls-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

padam87 / gls-bundle example snippets


$api = $this->get('padam87_gls.parcel_api');
$response = $api->createParcel(
    [
        'consig_address' => $sa->getStreet(),
        'consig_city' => $sa->getCity(),
        'consig_country' => $sa->getCountry(),
        'consig_name' => $sa->getRecipient(),
        'consig_zipcode' => $sa->getZipCode(),
        'consig_contact' => $user->getName(),
        'consig_phone' => $user->getPhone(),
        'consig_email' => $user->getEmail(),
        'content' => $order->getCode(),
        'pickupdate' => (new \DateTime('tomorrow'))->format('Y-m-d'),
    ]
);

if (isset($response['successfull']) && $response['successfull']) {
    $pdf = base64_decode($response['pdfdata']);
    $pcls = $response['pcls'];
}

$api = $this->get('padam87_gls.tracking_api');

if (false !== $info = $api->getParcelInformation('00')) {
    $status = $info['progressBar']['statusInfo'];
}

$provider->getParcelInformation('00,01', true)

$api = $this->get('padam87_gls.pod_download_api');
$pdf = $api->downloadPod($trackingCode);

if (null !== $pdf) {
    // file_put_contents($path, $pdf);
}
yaml
padam87_gls:
    wsdl: 'https://online.gls-hungary.com/webservices/soap_server.php?wsdl&ver=16.12.15.01'
    tracking_url: 'https://gls-group.eu/app/service/open/rest/HU/en/rstt001?match=%1$s'
    config:
        username: '000000000'
        password: '000000000'
        senderid: '000000000'