{"id":20601167,"url":"https://github.com/cleverage/colissimobundle","last_synced_at":"2025-04-15T01:35:41.286Z","repository":{"id":47166204,"uuid":"515218936","full_name":"cleverage/ColissimoBundle","owner":"cleverage","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-18T08:24:38.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T03:17:17.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleverage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-18T14:29:50.000Z","updated_at":"2025-02-18T08:26:55.000Z","dependencies_parsed_at":"2025-01-20T09:22:22.762Z","dependency_job_id":"c8fb8d0e-5c53-49ff-80ac-26255d62ed12","html_url":"https://github.com/cleverage/ColissimoBundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FColissimoBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FColissimoBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FColissimoBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FColissimoBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleverage","download_url":"https://codeload.github.com/cleverage/ColissimoBundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989836,"owners_count":21194650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:08:54.022Z","updated_at":"2025-04-15T01:35:41.267Z","avatar_url":"https://github.com/cleverage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CleverAge/ColissimoBundle\n\n## Introduction\n\nThis bundle provides services to access and consume the Colissimo WS.\n\n### Services\n\n- [Shipping](https://www.colissimo.entreprise.laposte.fr/sites/default/files/2022-04/DT_Flexibilite_Expedition_Web_Service_Affranchissement_202204_FR.pdf)\n- [Pickup points](https://www.colissimo.entreprise.laposte.fr/sites/default/files/2021-10/WebService-points-retrait_FR.pdf)\n- [Tracking](https://www.colissimo.entreprise.laposte.fr/sites/default/files/2021-08/CDC_WebServiceTrackingTL-v2.1_FR.pdf)\n\n### Requirements\n\n- Php \u003e= 7.4\n- Symfony 4, 5 or 6\n\n## Installation\n\n### Pretty simple with [Composer](http://packagist.org), run\n\n```sh\ncomposer require cleverage/colissimo-bundle\n```\n\n### Register bundle inside your application :\n\n```php\n// config/bundles.php\nCleverAge\\ColissimoBundle\\CleverAgeColissimoBundle::class =\u003e ['all' =\u003e true],\n```\n\n### Configuration example :\n\nInside `config/packages/cleverage_colissimo.yaml`\n\n```yaml\nclever_age_colissimo:\n  testModeEnabled: true\n  auth:\n    contractNumber: '22020'\n    password: 'password'\n  letter:\n    service:\n      commercialName: 'CommercialName'\n    sender:\n      companyName: 'CompanyName'\n      line0: null\n      line1: null\n      line2: '9 rue André darbon'\n      line3: null\n      countryCode: 'FR'\n      zipCode: '33300'\n      city: 'Bordeaux'\n```\n\n## Usage examples :\n\n### Get pickup points\n\n```php\nclass PickupPointsController extends AbstractController\n{\n    private PickupPointsService $pickupPointsService;\n\n    public function __construct(\n        PickupPointsService $pickupPointsService\n    ) {\n        $this-\u003epickupPointsService = $pickupPointsService;\n    }\n\n    public function index()\n    {\n        $searchModel = new PickupPointsSearchModel(\n            '33300',\n            'Bordeaux',\n            'FR',\n            '18/07/2022',\n        );\n\n        // Return an array of PickupPoint::class\n        $pickupPoints = $this-\u003epickupPointsService-\u003ecall($searchModel);\n\n        foreach ($pickupPoints as $pickupPoint) {\n            // Get data by identifier.\n            // @see PickupPoint to show all identifiers available.\n            echo $pickupPoint-\u003eget('id'); // 987178\n            echo $pickupPoint-\u003eget('name'); // ALEX TISSUS\n        }\n\n        // ....\n    }\n}\n```\n\n### Get pickup point by ID\n\n```php\nclass PickupPointByIdController extends AbstractController\n{\n    private PickupPointByIdService $pickupPointByIdService;\n\n    public function __construct(\n        PickupPointByIdService $pickupPointByIdService\n    ) {\n        $this-\u003epickupPointByIdService = $pickupPointByIdService;\n    }\n\n    public function index()\n    {\n        $searchByIdModel = new PickupPointSearchByIdModel('987178', '18/07/2022');\n        $pickupPoint = $this-\u003epickupPointByIdService-\u003ecall($searchByIdModel);\n\n        if (null !== $pickupPoint) {\n            echo $pickupPoint-\u003eget('name'); // ALEX TISSUS\n        }\n\n        // ....\n    }\n}\n```\n\n### Tracking\n\n```php\nclass TrackingController extends AbstractController\n{\n    private TrackingService $trackingService;\n\n    public function __construct(\n        TrackingService $trackingService\n    ) {\n        $this-\u003etrackingService = $trackingService;\n    }\n\n    public function index()\n    {\n        $trackingSearchModel = new TrackingSearchModel();\n        $trackingSearchModel\n            -\u003esetLang('FR') // FR is set by default. This line is optionnal.\n            -\u003esetParcelNumber('ABNUABSASNLK');\n\n        $tracking = $this-\u003etrackingService-\u003ecall($trackingSearchModel);\n\n        $tracking-\u003egetParcel();\n        $tracking-\u003egetSteps();\n        $tracking-\u003egetEvents();\n\n        // @see TrackingResponse::class for usable getters.\n        // ....\n    }\n}\n```\n\n### Shipping\n\n```php\nclass ShippingController extends AbstractController\n{\n    private ShippingService $shippingService;\n\n    public function __construct(\n        ShippingService $shippingService\n    ) {\n        $this-\u003eshippingService = $shippingService;\n    }\n\n    public function index()\n    {\n        $label = new Label();\n\n        $outputFormat = new OutputFormat();\n        $outputFormat-\u003esetOutputPrintingType(OutputPrintingType::ZPL_10x10_300dpi);\n\n        $label-\u003esetOutputFormat($outputFormat);\n\n        $letter = new Letter();\n\n        $service = new Letter\\Service();\n        $service-\u003esetProductCode(ProductCode::DOM)\n            -\u003esetDepositDate((new \\DateTime())-\u003eformat('Y-d-m'))\n            -\u003esetOrderNumber('orderNumber');\n\n        $letter-\u003esetService($service);\n\n        $parcel = new Letter\\Parcel();\n        $parcel-\u003esetWeight(3);\n        // If it's delivery on pickup point\n        $parcel-\u003esetPickupLocationId('987178');\n\n        $letter-\u003esetParcel($parcel);\n\n        $addressee = new Letter\\Addressee();\n        $addressee-\u003esetEmail('test@clever-age.com')\n            -\u003esetFirstName('John')\n            -\u003esetLastName('Doe')\n            -\u003esetLine2('9 rue André darbon')\n            -\u003esetCity('Bordeaux')\n            -\u003esetCountryCode('FR')\n            -\u003esetZipCode('33300');\n\n        $letter-\u003esetAddressee($addressee);\n\n        $label-\u003esetLetter($letter);\n\n        $shipping = $this-\u003eshippingService-\u003ecall($label);\n\n        echo $shipping-\u003egetParcelNumber(); // AIAOBOIABS\n        echo $shipping-\u003egetPdfUrl(); // null or the pdf url.\n        echo $shipping-\u003egetParcelNumberPartner(); // null or the parcel number partner.\n        echo $shipping-\u003egetFields(); // Array of custom fields.\n\n        // ...\n    }\n}\n```\n\n### Product inter\n\n```php\nclass ProductInterController extends AbstractController\n{\n    private ProductInterService $productInterService;\n\n    public function __construct(\n        ProductInterService $productInterService\n    ) {\n        $this-\u003eproductInterService = $productInterService;\n    }\n\n    public function index()\n    {\n        $productInter = new ProductInter();\n        $productInter-\u003esetCountryCode('FR')\n            -\u003esetZipCode('33300')\n            -\u003esetProductCode(ProductCode::DOM)\n            -\u003esetInsurance(false) // Default false. Optional.\n            -\u003esetNonMachinable(false) // Default false. Optional.\n            -\u003esetReturnReceipt(false); // Default false. Optional.\n\n        $response = $this-\u003eproductInterService-\u003ecall($productInter);\n\n        $response-\u003egetProduct(); // Array of product codes.\n        $response-\u003egetReturnTypeChoice(); // Array of return choice types.\n\n        // ...\n    }\n}\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcolissimobundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleverage%2Fcolissimobundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcolissimobundle/lists"}