Exchange rates with zeros

Created on 5 January 2023, almost 2 years ago
Updated 10 October 2023, about 1 year ago

Problem/Motivation

"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."

When reached the API rate limit, \Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider\ExchangerProviderRemoteInterface::getRemoteData() returns NULL. Furthermore, exchange rates are set to zeros, and the DefaultExchangerCalculator does not work.

Steps to reproduce

Proposed resolution

Don't write any data if ::getRemoteData() returns NULL.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇳China jungle Chongqing, China

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇭🇷Croatia valic Osijek

    Updating to 2.0.x branch

  • 🇭🇷Croatia valic Osijek

    Let's move this to 2.0.x branch, and make changes post https://www.drupal.org/project/commerce_exchanger/issues/3366705 🐛 Latest exchange rates shouldn't be saved in config Fixed

    We are moving from config-based entities, so post that change we can review the proper approach.

    I think we should just return the exception immediately if exchanger rates from the remote are empty - this then would signal that integration is broken or the remote is down.

    currently we just silently fail, which is causing this behavior

  • Status changed to Fixed about 1 year ago
  • 🇭🇷Croatia valic Osijek

    This is now addressed with 2.0.x branch and #3366705

    If the remote data returns an empty array [] or it's just NULL, the import is throwing an error

    InvalidArgumentException: Missing required property "rates". in Drupal\commerce_exchanger\ExchangerProviderRates->__construct() (line 51 of /var/www/html/web/modules/contrib/commerce_exchanger/src/ExchangerProviderRates.php).
    
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024