Open extra topbar

Cannot enter fixer.io API key due to form validation

I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Cannot enter fixer.io API key due to form validation

dashed-slug.net Forums General discussion Cannot enter fixer.io API key due to form validation

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #12041
    relainhu
    Participant

    Hello,

    I have tried adding fixer.io API to my site, but it says error ‘Please match the format requested’. It seems like fixer.io moved to APILayer, so the only way to get an API is through them, I can’t register to fixer.io directly.

    See photos attached.

    Attachments:
    You must be logged in to view attached files.
    #12045
    relainhu
    Participant

    Maybe it is something to do with the Free Plan no longer being enough?

    Attachments:
    You must be logged in to view attached files.
    #12047
    alexg
    Keymaster

    Hello,

    Thank you for letting me know. The free plan should be sufficient.

    The API keys, including the one I currently have, used to be 32 hexadecimal digits. It seems that with their switch to API layer, they now use the entire alphabet.

    There is a regex validation on the API key, but it’s only applied on the frontend. The value you entered as an admin is not validated on the backend (except for SQL injections, of course).

    I will patch the plugin. In the mean time, you can delete the following three lines from your code, and you will be able to enter your key:

    https://github.com/dashed-slug/wallets/blob/6.0.0-RC1/admin/settings.php#L794-L796

    You can find this file at wp-content/plugins/wallets/admin/settings.php.

    Thank you for providing screenshots. I have deleted the screenshot displaying your personal key from this public forum.

    with regards

    #12052
    relainhu
    Participant

    Thank you for the fast response. I have managed to delete the code, managed to fill in the API form, however nothing happened after 5 hours. Maybe because they have migrated to APILayer, something else needs to be done code-wise?

    Attachments:
    You must be logged in to view attached files.
    #12058
    alexg
    Keymaster

    Hello,

    I have also deleted the form validation in version 6.0.0-RC2. Thanks for the feedback, I’m really interested in your first impressions, and pitfalls.

    You mentioned that nothing happened after 5 hours. Normally, there should be fiat currencies being created.

    1. Go to Currencies. Are there any fiat currencies there?

    2. Were you using your site at all during those 5 hours? If your site doesn’t get traffic, the cron jobs won’t run. Ideally you should be triggering cron externally, as explained in SettingsBitcoin and Altcoin WalletsCron tasks.

    3. Ultimately the way to know what happened is to look at the logs. Can you enable verbose logging? This is in: SettingsBitcoin and Altcoin WalletsVerbose logging. This requires editing wp-config, as explained on-screen. Add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to your wp-config.php, then enable verbose logging and check the logfile.

    If you collect the logs from a single cron run, it will be obvious what is going on.

    Again thank you very much for testing. Let me know what the logs say.

    #12061
    relainhu
    Participant

    Hello there, thanks for the fast response. I am attaching below the debug.log screenshot especially for the fixer.io part. It seems like no matter if I managed to enter the API key, it still comes up as ‘????????????????’.

    Attachments:
    You must be logged in to view attached files.
    #12063
    relainhu
    Participant

    I have tried finding the API key in DB, but could not find it.

    Attachments:
    You must be logged in to view attached files.
    #12065
    relainhu
    Participant

    Sorry for the multiple replies, I have found it in DB and everything seems to be good, not sure why the cron_task cannot retrieve it.

    Attachments:
    You must be logged in to view attached files.
    #12067
    alexg
    Keymaster

    Hello,

    Thanks for providing a view of your logs. Your API key is masked in the logs with ? characters intentionally. This is so that if the logs get stolen, any sensitive information is not in there.

    You can view your api key with wp-cli: wp option get wallets_fiat_fixerio_key

    I have signed up for a new apilayer key and I gοt the same result as you. Turns out that the old fixer.io keys are handled differently to the new apilayer keys.

    I will upload a fix shortly.

    Thank you for finding this issue, I never would have found it because I was using my old key and hadn’t realized that things have changed since then.

    #12070
    alexg
    Keymaster

    I have uploaded a fix for this with version 6.0.0-RC3.

    Before the free plan would allow 750 calls per month, so it was ok to contact the API every hour.

    Now the free plan allows 100 requests per month, so I’ve set the fiat rates to update every 8 hours.

    This should be ok, since fiat currencies have low volatility, compared to cryptos.

    Again thank you for your help. Let me know if you encounter more difficulties.

    with regards

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.