jplarar/enviapaqueteria-bundle
Composer 安装命令:
composer require jplarar/enviapaqueteria-bundle
包简介
A simple Symfony2 bundle for Envia API.
README 文档
README
A simple Symfony2 bundle for the API for Envia Paqueteria API.
Setup
Step 1: Download JplararEnviapaqueteriaBundle using composer
Add SES Bundle in your composer.json:
{ "require": { "jplarar/enviapaqueteria-bundle": "dev-master" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update "jplarar/enviapaqueteria-bundle"
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Jplarar\EnviapaqueteriaBundle\EnviapaqueteriaBundle() ); }
Step 3: Add configuration
# app/config/config.yml jplarar_enviapaqueteria: enviapaqueteria_keys: enviapaqueteria_user: %enviapaqueteria_user% enviapaqueteria_password: %enviapaqueteria_password% enviapaqueteria_environment: %enviapaqueteria_environment% # 'prod' or 'dev'
Usage
Using service
<?php $enviapaqueteriaClient = $this->get('enviapaqueteria_client'); ?>
##Example
###Generate Quote
<?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" => "" ] ); $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", ] ); ?>
统计信息
- 总下载量: 107
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-29