2017 © Pedro Peláez
 

symfony-bundle converter-bundle

Currency converting bundle for Symfony2. Supports multiple exchange rate providers.

image

morbicer/converter-bundle

Currency converting bundle for Symfony2. Supports multiple exchange rate providers.

  • Wednesday, September 9, 2015
  • by morbicer
  • Repository
  • 1 Watchers
  • 3 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

converter-bundle

Currency converting bundle for Symfony2. Supports multiple exchange rate providers: * Yahoo (free) * Google (free) * Currency API (free) * chain (tries multiple if some is unavailable), (*1)

proper money handling using Martin Fowler's Money pattern implemented by mathiasverraes/money, (*2)

1 Installation

1.1 Composer

"require": {
  ....
  "morbicer/converter-bundle": "dev"
},

or, (*3)

php composer.phar require morbicer/converter-bundle

1.2 Enable the bundle

// app/AppKernel.php
public function registerBundles()
{
      $bundles = array(
        // ...
        new Morbicer\ConverterBundle\MorbicerConverterBundle(),
    );
}

1.3 Add config

# app/config.yml
morbicer_converter:
  default_provider: chain
  providers:
      yahoo: []
      google: []
      currency_api: []
      chain: [yahoo, currency_api, google]

Usage

//in controller, get service
$converter = $this->get('morbicer_converter.convert');
// $100 USD to EUR
$converted = $converter->convert(100, 'USD', 'EUR');
$result = array(
    'amount' => $converted->getAmount()/100,
    'currency' => (string)$converted->getCurrency(),
);

The Versions

09/09 2015

dev-master

9999999-dev

Currency converting bundle for Symfony2. Supports multiple exchange rate providers.

  Sources   Download

MIT

The Requires

 

by Marek Saktor

09/09 2015

0.0.1

0.0.1.0

Currency converting bundle for Symfony2. Supports multiple exchange rate providers.

  Sources   Download

MIT

The Requires

 

by Marek Saktor