ProtonMail / WebClients

Monorepo hosting the proton web clients
GNU General Public License v3.0
4.36k stars 555 forks source link

Custom bitcoin amount off by a factor #165

Closed warren-axiell closed 3 years ago

warren-axiell commented 4 years ago

Describe the bug

When you go to "Add Credits" and type in a custom bitcoin value the generated "Amount BTC" is off by a factor.

To Reproduce

Login to protonmail go to "Dashboard" click "Add Credits" Select "Payment method" = bitcoin Under "Amount" type in "100"

The Amount BTC shows "0.00126986" which is off by a factor ~$10USD today.

Expected behavior

Amount BTC should show "0.0126986"

Screenshots

photo_2019-11-20_10-27-15

I was also able to reproduce this by curling the API e.g:

curl 'https://mail.protonmail.com/api/payments/bcinfo' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0' -H 'Accept: application/vnd.protonmail.v1+json'...........

I couldn't find the relevant code in the repository.

N4M3Z commented 4 years ago

We overcharge by 3% to supress conversion underpayments, so this is expected.

warren-axiell commented 4 years ago

you are undercharging by 90%. I discovered the bug by typing $80 in the box but only actually getting $8 deposited.

N4M3Z commented 4 years ago

This is a different issue.

warren-axiell commented 4 years ago

The above screenshot shows 100 USD but the BTC QR is for 0.00126963 which is $10.

what is different?