Git Product home page Git Product logo

currency-layer's Issues

Plugin settings ENV vars

It would be great if you could support ENV vars in the plugin settings - specifically with the API key.

Rapid API Support (FR)

Would be so nice if there was a free option that was more robust. I've been using this particular api for a long time now and it's been 100% reliable. Unfortunately the Craft Plugin that make use of it is not well maintained.

https://rapidapi.com/natkapral/api/currency-converter5

I know it doesn't make sense that you would add support for another service to a plugin aimed specifically at currency layer, and that is why I won't begrudge you closing and ignoring this. But maybe one day you decide to expand this to a more agnostic service that can allow different providers to slot in. :)

Currencies in Craft Commerce not updating?

Hi there, mud!

I'm really sorry. Not sure if I'm doing something wrong or not, but I have Craft Commerce installed, a paid currency layer account, but the plugin's action is not updating the payment currencies in Commerce.

I'm not sure if it's a problem or not, but I don't use USD at all; just THB and AUD. The primary currency in both Commerce and Currency Layer is set to THB.

I have tried both of these, with no luck:

http://my.domain/actions/currency-layer/currency/fetch?currencies=THB,AUD
which returns:
{"source":"From Cache","cacheDuration":60,"data":{"success":true,"terms":"https://currencylayer.com/terms","privacy":"https://currencylayer.com/privacy","timestamp":1581742145,"source":"USD","quotes":{"USDTHB":31.21037,"USDAUD":1.489203}}}

http://my.domain/actions/currency-layer/currency/fetch?currencies=THB,AUD?source=THB
which returns:
{"source":"From Cache","cacheDuration":60,"data":{"success":true,"terms":"https://currencylayer.com/terms","privacy":"https://currencylayer.com/privacy","timestamp":1581738846,"source":"THB","quotes":{"THBTHB":1,"THBAUD":0.047715}}}

Neither of those actions updates the currencies in Commerce.

Any idea what I might be doing wrong?

Thanks in advance for any help or advice you may be able to give with this.

Andrew Macpherson
Sydney, Australia

Error when API cache results is turned off

I had initially had some results cached, but wanted to test something with caching turned off. However, I got the following error:

Error
Cannot use object of type stdClass as array

which reported ournameismud/currency-layer/src/services/Currency.php at line 46 as the culprit.

Craft Version: 3.4.18
Commerce Version: 3.1.3

Fix Composer 2 compatibility

When installing this plugin with Composer 1, the following deprecation notice is output:

Deprecation Notice: Class ournameismud\currencylayer\assetbundles\CurrencyLayer\CurrencyLayerAsset located in ./vendor/ournameismud/currency-layer/src/assetbundles/currencylayer/CurrencyLayerAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.

Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found errors.

To fix, run the following command:

> git mv src/assetbundles/currencylayer src/assetbundles/CurrencyLayer

Then commit your change and tag a new release.

(Note that you must use the git mv command, as Git tends to not notice case-sensitive file renames otherwise.)

Error loading Craft dashboard

Hello again, and thanks making those updates recently. Things are again working great, except for one thing. Although everything works fine on my local development site, I get an error on the main Dashboard page on my production site. All of the other pages I've checked so far seem to work just fine, so it's just the dashboard page (site.url/admin).

I tracked the problem down to capitalisation in the src/assetbundles directory. If the 'CurrencyLayer' folder is set to lowercase ('currencylayer') my dashboard works again. But obviously, (a) I don't know if this would cause issues for anyone else, and (b) I don't want to keep having to change things manually in a composer-based deployment system.

I really do hope your health is back on track again, and if it is then I hope you don't mind taking a teensy little bit more time to look into this, to see if it's a change you could make.

Thanks again for all your help, Andrew

Here's the error, by the way:

ReflectionException: Class ournameismud\currencylayer\assetbundles\currencylayer\CurrencyLayerAsset does not exist in /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php:453
Stack trace:
#0 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php(453): ReflectionClass->__construct()
#1 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php(380): yii\di\Container->getDependencies()
#2 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php(165): yii\di\Container->build()
#3 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
#4 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/AssetManager.php(264): yii\BaseYii::createObject()
#5 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/AssetManager.php(237): yii\web\AssetManager->loadBundle()
#6 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/View.php(287): yii\web\AssetManager->getBundle()
#7 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Extension/CoreExtension.php(1507): yii\web\View->registerAssetBundle()
#8 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/helpers/Template.php(92): twig_get_attribute()
#9 /home/forge/website.com/releases/20201108223808/storage/runtime/compiled_templates/58/586cb5751c2bed0476779e665cb4700342ec6c3f67efcc062709f9b488c13946.php(46): craft\helpers\Template::attribute()
#10 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(405): __TwigTemplate_399a49d6d9221ec986bfc0211d3e197261bebde53f8e868305196b72de65efc0->doDisplay()
#11 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#12 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#13 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render()
#14 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render()
#15 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/View.php(389): Twig\Environment->render()
#16 /home/forge/website.com/releases/20201108223808/vendor/ournameismud/currency-layer/src/widgets/Currency.php(91): craft\web\View->renderTemplate()
#17 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/controllers/DashboardController.php(80): ournameismud\currencylayer\widgets\Currency->getSettingsHtml()
#18 [internal function]: craft\controllers\DashboardController->actionIndex()
#19 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#20 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()
#21 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction()
#22 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction()
#23 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction()
#24 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction()
#25 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest()
#26 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#27 /home/forge/website.com/releases/20201108223808/web/index.php(21): yii\base\Application->run()
#28 {main}

Next yii\base\InvalidConfigException: Failed to instantiate component or class "ournameismud\currencylayer\assetbundles\currencylayer\CurrencyLayerAsset". in /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php:455
Stack trace:
#0 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php(380): yii\di\Container->getDependencies()
#1 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/di/Container.php(165): yii\di\Container->build()
#2 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
#3 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/AssetManager.php(264): yii\BaseYii::createObject()
#4 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/AssetManager.php(237): yii\web\AssetManager->loadBundle()
#5 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/View.php(287): yii\web\AssetManager->getBundle()
#6 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Extension/CoreExtension.php(1507): yii\web\View->registerAssetBundle()
#7 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/helpers/Template.php(92): twig_get_attribute()
#8 /home/forge/website.com/releases/20201108223808/storage/runtime/compiled_templates/58/586cb5751c2bed0476779e665cb4700342ec6c3f67efcc062709f9b488c13946.php(46): craft\helpers\Template::attribute()
#9 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(405): __TwigTemplate_399a49d6d9221ec986bfc0211d3e197261bebde53f8e868305196b72de65efc0->doDisplay()
#10 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#11 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#12 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render()
#13 /home/forge/website.com/releases/20201108223808/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render()
#14 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/View.php(389): Twig\Environment->render()
#15 /home/forge/website.com/releases/20201108223808/vendor/ournameismud/currency-layer/src/widgets/Currency.php(91): craft\web\View->renderTemplate()
#16 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/controllers/DashboardController.php(80): ournameismud\currencylayer\widgets\Currency->getSettingsHtml()
#17 [internal function]: craft\controllers\DashboardController->actionIndex()
#18 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#19 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()
#20 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction()
#21 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction()
#22 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction()
#23 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction()
#24 /home/forge/website.com/releases/20201108223808/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest()
#25 /home/forge/website.com/releases/20201108223808/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#26 /home/forge/website.com/releases/20201108223808/web/index.php(21): yii\base\Application->run()
#27 {main}

Craft 4 Compatibility

Hi Cole

I know you're usually really busy, but I was just wondering if you had any plans for updating the plugin to add Craft 4 compatibility?

Totally understand if you don't, but if I know the situation I can start looking at alternatives if necessary.

Thanks heaps, Andrew

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.