我在laravel项目中使用汇率api (florianv/laravel-swap)
兑换外币汇率。
我的composer.json
因关联而被剪掉:
"require": {
"php": "^7.1.3",
"florianv/laravel-swap": "^1.3",
},
虽然api在我的本地环境中提供值,但它在生产环境中引发了异常。
The chain resulted in 2 exception(s):
Exchanger\Exception\Exception: The maximum allowed API amount of
monthly API requests has been reached.
Exchanger\Exception\Exception: The currency is not supported or
Google changed the response format
错误本身很清楚。但是在升级api计划之前,我想我会尝试使用另一个api密钥,我从fixer.io获得了免费的api密钥,并将其插入到项目的config/swap.php
文件中。
/*Config/Swap.php*/
'services' => [
'fixer' => [
'access_key' => 'MY_ACCESS_KEY', // Your app id
],
'google' => true,
],
错误仍然存在。
我应该在其他地方输入密钥吗?它在我的本地环境而不是生产环境中如何工作?
答案 0 :(得分:0)
选择其他服务而不是Google。
或者您可以使用最新版本并遵循文档。