PHP code example of jplarar / enviapaqueteria-bundle

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

    

jplarar / enviapaqueteria-bundle example snippets

 bash
$ php composer.phar update "jplarar/enviapaqueteria-bundle"
 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Jplarar\EnviapaqueteriaBundle\EnviapaqueteriaBundle()
    );
}
 php

        $enviapaqueteriaClient = $this->get('enviapaqueteria_client');
 php
 
    $quotes = $enviapaqueteriaClient->quote(
                    $origin = [
                        "representative" => "Origen test",
                        "company" => "Origen Empresa",
                        "email" => "[email protected]",
                        "phone" => "8111234567",
                        "country" => "MX",
                        "address1" => "av vasconcelos",
                        "address2" => "1400",
                        "addressExtra" => "enfrente de office depot",
                        "zipCode" => "66240"
                    ], 
                    $destination = [
                        "representative" => "Destino test",
                        "company" => "Origen Empresa",
                        "email" => "[email protected]",
                        "phone" => "8111234567",
                        "country" => "MX",
                        "address1" => "av vasconcelos",
                        "address2" => "1400",
                        "addressExtra" => "enfrente de office depot",
                        "zipCode" => "66240"
                    ], 
                    $options = [
                        "content" => "vestido",
                        "insurance" => 0,
                        "value" => "",
                        "height" => 10,
                        "width" => 10,
                        "length" => 10,
                        "weight" => 2,
                        "amount" => 1,
                        "collection" => null,
                        "collection_time" => "",
                        "collection_time_limit" => "",
                        "collection_date" => ""
                    ]
            );
            
    $shipping = $enviapaqueteriaClient->create(
                    $provider = [
                        "name" => "fedex",
                        "service" => "FEDEX_EXPRESS_SAVER"   
                     ],
                    $origin = [
                        "representative" => "Origen test",
                        "company" => "Origen Empresa",
                        "email" => "[email protected]",
                        "phone" => "8111234567",
                        "country" => "MX",
                        "address1" => "av vasconcelos",
                        "address2" => "1400",
                        "addressExtra" => "enfrente de office depot",
                        "zipCode" => "66240"
                    ], 
                    $destination = [
                        "representative" => "Destino test",
                        "company" => "Origen Empresa",
                        "email" => "[email protected]",
                        "phone" => "8111234567",
                        "country" => "MX",
                        "address1" => "av vasconcelos",
                        "address2" => "1400",
                        "addressExtra" => "enfrente de office depot",
                        "zipCode" => "66240"
                    ], 
                    $options = [
                        "content" => "vestido",
                        "insurance" => 0,
                        "value" => "",
                        "height" => 10,
                        "width" => 10,
                        "length" => 10,
                        "weight" => 2,
                        "amount" => 1,
                        "collection" => null,
                        "collection_time" => "",
                        "collection_time_limit" => "",
                        "collection_date" => "",
                        "file" => "PDF",
                        "paper" => "PAPER_7X4.75",
                    ]
                );