Closed ar-turek closed 6 years ago
According to this (and BTC specification in general): https://en.bitcoin.it/wiki/Help:FAQ#How_divisible_are_bitcoins.3F the smallest BTC unit is 10^(-8), which means the biggest acceptable decimal precision should be 8 decimal places.
Here: https://github.com/bitpay/php-bitpay-client/blob/master/src/Bitpay/Client/Client.php#L698 a value with 8 decimal places does not pass this check unless it's rounded up to 6 decimal places, even though in theory it should be possible to pay 0.00000001BTC.
BTW, IPN from BitPay also sends btcPrice with 6 decimal places.
btcPrice
Currently BitPay accepts 6 decimals. The BitPay lib follows this specification.
According to this (and BTC specification in general): https://en.bitcoin.it/wiki/Help:FAQ#How_divisible_are_bitcoins.3F the smallest BTC unit is 10^(-8), which means the biggest acceptable decimal precision should be 8 decimal places.
Here: https://github.com/bitpay/php-bitpay-client/blob/master/src/Bitpay/Client/Client.php#L698 a value with 8 decimal places does not pass this check unless it's rounded up to 6 decimal places, even though in theory it should be possible to pay 0.00000001BTC.