PHP code example of tectiv3 / bcbp

1. Go to this page and download the library: Download tectiv3/bcbp 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/ */

    

tectiv3 / bcbp example snippets




unction Bcbp\decode;

$barcode = 'M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 106>60000';
$result = decode($barcode);

print_r($result);

$result = decode($barcode, 2016);



unction Bcbp\encode;

$payload = [
    'data' => [
        'passengerName' => 'DESMARAIS/LUC',
        'legs' => [
            [
                'operatingCarrierPNR' => 'ABC123',
                'departureAirport' => 'YUL',
                'arrivalAirport' => 'FRA',
                'operatingCarrierDesignator' => 'AC',
                'flightNumber' => '0834',
                'flightDate' => new DateTimeImmutable('2016-01-01T00:00:00+00:00'),
                'compartmentCode' => 'F',
                'seatNumber' => '001A',
                'checkInSequenceNumber' => '0025',
                'passengerStatus' => '1',
                'fastTrack' => false,
            ],
        ],
    ],
];

$barcode = encode($payload);