ernadoo / mondial-relay-bundle
Mondial Relay Bundle for Symfony
Fund package maintenance!
ernadoo
Installs: 151
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1 || ^8.0
- quentinbontemps/php-mondialrelay-api: ^1.0
- symfony/framework-bundle: ^5.4 || ^6.4
- symfony/profiler-pack: *
README
Description
This package uses QuentinBontemps/php-mondialrelay-api.
This client allow to use the Mondial Relay Soap API with Symfony.
Installation
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
$ composer require ernadoo/mondial-relay-bundle
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require ernadoo/mondial-relay-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... Ernadoo\MondialRelayBundle\ErnadooMondialRelayBundle::class => ['all' => true], ];
Step 3: Configure the Bundle
# config/packages/ernadoo_mondial_relay.yaml ernadoo_mondial_relay: api: wsdl: https://api.mondialrelay.com/Web_Services.asmx?WSDL options: trace: '%kernel.debug%' #keep_alive : false #cache_wsdl : !php/const WSDL_CACHE_NONE credentials: customer_code: secret_key: brand_id:
Usage
# src\Controller\DefaultController.php <?php namespace App\Controller; use MondialRelay\ApiClient; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class DefaultController extends AbstractController { public function findDeliveryPoints(ApiClient $mondialRelayClient) { $shops = $mondialRelayClient->findDeliveryPoints([ 'Pays' => 'FR', 'Ville' => 'Paris', 'CP' => '75000', 'DelaiEnvoi' => "0", 'RayonRecherche' => '20', 'NombreResultats' => '10', ]); } }
Contribution
Contributions are always welcome.