2017 © Pedro Peláez
 

symfony-bundle enviapaqueteria-bundle

A simple Symfony2 bundle for Enviapaqueteria API.

image

jplarar/enviapaqueteria-bundle

A simple Symfony2 bundle for Enviapaqueteria API.

  • Friday, June 29, 2018
  • by jplarar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

JplararEnviapaqueteriaBundle

A simple Symfony2 bundle for the API for Envia Paqueteria API., (*1)

Setup

Step 1: Download JplararEnviapaqueteriaBundle using composer

Add SES Bundle in your composer.json:, (*2)

{
    "require": {
        "jplarar/enviapaqueteria-bundle": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:, (*3)

``` bash $ php composer.phar update "jplarar/enviapaqueteria-bundle", (*4)



### Step 2: Enable the bundle Enable the bundle in the kernel: ``` php get('enviapaqueteria_client'); ?>

Example

Generate Quote

``` php <?php $quotes = $enviapaqueteriaClient->quote( $origin = [ "representative" => "Origen test", "company" => "Origen Empresa", "email" => "correo@pruebas.com", "phone" => "8111234567", "country" => "MX", "address1" => "av vasconcelos", "address2" => "1400", "addressExtra" => "enfrente de office depot", "zipCode" => "66240" ], $destination = [ "representative" => "Destino test", "company" => "Origen Empresa", "email" => "correo@pruebas.com", "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" => "" ] );, (*5)

$shipping = $enviapaqueteriaClient->create(
                $provider = [
                    "name" => "fedex",
                    "service" => "FEDEX_EXPRESS_SAVER"   
                 ],
                $origin = [
                    "representative" => "Origen test",
                    "company" => "Origen Empresa",
                    "email" => "correo@pruebas.com",
                    "phone" => "8111234567",
                    "country" => "MX",
                    "address1" => "av vasconcelos",
                    "address2" => "1400",
                    "addressExtra" => "enfrente de office depot",
                    "zipCode" => "66240"
                ], 
                $destination = [
                    "representative" => "Destino test",
                    "company" => "Origen Empresa",
                    "email" => "correo@pruebas.com",
                    "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",
                ]
            );

?> ```, (*6)

The Versions