承接 lexik/colissimo-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lexik/colissimo-bundle

Composer 安装命令:

composer require lexik/colissimo-bundle

包简介

This bundle provides a wrapper for the lexik/ws-colissimo library

README 文档

README

This bundle provides services to access and consume the WSColiPosteLetterService using the Lexik WSColissimo library.

Project Status

SensioLabsInsight

This bundle is deprecated

WSColiPosteLetterService

Use the WSColiPosteLetterService to generate shipping labels for Colissimo Parcels.

Installation

Download using composer

Add the bundle to your composer.json :

{
    "require": {
        "lexik/colissimo-bundle": "dev-master"
    }
}

Download it by running the command :

php composer.phar update lexik/colissimo-bundle

Enable the bundle

Enable the bundle in your app/AppKernel.php :

public function registerBundles()
{
    $bundles = array(
        // ...
        new Lexik\Bundle\ColissimoBundle\LexikColissimoBundle(),
    );
}

Configuration

Below is a minimal example of the configuration necessary to use the LexikColissimoBundle in your application:

lexik_colissimo:
    ws_coliposte_letter_service:
        contract_number:         123456               # mandatory
        password:                'abcdef'             # mandatory
        service_call_context:
            commercial_name:     'ACME COMPANY'
        sender:                                       # you can overwrite this part from your code
            company_name:        'ACME COMPANY'
            line_0:              null   
            line_1:              null
            line_2:              'Place de la Comedie'
            line_3:              null
            postal_code:         '34000'
            city:                'Montpellier'

Usage

Get the service from the container, call the getLabel method with your parcel and recipient informations as arguments :

// use Lexik\Bundle\ColissimoBundle\Exception\InvalidRequestException;
// use Lexik\Bundle\ColissimoBundle\Exception\FailedRequestException;

$colissimo = $this->container->get('lexik_colissimo.ws_coliposte_letter_service.service');

try {

    $response = $colissimo->getLabel(
        array('weight' => 1.780),
        array(
            'name'       => 'Client Name',
            'surname'    => 'Client Surname',
            'email'      => 'client@email.com',
            'line2'      => 'Client Address',
            'city'       => 'Client City',
            'postalCode' => 'Client Postal Code'
        )
	// you can overwrite the sender configured in you app/config.yml by passing an array as 3rd argument
	// you can disable validation by setting the 4th argument to false
    );
    
    // $response looks like this
    object(WSColissimo\WSColiPosteLetterService\Response\ValueObject\ReturnLetter)[1102]
      protected 'file' => null
      protected 'parcelNumber' => string '13xc1v654d123' (length=13)
      protected 'PdfUrl' => string 'https://ws.colissimo.fr/path/to/pdf-file' (length=40)
      protected 'errorID' => int 0
      protected 'error' => string '' (length=0)
      protected 'signature' => null
      protected 'dateCreation' => null

} catch (InvalidRequestException $e) {
    // validation problems : you can iterate over errors with $e->getViolations()
} catch (FailedRequestException $e) {
    // webservice returned an error : you can get the error message with $e->getMessage()
}

lexik/colissimo-bundle 适用场景与选型建议

lexik/colissimo-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 137 次下载、GitHub Stars 达 17, 最近一次更新时间为 2013 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Symfony2」 「bundle」 「colissimo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lexik/colissimo-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lexik/colissimo-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 lexik/colissimo-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 137
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 10
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-03-15