Altcoin Problem

Look here if you're having trouble with BitShop
Post Reply
vietbet
Posts: 2
Joined: Mon Oct 22, 2018 11:43 am

Altcoin Problem

Post 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
User avatar
bitfreak
Site Admin
Posts: 98
Joined: Thu Dec 10, 2015 6:57 pm
Location: Australia
Contact:

Re: Altcoin Problem

Post 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;
  }
}
vietbet
Posts: 2
Joined: Mon Oct 22, 2018 11:43 am

Re: Altcoin Problem

Post by vietbet »

"There was an error generating the payment address. Go back and try again."

New error, please help. Thank you
User avatar
bitfreak
Site Admin
Posts: 98
Joined: Thu Dec 10, 2015 6:57 pm
Location: Australia
Contact:

Re: Altcoin Problem

Post 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
Post Reply