2017 © Pedro Peláez
 

library currency

Currency API (currently OpenExchangeRate) Wrapper for PHP

image

gufy/currency

Currency API (currently OpenExchangeRate) Wrapper for PHP

  • Friday, June 10, 2016
  • by mgufron
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Currency API Wrapper for API

Build Status Coverage Status, (*1)

Table of contents

Installation

Just run this simple command through your command line, (*2)

composer require gufy/currency:~1

Or update manually your composer.json, (*3)

{
  "require":{
    ...
    "gufy/currency":"~1"
    ...
  }
}

Usage

This package currently only support OpenExchangeRates as the main API., (*4)

Getting latest currency rates

<?php
include 'vendor/autoload.php';

use Gufy\Currency\OpenExchange;

$api = new OpenExchange("your-app-id");
$rates = $api->rates();

Getting currency rates based on date

<?php
include 'vendor/autoload.php';

use Gufy\Currency\OpenExchange;
$date = "2016-06-06";
$api = new OpenExchange("your-app-id");
$rates = $api->rates("USD", $date);

Convert value to some currency

<?php
include 'vendor/autoload.php';

use Gufy\Currency\OpenExchange;
$api = new OpenExchange("your-app-id");
$value = 10;
$base = "USD";
$target = "IDR";
$rates = $api->convert($value, $base, $target);

Get all available currencies

<?php
include 'vendor/autoload.php';

use Gufy\Currency\OpenExchange;

$api = new OpenExchange("your-app-id");
$rates = $api->currencies();

The Versions

10/06 2016

dev-master

9999999-dev

Currency API (currently OpenExchangeRate) Wrapper for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mochamad Gufron

10/06 2016

v1.0.0

1.0.0.0

Currency API (currently OpenExchangeRate) Wrapper for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mochamad Gufron