Better HN
topnewbestaskshowjobs
Log inSign up

adenhoed

19 karma · joined Jan 21, 2019 (7y ago) · 5 submissions

Submissions

comment 3y ago · link · parent

It's nice if your language has support for monetary amounts, but usually you end up using multiple languages that interact with the same database model, and you still end up using a built in numeric datatype in your RDBMS of choice.

Three additional 'mistakes' to prevent when dealing with money representations:

1. The definition of a currency might change. For example, some years ago Iceland decided to change the exponent of ISK from 2 to 0. Currencies have different versions.

2. As a FinTech you probably have integrations with many third parties, they don't change their exponents for a currency at the same time. Keep track of what third parties think the correct exponent is at any point in time, and convert between your representation and their representation. Otherwise, you'll have interesting incidents (e.g. transferring 100x the intended amount of ISK).

3. At first you think that counting minor units as an integer is enough, and then you need to start accounting for fractions of cents because sales people sold something for a fee of $0.0042 per transaction. If your code rounds all these fees to $0.00 you don't make any money.

comment 5y ago · link · parent

flushHeaders() is there to have a simple bug to find. In real world cases, tools like tcpdump and strace are essential, and I think this is a nice way to teach about how these tools can be used.

comment 5y ago · link · parent

While processing a payment a psp/acquirer is mostly receiving money, so no need to check if there is balance available. Only for cases like refunds and card payouts you need to know if a merchant has sufficient balance to process the request.

comment 7y ago · link · parent

No, if you replace it they don't have a key, and you don't have to give it to them.

comment 7y ago · link · parent

In The Netherlands you have the right to replace the locks with your own locks, as long as you can re-install the original lock once you move out.

How is that arranged in the US?