Page 1 of 1

Altcoin Problem

Posted: Wed Nov 07, 2018 3:03 pm
by vietbet
Hello,
I had been setup LTC deamon, add my rpcuser and rpcpassword, when i made payment i chose payment method LTC and price change to 0 LTC and next have error "There's a problem calculating the total order cost. Go back and try again." Please help me. I'm using bitshop via Tor.
Thank you

Re: Altcoin Problem

Posted: Mon Nov 19, 2018 2:37 pm
by bitfreak
Looks like the cryptocoincharts.info API is no longer available, it was used to get the exchange rate for altcoins during checkout. For now the issue can be fixed by doing the following.

Open sci/gateways/default/config.php and you should see these two lines near the bottom:

Code: Select all

$altcoin_api = 'http://api.cryptocoincharts.info/tradingPair/';
$alt_btc_api = $altcoin_api.strtolower($altcoin_code)."_btc";
Replace them both with this single line of code:

Code: Select all

$alt_btc_api = 'https://min-api.cryptocompare.com/data/price?fsym='.strtoupper($altcoin_code).'&tsyms=BTC';
Next open lib/special.lib.php and replace the alt_btc_pair() function with this:

Code: Select all

function alt_btc_pair($btc_val, $api_url) {
  $alt_parr = json_decode(bitsci::curl_simple_post($api_url));
  if (!empty($alt_parr) && bccomp($alt_parr->BTC, '0') == 1) {
	return bcdiv($btc_val, $alt_parr->BTC);
  } else {
	return false;
  }
}

Re: Altcoin Problem

Posted: Sat Dec 01, 2018 4:11 pm
by vietbet
"There was an error generating the payment address. Go back and try again."

New error, please help. Thank you

Re: Altcoin Problem

Posted: Thu Dec 06, 2018 9:34 am
by bitfreak
Open sci/payment.php and search for this bit of code:

Code: Select all

      if (empty($pub_add) || !empty($_SESSION[$rpc_client]->error)) {
        die(LANG('ERROR_GEN_ADDRESS').' '.LANG('TRY_AGAIN_BACK'));
      }
Place this line of code on the line before die() so you see what the error is:

Code: Select all

var_dump($_SESSION[$rpc_client]->error);
I suspect it may be because your Litecoin daemon was compiled without the --enable-wallet option. This may help:
https://bitcoin.stackexchange.com/quest ... -not-found