Mtgox has stopped giving out exchange data. The follwing code mod will get the exchange rate from btc-e.com
Line 368:
$mtGox_currencies = array(
'USD',
'EUR',
'GBP',
);
// @todo add cache
if (in_array($order->currency, $mtGox_currencies)) {
if ($response = file_get_contents('https://btc-e.com/api/2/btc_' . strtolower($order->currency) . '/ticker')) {
#if ($response->code == 200) {
$data = json_decode($response,true);
if(!empty($data['ticker']['avg'])) {
$rate = $data['ticker']['avg'];
}
#}
}
}Todo: get list of supported curencies from btc-e, read the http headers to check for http 200 response code or re-use drupal http request.
I hope you will be able to adapt the the module
Comments
Comment #1
dgtlmoon commented