PHP code example of quicktech-as / cargonizer

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

    

quicktech-as / cargonizer example snippets


Quicktech\Cargonizer\CargonizerServiceProvider::class,

'Cargonizer'   => Quicktech\Cargonizer\Facades\Cargonizer::class,

CARGONIZER_ENDPOINT = 'http://sandbox.cargonizer.no'
CARGONIZER_SENDER = 'your send id'
CARGONIZER_SECRET_KEY = 'your secret key'

$params = [
    'consignment' => [
        '@attributes' => [
            'transport_agreement' => '1'
        ],
        'product' => 'tg_dpd_innland',
        'parts' => [
            'consignee' => [
                'country' => 'NO',
                'postcode' => '1337'
            ]
        ],
        'itens' => [
            'item' => [
                '@attributes' => [
                    'type' => 'package',
                    'amount' => '1',
                    'weight' => '12'
                ]
            ]
        ]
    ]
];

$consignmentCosts = Cargonizer::consignmentCosts($params);

[
    'estimated_cost' => 495,
    'gross_mount'    => 495,
    'net_amount'     => 495
]
shell
php artisan vendor:publish