定制 hexcores/currency 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hexcores/currency

最新稳定版本:0.0.5

Composer 安装命令:

composer require hexcores/currency

包简介

Currency converter library

README 文档

README

Currency package is easy to use multiple currency value (format) at your application. (eg: E-Commerce)

Build Status License

Package Dependencies

  • "php": ">=5.3.0"

Exchange Services

Formatter Services

  • BaseFormatter

Supported Currency Types

  • AUD (Australian dollar)
  • CNY (Chinese renminbi)
  • EUR (European Euro)
  • GBP (Pound Sterling)
  • JPY (Japanese yen)
  • MMK (Myanmar Kyats)
  • SGD (Singapore Dollar)
  • THB (Thai Baht)
  • USD (US Dollar)

Install

You can install currency package from composer

{
    "require": {
        "hexcores/currency": "dev-master"
    }
}

Usage

	use Hexcores\Currency\Type;
	use Hexcores\Currency\Converter;
	use Hexcores\Currency\Http\Client;
	use Hexcores\Currency\Formatter\BaseFormatter;
	use Hexcores\Currency\Exchange\CentralBankMyanmarExchange;

	$ex = new CentralBankMyanmarExchange(new Client());
	$f = new BaseFormatter();
	$converter = new Converter($ex, $f);

	echo "Convert : ". $converter->convert(2500, Type::USD, Type::MMK);
	echo "<br>Convert AUD: ". $converter->convert(2500, Type::USD, Type::AUD);

Use central bank exchange with factory

	use Hexcores\Currency\Type;
	use Hexcores\Currency\Factory;

	$converter = Factory::centralBank();

	echo "Convert : ". $converter->convert(2500, Type::USD, Type::MMK);
	echo "<br>Convert AUD: ". $converter->convert(2500, Type::USD, Type::AUD);

Example

You can run example.php file from example folder.

Testing

$ phpunit

Contributing

TODO

统计信息

  • 总下载量: 86
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-15