d3catalyst / exchangerate
Package currency exchange between two currencies
Installs: 463
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 3
Open Issues: 0
pkg:composer/d3catalyst/exchangerate
Requires
- php: >=5.3.7
 - ext-curl: *
 - lib-curl: *
 
Requires (Dev)
- phpdocumentor/phpdocumentor: 2.*
 - phpunit/phpunit: 3.7.*
 
This package is not auto-updated.
Last update: 2025-10-21 09:06:58 UTC
README
Laravel 4 Library for calling http://rate-exchange.appspot.com/currency API.
This library provides an easy way to make the currency exchange, a much needed application in ecommerce systems.
Just install the package, add the config and it is ready to use!
Requirements
- PHP >= 5.3.7
 - cURL Extension
 
Installation
Add in composer.json
"d3catalyst/exchangerate": "dev-master"
Add the service provider and facade in your config/app.php
Service Provider
D3Catalyst\Exchangerate\Laravel4\ServiceProviders\ExchangerateServiceProvider
Facade
'Exchange'           => 'D3Catalyst\Exchangerate\Laravel4\Facades\Exchangerate',
Usage
- Usage with default setters
Set initial config
	Exchange::setCurrency('DLS','EUR');
Get exchange value / return int or float value
	Exchange::getExchangeValue();
- Usage with independent setters
Set country currency code from
	Exchange::setCurrencyFrom($currency);
Set country currency code to
	Exchange::setCurrencyTo($currency);
Set amount - number
	Exchange::setAmount($amount);
Get exchange value / return int or float value
	Exchange::getExchangeValue();
- Common
Get full exchange rate information
	Exchange::getExchangeRateInfo();