PHP Classes

PHP Naira Currency Exchange Rate: Get conversion rate for Naira to other currencies

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 24 All time: 11,232 This week: 524Up
Version License PHP version Categories
naira-exchange-rates 1.0.0Custom (specified...5PHP 5, Web services, Finances
Description 

Author

This package is specific mainly for applications used in Nigeria Nigeria .

This package can get the conversion rate for Naira to other currencies.

It can send HTTP requests to the an API that get the exchange rates between the Naira currency and other common currencies like the USD, GBP, EUR, JPY, XAF, CNY, QAR, ZAR and SEK.

The API can return exchange rates from Foreign CBN, Bureau De Change, Bank, Western Union and MoneyGram.

Picture of Edward Paul
  Performance   Level  
Name: Edward Paul is available for providing paid consulting. Contact Edward Paul .
Classes: 18 packages by
Country: Nigeria Nigeria
Age: 33
All time rank: 271118 in Nigeria Nigeria
Week rank: 192 Up5 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

Documentation

Naira ExchangeRatesAPI - Naira Currency Exchange Rates API SDK

Latest Version on Packagist Build Status Quality Score Total Downloads

Free Naira Exchange Rates API, which provides past or recent exchange rate lookups. It features a number of useful functions and can be installed easily using Composer..

Installation

You can install the package via composer:

composer require infinitypaul/naira-exchange-rates

Alternatively, you can download all files from the src/ directory and include them in your project. Important note: if you're manually installing the SDK, you must also install Guzzle Client.

Usage

The Naira Currency Exchange API does require API keys or authentication in order to access and interrogate its API, Register and get your token on http://nairaexchangerate.herokuapp.com/.

Basic usage:<br />

Fetch the latest exchange rates

$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->fetch();

Historical Data:<br /> Get historical rates for any day since 1999:

$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->addDateFrom('2019-11-26')->fetch();

Fetch Specific Rate:<br /> If you do not want all current rates, it's possible to specify only the currencies you want

$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->setBaseCurrency('usd')->fetch();

4. API Reference:

The following API reference lists the publicly-available methods for the

NairaExchangeRatesAPI Reference:

addDateFrom( string $from ):<br /> Set the date from which to retrieve historic rates. $from should be a string containing an ISO 8601 date.

setType( string $to ):<br /> Set The Exchange Rate Type You Want To Retrieve, we have the following types 1. cbn Central Bank Of Nigeria Rate 2. bdc Burueu The Change Rate 3. bank Bank Rate 4. moneygram MoneyGram Rate 5. westernunion Western Union Rate

addDateTo( string $type ):<br /> Set the end date for the retrieval of historic rates. $to should be a string containing an ISO 8601 date.

setBaseCurrency( string $code ):<br /> Set the base currency you want to retrieve. $code should be passed an ISO 4217 code (e.g. EUR).<br /> $code must be one of the supported currency codes.

fetch():<br /> Send off the request to the API and return either a Json,

5. Supported Currencies:

The library supports the following currencies USD, GBP, EUR, JPY, XAF, CNY, QAR, ZAR, SEK:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Bug & Features

If you have spotted any bugs, or would like to request additional features from the library, please file an issue via the Issue Tracker on the project's Github page: https://github.com/infinitypaul/naira-exchange-rates/issues.

Credits

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to follow me on twitter!

Thanks!<br> Edward Paul.

License

The MIT License (MIT). Please see License File for more information.


  Files folder image Files (22)  
File Role Description
Files folder image.idea (5 files)
Files folder imagesrc (2 files, 2 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (22)  /  .idea  
File Role Description
  Accessible without login Plain text file misc.xml Data Auxiliary data
  Accessible without login Plain text file modules.xml Data Auxiliary data
  Accessible without login Plain text file naira-exchange-rates.iml Data Auxiliary data
  Accessible without login Plain text file php.xml Data Auxiliary data
  Accessible without login Plain text file workspace.xml Data Auxiliary data

  Files folder image Files (22)  /  src  
File Role Description
Files folder imageExceptions (1 file)
Files folder imageTraits (3 files)
  Plain text file NairaExchangeRates.php Class Class source
  Plain text file Response.php Class Class source

  Files folder image Files (22)  /  src  /  Exceptions  
File Role Description
  Plain text file Exceptions.php Class Class source

  Files folder image Files (22)  /  src  /  Traits  
File Role Description
  Plain text file CurrencyTraits.php Class Class source
  Plain text file DateTraits.php Class Class source
  Plain text file TypeTraits.php Class Class source

  Files folder image Files (22)  /  tests  
File Role Description
  Plain text file ExampleTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:24
This week:0
All time:11,232
This week:524Up