EndlessVanguard / bitcoin-remunerate-api

A scheme for trustless, decentralized, anonymous, remuneration for content creators.
1 stars 0 forks source link

Add currency and price to Content validation #26

Closed fromheten closed 8 years ago

fromheten commented 8 years ago

Fixes #25

Currently the Content record type does not make sure we have currency and amount specified.

mattgstevens commented 8 years ago

We will want to store and do maths as integers since floating point math is not precise http://stackoverflow.com/questions/588004/is-floating-point-math-broken

When we support other currencies, we can translate from a "natural" currency number (like $5.67 or 5,67€) to our internal representation in pennies 567. Stripe is also storing the amount as an int for similar reasons https://stripe.com/docs/api#charge_object-amount

mattgstevens commented 8 years ago

Looks good to me, opened issue #28 with the above comment for when we add currencies other than satoshi

fromheten commented 8 years ago

Re: Integers for currencies: I'm with ya man, that is the way to go. I guess we just have to decide how precise we can be - or just use the lowest that is common in the region where the currency is used (so x.xx for dollars and euros and pound, x for yen, etc).

fromheten commented 8 years ago

What the hell, Stripe write "öre" in here for describing pennies?! Is that a word in English?

screen shot 2016-04-13 at 13 32 55