ardigital / tbc-exchange-rates
Tbc Bank 商业汇率 - 格鲁吉亚拉里
dev-master
2022-08-16 13:15 UTC
Requires
- php: ^7.2.5 || ^8.0
- guzzlehttp/guzzle: ^7.0.1
This package is auto-updated.
Last update: 2024-09-16 17:50:16 UTC
README
此包允许您使用 TbcBank API 交换汇率
目录
安装
composer require ardigital/tbc-exchange-rates
对于 Laravel >= 7.0
打开 config/app.php
并将 TbcExchangeRatesServiceProvider
添加到 providers
数组中。
'providers' => [ ArDigital\TbcExchangeRates\TbcExchangeRatesServiceProvider::class, ],
然后运行
php artisan vendor:publish --provider="ArDigital\TbcExchangeRates\TbcExchangeRatesServiceProvider"
将您的 API 密钥放置在 config/tbcexchange.php
文件中或 .env 文件中
TBC_EXCHANGE_RATES_KEY="Your Api Key"
TBC_GUZZLE_VERIFY=false
用法
汇率类
在 TbcExchangeRates
类中,添加 ResultList()
方法并返回货币
use ArDigital\TbcExchangeRates\TbcExchangeRates; public function getCurrency(){ TbcExchangeRates::get(); // Return All currency TbcExchangeRates::get('USD'); // Return Usd currency USD buy and sell } OR: public function Convert(){ TbcExchangeRates::Convert(100, 'USD', 'GEL'); }