Hi, as I find out under "Localisation->Currencies" the currencies do no more update because Yahoo stopped the service.

Regards

Hermann
In General
Saturday, November 04 2017, 05:16 AM
Share this post:
Responses (5)
  • Accepted Answer

    Saturday, November 04 2017, 08:12 PM - #Permalink
    Darn, I had not noticed it, thanks for letting us know.

    Added it to GitHub Issues: https://github.com/arastta/arastta/issues/729
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 08 2017, 04:26 AM - #Permalink
    My old website uses http://www.webservicex.net

    If it helps, here's the file contents.

    <?php

    class CURRENCY_WEBSERVICEX extends ISC_CURRENCY
    {
    public $_id;
    public $_name;
    public $_description;
    public $_help;
    public $_url;
    public $_targetURL;

    public function __construct()
    {
    // Setup the required variables for the module
    parent::__construct();

    $this->_id = "currency_webservicex";
    $this->_name = GetLang("CWebXName");
    $this->_description = GetLang("CWebXDesc");
    $this->_help = GetLang("CWebXHelp");
    $this->_url = "http://www.webservicex.net";

    // Target URL
    $this->_targetURL = "http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate";
    }

    public function FetchExchangeRate($fromCode, $toCode)
    {
    // Can make a SOAP request but a REST (POST or GET) request is quicker
    // The fields to post
    $postFields = "FromCurrency=" . urlencode(strtoupper($fromCode)) . "&ToCurrency=" . urlencode(strtoupper($toCode));

    $rtn = PostToRemoteFileAndGetResponse($this->GetTargetURL(), $postFields);

    // If we have failed then there is nothing really useful you can tell the client other than this service is temporarly unavailable
    if (!$rtn) {
    $this->SetError(GetLang("CurrencyProviderRequestUnavailable"));
    return false;
    }

    // Now we parse the return XML. Its not a big XML result and we only need one value out of it so we don't need anything heavy to read it.
    // If the parsing failed or if we didn't receive a value then we wern't given a valid XML due to the code(s) being incorrect
    $xml = @simplexml_load_string($rtn);
    if(!is_object($xml)) {
    $this->SetError(GetLang("CurrencyProviderRequestInvalidCode"));
    return false;
    }

    if (empty($xml)) {
    return (double)$xml;
    } else {
    return (double)$xml[0];
    }
    }
    }
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 08 2017, 04:27 AM - #Permalink
    Note that it is written in php 5.2 so it may need updating.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 03 2018, 10:54 PM - #Permalink
    Dear Rune,

    I'm sorry to see that nobody has resolved this currency issue in GitHub.

    Kind regards

    Hermann
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 04 2018, 12:05 AM - #Permalink
    Me too Hermann, me too ...
    The reply is currently minimized Show
Your Reply